patch 'net/iavf: fix deletion of primary MAC address' has been queued to stable release 23.11.7

Shani Peretz shperetz at nvidia.com
Wed Apr 15 11:59:12 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/2fcea6a947785916213a7ed5d92d99689a2e4be6

Thanks.

Shani

---
>From 2fcea6a947785916213a7ed5d92d99689a2e4be6 Mon Sep 17 00:00:00 2001
From: Anurag Mandal <anurag.mandal at intel.com>
Date: Wed, 4 Mar 2026 11:16:06 +0000
Subject: [PATCH] net/iavf: fix deletion of primary MAC address

[ upstream commit d1e200594b98b6126e77bd910c0c452543b97f8b ]

Primary MAC address removal fails when trying to set the default MAC
address on a VF via rte_eth_dev_default_mac_addr_set() when the VF has
not yet been started.  This happens because the old MAC is not
set as the primary address until iavf_dev_start() is invoked. Logs
indicate old primary MAC removal failure even though the actual API
rte_eth_dev_default_mac_addr_set() returns success.

This patch fixes the issue by introducing the flag "mac_primary_set" in
the iavf_adapter & is set to 'false' upon VF initialization.  It is set
to 'true' when any MAC address gets assigned as
VIRTCHNL_ETHER_ADDR_PRIMARY MAC on the VF. This flags gets enabled only
once for a VF.

Bugzilla ID: 1897
Fixes: b335e7203475 ("net/iavf: fix lack of MAC type when set MAC address")

Signed-off-by: Anurag Mandal <anurag.mandal at intel.com>
Tested-by: Aliaksei Belovus <albe19021990 at gmail.com>
---
 .mailmap                       |  1 +
 drivers/net/iavf/iavf.h        |  1 +
 drivers/net/iavf/iavf_ethdev.c | 19 ++++++++++++++-----
 3 files changed, 16 insertions(+), 5 deletions(-)

diff --git a/.mailmap b/.mailmap
index 37a31f67cd..9692aaa03c 100644
--- a/.mailmap
+++ b/.mailmap
@@ -67,6 +67,7 @@ Alex Wang <alex at awakenetworks.com>
 Alex Zelezniak <alexz at att.com>
 Alfredo Cardigliano <cardigliano at ntop.org>
 Ali Alnubani <alialnu at nvidia.com> <alialnu at mellanox.com>
+Aliaksei Belovus <albe19021990 at gmail.com>
 Alice Michael <alice.michael at intel.com>
 Alin Rauta <alin.rauta at intel.com>
 Ali Volkan Atli <volkan.atli at argela.com.tr>
diff --git a/drivers/net/iavf/iavf.h b/drivers/net/iavf/iavf.h
index d273d884f5..177b40222b 100644
--- a/drivers/net/iavf/iavf.h
+++ b/drivers/net/iavf/iavf.h
@@ -333,6 +333,7 @@ struct iavf_adapter {
 	eth_tx_burst_t tx_pkt_burst;
 	uint16_t fdir_ref_cnt;
 	struct iavf_devargs devargs;
+	bool mac_primary_set;
 };
 
 /* IAVF_DEV_PRIVATE_TO */
diff --git a/drivers/net/iavf/iavf_ethdev.c b/drivers/net/iavf/iavf_ethdev.c
index 7a2e91214f..a841ae7390 100644
--- a/drivers/net/iavf/iavf_ethdev.c
+++ b/drivers/net/iavf/iavf_ethdev.c
@@ -1058,6 +1058,9 @@ iavf_dev_start(struct rte_eth_dev *dev)
 	/* Set all mac addrs */
 	iavf_add_del_all_mac_addr(adapter, true);
 
+	if (!adapter->mac_primary_set)
+		adapter->mac_primary_set = true;
+
 	/* Set all multicast addresses */
 	iavf_add_del_mc_addr_list(adapter, vf->mc_addrs, vf->mc_addrs_num,
 				  true);
