patch 'net/tap: use MAC address parse API instead of local parser' has been queued to stable release 20.11.10

luca.boccassi at gmail.com luca.boccassi at gmail.com
Thu Oct 19 01:59:06 CEST 2023


Hi,

FYI, your patch has been queued to stable release 20.11.10

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

Thanks.

Luca Boccassi

---
>From 818515a917313547372a2bfe0be606bfbc9758fd Mon Sep 17 00:00:00 2001
From: David Christensen <drc at linux.vnet.ibm.com>
Date: Tue, 3 Oct 2023 13:29:09 -0700
Subject: [PATCH] net/tap: use MAC address parse API instead of local parser

[ upstream commit b79d825f32cb0012164b26428272b1ea268f839d ]

Building DPDK with gcc 12 on a ppc64le system generates a
stringop-overflow warning. Replace the local MAC address
validation function parse_user_mac() with a call to
rte_ether_unformat_addr() instead.

Bugzilla ID: 1197

Signed-off-by: David Christensen <drc at linux.vnet.ibm.com>
Signed-off-by: Stephen Hemminger <stephen at networkplumber.org>
Acked-by: Ferruh Yigit <ferruh.yigit at amd.com>
---
 drivers/net/tap/rte_eth_tap.c | 25 +------------------------
 1 file changed, 1 insertion(+), 24 deletions(-)

diff --git a/drivers/net/tap/rte_eth_tap.c b/drivers/net/tap/rte_eth_tap.c
index faa95fab6e..e6dc870594 100644
--- a/drivers/net/tap/rte_eth_tap.c
+++ b/drivers/net/tap/rte_eth_tap.c
@@ -2256,29 +2256,6 @@ set_remote_iface(const char *key __rte_unused,
 	return 0;
 }
 
-static int parse_user_mac(struct rte_ether_addr *user_mac,
-		const char *value)
-{
-	unsigned int index = 0;
-	char mac_temp[strlen(ETH_TAP_USR_MAC_FMT) + 1], *mac_byte = NULL;
-
-	if (user_mac == NULL || value == NULL)
-		return 0;
-
-	strlcpy(mac_temp, value, sizeof(mac_temp));
-	mac_byte = strtok(mac_temp, ":");
-
-	while ((mac_byte != NULL) &&
-			(strlen(mac_byte) <= 2) &&
-			(strlen(mac_byte) == strspn(mac_byte,
-					ETH_TAP_CMP_MAC_FMT))) {
-		user_mac->addr_bytes[index++] = strtoul(mac_byte, NULL, 16);
-		mac_byte = strtok(NULL, ":");
-	}
-
-	return index;
-}
-
 static int
 set_mac_type(const char *key __rte_unused,
 	     const char *value,
@@ -2300,7 +2277,7 @@ set_mac_type(const char *key __rte_unused,
 		goto success;
 	}
 
-	if (parse_user_mac(user_mac, value) != 6)
+	if (rte_ether_unformat_addr(value, user_mac) < 0)
 		goto error;
 success:
 	TAP_LOG(DEBUG, "TAP user MAC param (%s)", value);
-- 
2.39.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-10-19 00:28:57.092133478 +0100
+++ 0017-net-tap-use-MAC-address-parse-API-instead-of-local-p.patch	2023-10-19 00:28:56.225804732 +0100
@@ -1 +1 @@
-From b79d825f32cb0012164b26428272b1ea268f839d Mon Sep 17 00:00:00 2001
+From 818515a917313547372a2bfe0be606bfbc9758fd Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit b79d825f32cb0012164b26428272b1ea268f839d ]
+
@@ -12 +13,0 @@
-Cc: stable at dpdk.org
@@ -22 +23 @@
-index bf98f75559..b25a52655f 100644
+index faa95fab6e..e6dc870594 100644
@@ -25 +26 @@
-@@ -2267,29 +2267,6 @@ set_remote_iface(const char *key __rte_unused,
+@@ -2256,29 +2256,6 @@ set_remote_iface(const char *key __rte_unused,
@@ -55 +56 @@
-@@ -2311,7 +2288,7 @@ set_mac_type(const char *key __rte_unused,
+@@ -2300,7 +2277,7 @@ set_mac_type(const char *key __rte_unused,


More information about the stable mailing list