patch 'net/tap: use correct length for interface names' has been queued to stable release 24.11.5
luca.boccassi at gmail.com
luca.boccassi at gmail.com
Thu Mar 19 23:02:21 CET 2026
Hi,
FYI, your patch has been queued to stable release 24.11.5
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/21/26. So please
shout if anyone has objections.
Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.
Queued patches are on a temporary branch at:
https://github.com/bluca/dpdk-stable
This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/750d2f32e9a49dbbffbe25cea495cb2b13f32fd7
Thanks.
Luca Boccassi
---
>From 750d2f32e9a49dbbffbe25cea495cb2b13f32fd7 Mon Sep 17 00:00:00 2001
From: Stephen Hemminger <stephen at networkplumber.org>
Date: Sun, 22 Feb 2026 09:30:38 -0800
Subject: [PATCH] net/tap: use correct length for interface names
[ upstream commit 0e5bbe2a4b25aab4c83cf4234212a8064de18f52 ]
The interface names in the driver internals are Linux
kernel network interface names which have a maximum size of 16;
not DPDK device names which can take up to 64 characters.
Fixes: 02f96a0a82d1 ("net/tap: add TUN/TAP device PMD")
Signed-off-by: Stephen Hemminger <stephen at networkplumber.org>
---
drivers/net/tap/rte_eth_tap.c | 28 ++++++++++++++--------------
drivers/net/tap/rte_eth_tap.h | 4 ++--
2 files changed, 16 insertions(+), 16 deletions(-)
diff --git a/drivers/net/tap/rte_eth_tap.c b/drivers/net/tap/rte_eth_tap.c
index 14fcb04900..8e1d02c344 100644
--- a/drivers/net/tap/rte_eth_tap.c
+++ b/drivers/net/tap/rte_eth_tap.c
@@ -214,7 +214,7 @@ tun_alloc(struct pmd_internals *pmd, int is_keepalive, int persistent)
* and need to find the resulting device.
*/
TAP_LOG(DEBUG, "Device name is '%s'", ifr.ifr_name);
- strlcpy(pmd->name, ifr.ifr_name, RTE_ETH_NAME_MAX_LEN);
+ strlcpy(pmd->name, ifr.ifr_name, IFNAMSIZ);
if (is_keepalive) {
/*
@@ -1904,7 +1904,7 @@ static const struct eth_dev_ops ops = {
static int
eth_dev_tap_create(struct rte_vdev_device *vdev, const char *tap_name,
- char *remote_iface, struct rte_ether_addr *mac_addr,
+ const char *remote_iface, struct rte_ether_addr *mac_addr,
enum rte_tuntap_type type, int persist)
{
int numa_node = rte_socket_id();
@@ -2060,7 +2060,7 @@ eth_dev_tap_create(struct rte_vdev_device *vdev, const char *tap_name,
pmd->name, remote_iface);
goto error_remote;
}
- strlcpy(pmd->remote_iface, remote_iface, RTE_ETH_NAME_MAX_LEN);
+ strlcpy(pmd->remote_iface, remote_iface, IFNAMSIZ);
/* Save state of remote device */
tap_ioctl(pmd, SIOCGIFFLAGS, &pmd->remote_initial_flags, 0, REMOTE_ONLY);
@@ -2177,10 +2177,10 @@ set_interface_name(const char *key __rte_unused,
value);
return -1;
}
- strlcpy(name, value, RTE_ETH_NAME_MAX_LEN);
+ strlcpy(name, value, IFNAMSIZ);
} else {
/* use tap%d which causes kernel to choose next available */
- strlcpy(name, DEFAULT_TAP_NAME "%d", RTE_ETH_NAME_MAX_LEN);
+ strlcpy(name, DEFAULT_TAP_NAME "%d", IFNAMSIZ);
}
return 0;
}
@@ -2198,7 +2198,7 @@ set_remote_iface(const char *key __rte_unused,
value);
return -1;
}
- strlcpy(name, value, RTE_ETH_NAME_MAX_LEN);
+ strlcpy(name, value, IFNAMSIZ);
}
return 0;
@@ -2249,13 +2249,13 @@ rte_pmd_tun_probe(struct rte_vdev_device *dev)
const char *name, *params;
int ret;
struct rte_kvargs *kvlist = NULL;
- char tun_name[RTE_ETH_NAME_MAX_LEN];
- char remote_iface[RTE_ETH_NAME_MAX_LEN];
+ char tun_name[IFNAMSIZ];
+ char remote_iface[IFNAMSIZ];
struct rte_eth_dev *eth_dev;
name = rte_vdev_device_name(dev);
params = rte_vdev_device_args(dev);
- memset(remote_iface, 0, RTE_ETH_NAME_MAX_LEN);
+ memset(remote_iface, 0, IFNAMSIZ);
if (rte_eal_process_type() == RTE_PROC_SECONDARY &&
strlen(params) == 0) {
@@ -2271,7 +2271,7 @@ rte_pmd_tun_probe(struct rte_vdev_device *dev)
}
/* use tun%d which causes kernel to choose next available */
- strlcpy(tun_name, DEFAULT_TUN_NAME "%d", RTE_ETH_NAME_MAX_LEN);
+ strlcpy(tun_name, DEFAULT_TUN_NAME "%d", IFNAMSIZ);
if (params && (params[0] != '\0')) {
TAP_LOG(DEBUG, "parameters (%s)", params);
@@ -2412,8 +2412,8 @@ rte_pmd_tap_probe(struct rte_vdev_device *dev)
int ret;
struct rte_kvargs *kvlist = NULL;
int speed;
- char tap_name[RTE_ETH_NAME_MAX_LEN];
- char remote_iface[RTE_ETH_NAME_MAX_LEN];
+ char tap_name[IFNAMSIZ];
+ char remote_iface[IFNAMSIZ];
struct rte_ether_addr user_mac = { .addr_bytes = {0} };
struct rte_eth_dev *eth_dev;
int tap_devices_count_increased = 0;
@@ -2464,8 +2464,8 @@ rte_pmd_tap_probe(struct rte_vdev_device *dev)
speed = RTE_ETH_SPEED_NUM_10G;
/* use tap%d which causes kernel to choose next available */
- strlcpy(tap_name, DEFAULT_TAP_NAME "%d", RTE_ETH_NAME_MAX_LEN);
- memset(remote_iface, 0, RTE_ETH_NAME_MAX_LEN);
+ strlcpy(tap_name, DEFAULT_TAP_NAME "%d", IFNAMSIZ);
+ memset(remote_iface, 0, IFNAMSIZ);
if (params && (params[0] != '\0')) {
TAP_LOG(DEBUG, "parameters (%s)", params);
diff --git a/drivers/net/tap/rte_eth_tap.h b/drivers/net/tap/rte_eth_tap.h
index ce4322ad04..e29f2b04df 100644
--- a/drivers/net/tap/rte_eth_tap.h
+++ b/drivers/net/tap/rte_eth_tap.h
@@ -68,8 +68,8 @@ struct tx_queue {
struct pmd_internals {
struct rte_eth_dev *dev; /* Ethernet device. */
- char remote_iface[RTE_ETH_NAME_MAX_LEN]; /* Remote netdevice name */
- char name[RTE_ETH_NAME_MAX_LEN]; /* Internal Tap device name */
+ char remote_iface[IFNAMSIZ]; /* Remote netdevice name */
+ char name[IFNAMSIZ]; /* Internal Tap device name */
int type; /* Type field - TUN|TAP */
int persist; /* 1 if keep link up, else 0 */
struct rte_ether_addr eth_addr; /* Mac address of the device port */
--
2.47.3
---
Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- - 2026-03-19 22:00:48.867947295 +0000
+++ 0029-net-tap-use-correct-length-for-interface-names.patch 2026-03-19 22:00:47.806359366 +0000
@@ -1 +1 @@
-From 0e5bbe2a4b25aab4c83cf4234212a8064de18f52 Mon Sep 17 00:00:00 2001
+From 750d2f32e9a49dbbffbe25cea495cb2b13f32fd7 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 0e5bbe2a4b25aab4c83cf4234212a8064de18f52 ]
+
@@ -11 +12,0 @@
-Cc: stable at dpdk.org
@@ -20 +21 @@
-index 01af90e7b2..70180fac99 100644
+index 14fcb04900..8e1d02c344 100644
@@ -23 +24 @@
-@@ -203,7 +203,7 @@ tun_alloc(struct pmd_internals *pmd, int is_keepalive, int persistent)
+@@ -214,7 +214,7 @@ tun_alloc(struct pmd_internals *pmd, int is_keepalive, int persistent)
@@ -32 +33 @@
-@@ -1994,7 +1994,7 @@ static const struct eth_dev_ops ops = {
+@@ -1904,7 +1904,7 @@ static const struct eth_dev_ops ops = {
@@ -41 +42 @@
-@@ -2125,7 +2125,7 @@ eth_dev_tap_create(struct rte_vdev_device *vdev, const char *tap_name,
+@@ -2060,7 +2060,7 @@ eth_dev_tap_create(struct rte_vdev_device *vdev, const char *tap_name,
@@ -49,2 +50,2 @@
- if (tap_nl_get_flags(pmd->nlsk_fd, pmd->remote_if_index,
-@@ -2228,10 +2228,10 @@ set_interface_name(const char *key __rte_unused,
+ tap_ioctl(pmd, SIOCGIFFLAGS, &pmd->remote_initial_flags, 0, REMOTE_ONLY);
+@@ -2177,10 +2177,10 @@ set_interface_name(const char *key __rte_unused,
@@ -63 +64 @@
-@@ -2249,7 +2249,7 @@ set_remote_iface(const char *key __rte_unused,
+@@ -2198,7 +2198,7 @@ set_remote_iface(const char *key __rte_unused,
@@ -72 +73 @@
-@@ -2300,13 +2300,13 @@ rte_pmd_tun_probe(struct rte_vdev_device *dev)
+@@ -2249,13 +2249,13 @@ rte_pmd_tun_probe(struct rte_vdev_device *dev)
@@ -89 +90 @@
-@@ -2322,7 +2322,7 @@ rte_pmd_tun_probe(struct rte_vdev_device *dev)
+@@ -2271,7 +2271,7 @@ rte_pmd_tun_probe(struct rte_vdev_device *dev)
@@ -98 +99 @@
-@@ -2463,8 +2463,8 @@ rte_pmd_tap_probe(struct rte_vdev_device *dev)
+@@ -2412,8 +2412,8 @@ rte_pmd_tap_probe(struct rte_vdev_device *dev)
@@ -109 +110 @@
-@@ -2515,8 +2515,8 @@ rte_pmd_tap_probe(struct rte_vdev_device *dev)
+@@ -2464,8 +2464,8 @@ rte_pmd_tap_probe(struct rte_vdev_device *dev)
@@ -121 +122 @@
-index 59d61582cc..c9c6126d4c 100644
+index ce4322ad04..e29f2b04df 100644
More information about the stable
mailing list