patch 'net/tap: set locally administered bit for fixed MAC address' has been queued to stable release 22.11.3

Xueming Li xuemingl at nvidia.com
Sun Jun 25 08:34:06 CEST 2023


Hi,

FYI, your patch has been queued to stable release 22.11.3

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 06/27/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://git.dpdk.org/dpdk-stable/log/?h=22.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=22.11-staging&id=8e27036b63097e7df03246570676b549944f8f88

Thanks.

Xueming Li <xuemingl at nvidia.com>

---
>From 8e27036b63097e7df03246570676b549944f8f88 Mon Sep 17 00:00:00 2001
From: David Christensen <drc at linux.vnet.ibm.com>
Date: Tue, 25 Apr 2023 16:58:06 -0400
Subject: [PATCH] net/tap: set locally administered bit for fixed MAC address
Cc: Xueming Li <xuemingl at nvidia.com>

[ upstream commit c3006be2acab49c6b77ae9c9ef04b061e5dacbd6 ]

When the tap driver is loaded and the user selects the optional
"mac=fixed" setting, the tap driver incorrectly uses a globally
unique EUI-48 identifier (as documented in RFC 7042) of
00:64:74:61:70:<iface_idx>. Since this is a locally generated ID,
the Local bit in the MAC address should be set to 1, resulting in
the new address 02:64:74:61:70:<iface_idx>.

Bugzilla ID: 1198
Fixes: f6921783fee6 ("net/tap: add support for fixed MAC addresses")

Signed-off-by: David Christensen <drc at linux.vnet.ibm.com>
Acked-by: Stephen Hemminger <stephen at networkplumber.org>
Acked-by: Ferruh Yigit <ferruh.yigit at amd.com>
---
 doc/guides/nics/tap.rst       | 8 ++++----
 drivers/net/tap/rte_eth_tap.c | 4 ++--
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/doc/guides/nics/tap.rst b/doc/guides/nics/tap.rst
index 2f7417bddd..07df0d35a2 100644
--- a/doc/guides/nics/tap.rst
+++ b/doc/guides/nics/tap.rst
@@ -34,14 +34,14 @@ Using the option ``mac=fixed`` you can create a fixed known MAC address::
 
 The MAC address will have a fixed value with the last octet incrementing by one
 for each interface string containing ``mac=fixed``. The MAC address is formatted
-as 00:'d':'t':'a':'p':[00-FF]. Convert the characters to hex and you get the
-actual MAC address: ``00:64:74:61:70:[00-FF]``.
+as 02:'d':'t':'a':'p':[00-FF]. Convert the characters to hex and you get the
+actual MAC address: ``02:64:74:61:70:[00-FF]``.
 
-   --vdev=net_tap0,mac="00:64:74:61:70:11"
+   --vdev=net_tap0,mac="02:64:74:61:70:11"
 
 The MAC address will have a user value passed as string. The MAC address is in
 format with delimiter ``:``. The string is byte converted to hex and you get
-the actual MAC address: ``00:64:74:61:70:11``.
+the actual MAC address: ``02:64:74:61:70:11``.
 
 It is possible to specify a remote netdevice to capture packets from by adding
 ``remote=foo1``, for example::
diff --git a/drivers/net/tap/rte_eth_tap.c b/drivers/net/tap/rte_eth_tap.c
index f2a6c33a19..66595f8312 100644
--- a/drivers/net/tap/rte_eth_tap.c
+++ b/drivers/net/tap/rte_eth_tap.c
@@ -2303,8 +2303,8 @@ set_mac_type(const char *key __rte_unused,
 	if (!strncasecmp(ETH_TAP_MAC_FIXED, value, strlen(ETH_TAP_MAC_FIXED))) {
 		static int iface_idx;
 
-		/* fixed mac = 00:64:74:61:70:<iface_idx> */
-		memcpy((char *)user_mac->addr_bytes, "\0dtap",
+		/* fixed mac = 02:64:74:61:70:<iface_idx> */
+		memcpy((char *)user_mac->addr_bytes, "\002dtap",
 			RTE_ETHER_ADDR_LEN);
 		user_mac->addr_bytes[RTE_ETHER_ADDR_LEN - 1] =
 			iface_idx++ + '0';
-- 
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-06-25 14:31:59.281642900 +0800
+++ 0028-net-tap-set-locally-administered-bit-for-fixed-MAC-a.patch	2023-06-25 14:31:58.315773900 +0800
@@ -1 +1 @@
-From c3006be2acab49c6b77ae9c9ef04b061e5dacbd6 Mon Sep 17 00:00:00 2001
+From 8e27036b63097e7df03246570676b549944f8f88 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl at nvidia.com>
+
+[ upstream commit c3006be2acab49c6b77ae9c9ef04b061e5dacbd6 ]
@@ -15 +17,0 @@
-Cc: stable at dpdk.org
@@ -49 +51 @@
-index 089ac202fa..bf98f75559 100644
+index f2a6c33a19..66595f8312 100644


More information about the stable mailing list