@@ -1724,11 +1727,13 @@ iavf_dev_set_default_mac_addr(struct rte_eth_dev *dev,
 	if (rte_is_same_ether_addr(old_addr, mac_addr))
 		return 0;
 
-	ret = iavf_add_del_eth_addr(adapter, old_addr, false, VIRTCHNL_ETHER_ADDR_PRIMARY);
-	if (ret)
-		PMD_DRV_LOG(ERR, "Fail to delete old MAC:"
-			    RTE_ETHER_ADDR_PRT_FMT,
-				RTE_ETHER_ADDR_BYTES(old_addr));
+	if (adapter->mac_primary_set) {  /* delete old PRIMARY MAC only if set */
+		ret = iavf_add_del_eth_addr(adapter, old_addr, false, VIRTCHNL_ETHER_ADDR_PRIMARY);
+		if (ret)
+			PMD_DRV_LOG(ERR, "Fail to delete old MAC:"
+				    RTE_ETHER_ADDR_PRT_FMT,
+					RTE_ETHER_ADDR_BYTES(old_addr));
+	}
 
 	ret = iavf_add_del_eth_addr(adapter, mac_addr, true, VIRTCHNL_ETHER_ADDR_PRIMARY);
 	if (ret)
@@ -1739,6 +1744,9 @@ iavf_dev_set_default_mac_addr(struct rte_eth_dev *dev,
 	if (ret)
 		return -EIO;
 
+	if (!adapter->mac_primary_set)
+		adapter->mac_primary_set = true;
+
 	rte_ether_addr_copy(mac_addr, (struct rte_ether_addr *)hw->mac.addr);
 	return 0;
 }
@@ -2725,6 +2733,7 @@ iavf_dev_init(struct rte_eth_dev *eth_dev)
 	hw->back = IAVF_DEV_PRIVATE_TO_ADAPTER(eth_dev->data->dev_private);
 	adapter->dev_data = eth_dev->data;
 	adapter->stopped = 1;
+	adapter->mac_primary_set = false;
 
 	if (iavf_dev_event_handler_init())
 		goto init_vf_err;
-- 
2.43.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2026-04-14 14:44:29.972595280 +0300
+++ 0011-net-iavf-fix-deletion-of-primary-MAC-address.patch	2026-04-14 14:44:28.417448000 +0300
@@ -1 +1 @@
-From d1e200594b98b6126e77bd910c0c452543b97f8b Mon Sep 17 00:00:00 2001
+From 2fcea6a947785916213a7ed5d92d99689a2e4be6 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit d1e200594b98b6126e77bd910c0c452543b97f8b ]
+
@@ -21 +22,0 @@
-Cc: stable at dpdk.org
@@ -26,3 +27,3 @@
- .mailmap                             |  1 +
- drivers/net/intel/iavf/iavf.h        |  1 +
- drivers/net/intel/iavf/iavf_ethdev.c | 19 ++++++++++++++-----
+ .mailmap                       |  1 +
+ drivers/net/iavf/iavf.h        |  1 +
+ drivers/net/iavf/iavf_ethdev.c | 19 ++++++++++++++-----
@@ -32 +33 @@
-index 388801a5d3..b026947779 100644
+index 37a31f67cd..9692aaa03c 100644
@@ -35 +36,2 @@
-@@ -73,6 +73,7 @@ Alexey Kardashevskiy <aik at ozlabs.ru>
+@@ -67,6 +67,7 @@ Alex Wang <alex at awakenetworks.com>
+ Alex Zelezniak <alexz at att.com>
@@ -38 +39,0 @@
- Ali Volkan Atli <volkan.atli at argela.com.tr>
@@ -42,7 +43,7 @@
- Allain Legacy <allain.legacy at windriver.com>
-diff --git a/drivers/net/intel/iavf/iavf.h b/drivers/net/intel/iavf/iavf.h
-index f9bb398a77..403c61e2e8 100644
---- a/drivers/net/intel/iavf/iavf.h
-+++ b/drivers/net/intel/iavf/iavf.h
-@@ -384,6 +384,7 @@ struct iavf_adapter {
- 	enum iavf_tx_func_type tx_func_type;
+ Ali Volkan Atli <volkan.atli at argela.com.tr>
+diff --git a/drivers/net/iavf/iavf.h b/drivers/net/iavf/iavf.h
+index d273d884f5..177b40222b 100644
+--- a/drivers/net/iavf/iavf.h
++++ b/drivers/net/iavf/iavf.h
+@@ -333,6 +333,7 @@ struct iavf_adapter {
+ 	eth_tx_burst_t tx_pkt_burst;
@@ -55,5 +56,5 @@
-diff --git a/drivers/net/intel/iavf/iavf_ethdev.c b/drivers/net/intel/iavf/iavf_ethdev.c
-index 26e7febecf..1eca20bc9a 100644
---- a/drivers/net/intel/iavf/iavf_ethdev.c
-+++ b/drivers/net/intel/iavf/iavf_ethdev.c
-@@ -1042,6 +1042,9 @@ iavf_dev_start(struct rte_eth_dev *dev)
+diff --git a/drivers/net/iavf/iavf_ethdev.c b/drivers/net/iavf/iavf_ethdev.c
+index 7a2e91214f..a841ae7390 100644
+--- a/drivers/net/iavf/iavf_ethdev.c
++++ b/drivers/net/iavf/iavf_ethdev.c
+@@ -1058,6 +1058,9 @@ iavf_dev_start(struct rte_eth_dev *dev)
@@ -69 +70 @@
-@@ -1718,11 +1721,13 @@ iavf_dev_set_default_mac_addr(struct rte_eth_dev *dev,
+@@ -1724,11 +1727,13 @@ iavf_dev_set_default_mac_addr(struct rte_eth_dev *dev,
@@ -88 +89 @@
-@@ -1733,6 +1738,9 @@ iavf_dev_set_default_mac_addr(struct rte_eth_dev *dev,
+@@ -1739,6 +1744,9 @@ iavf_dev_set_default_mac_addr(struct rte_eth_dev *dev,
@@ -98 +99 @@
-@@ -2799,6 +2807,7 @@ iavf_dev_init(struct rte_eth_dev *eth_dev)
+@@ -2725,6 +2733,7 @@ iavf_dev_init(struct rte_eth_dev *eth_dev)


More information about the stable mailing list