patch 'net/tap: use correct length for interface names' has been queued to stable release 23.11.7

Shani Peretz shperetz at nvidia.com
Wed Apr 15 11:59:25 CEST 2026


Hi,

FYI, your patch has been queued to stable release 23.11.7

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 04/19/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/shanipr/dpdk-stable

This queued commit can be viewed at:
https://github.com/shanipr/dpdk-stable/commit/7700aca8ca172df88d830e4788584ce790e58a9b

Thanks.

Shani

---
>From 7700aca8ca172df88d830e4788584ce790e58a9b 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 da1caae6ab..4da19c3d2b 100644
--- a/drivers/net/tap/rte_eth_tap.c
+++ b/drivers/net/tap/rte_eth_tap.c
@@ -213,7 +213,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) {
 		/*
@@ -1924,7 +1924,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();
@@ -2078,7 +2078,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);
@@ -2190,10 +2190,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;
 }
@@ -2211,7 +2211,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;
@@ -2262,13 +2262,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) {
@@ -2284,7 +2284,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);
@@ -2433,8 +2433,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;
@@ -2488,8 +2488,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 5ac93f93e9..077285d36e 100644
--- a/drivers/net/tap/rte_eth_tap.h
+++ b/drivers/net/tap/rte_eth_tap.h
@@ -67,8 +67,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 */
 	struct rte_ether_addr eth_addr;   /* Mac address of the device port */
 	struct ifreq remote_initial_flags;/* Remote netdevice flags on init */
-- 
2.43.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2026-04-14 14:44:31.297222870 +0300
+++ 0024-net-tap-use-correct-length-for-interface-names.patch	2026-04-14 14:44:28.517536000 +0300
@@ -1 +1 @@
-From 0e5bbe2a4b25aab4c83cf4234212a8064de18f52 Mon Sep 17 00:00:00 2001
+From 7700aca8ca172df88d830e4788584ce790e58a9b 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 da1caae6ab..4da19c3d2b 100644
@@ -23 +24 @@
-@@ -203,7 +203,7 @@ tun_alloc(struct pmd_internals *pmd, int is_keepalive, int persistent)
+@@ -213,7 +213,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 = {
+@@ -1924,7 +1924,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,
+@@ -2078,7 +2078,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);
+@@ -2190,10 +2190,10 @@ set_interface_name(const char *key __rte_unused,
@@ -63 +64 @@
-@@ -2249,7 +2249,7 @@ set_remote_iface(const char *key __rte_unused,
+@@ -2211,7 +2211,7 @@ set_remote_iface(const char *key __rte_unused,
@@ -72 +73 @@
-@@ -2300,13 +2300,13 @@ rte_pmd_tun_probe(struct rte_vdev_device *dev)
+@@ -2262,13 +2262,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)
+@@ -2284,7 +2284,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)
+@@ -2433,8 +2433,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)
+@@ -2488,8 +2488,8 @@ rte_pmd_tap_probe(struct rte_vdev_device *dev)
@@ -121 +122 @@
-index 59d61582cc..c9c6126d4c 100644
+index 5ac93f93e9..077285d36e 100644
@@ -124 +125 @@
-@@ -68,8 +68,8 @@ struct tx_queue {
+@@ -67,8 +67,8 @@ struct tx_queue {
@@ -133 +133,0 @@
- 	int persist;			  /* 1 if keep link up, else 0 */
@@ -134,0 +135 @@
+ 	struct ifreq remote_initial_flags;/* Remote netdevice flags on init */


More information about the stable mailing list