Skip to contentSkip to conversation

net/i40e: fix MAC address removal

PATCH Superseded David Marchand 3 participants 14 messages Sep 4 – Sep 8 Network drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 net/i40e: fix MAC address removal

MAC addresses removal was tied with VMDq pools even when not used. So if VMDq is not enabled, no address would be ever removed.

Fixes 9de506a6c781 ("ethdev: skip VMDq pools unless configured")

---
I could not test the change as my setups are KO atm.

Probably worth squashing in 9de506a6c781 before pulling to main

---
 drivers/net/intel/i40e/i40e_ethdev.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/net/intel/i40e/i40e_ethdev.c +5 -1
index b6b2d291ee..5bc3c22def 100644
@@ -4513,7 +4513,11 @@ i40e_macaddr_remove(struct rte_eth_dev *dev, uint32_t index)
 
 	macaddr = &(data->mac_addrs[index]);
 
-	pool_sel = dev->data->mac_pool_sel[index];
+	vmdq = (dev->data->dev_conf.rxmode.mq_mode & RTE_ETH_MQ_RX_VMDQ_FLAG) != 0;
+	if (!vmdq)
+		pool_mask = 1;
+	else
+		pool_mask = dev->data->mac_pool_sel[index];
 
 	for (i = 0; i < sizeof(pool_sel) * CHAR_BIT; i++) {
 		if (pool_sel & RTE_BIT64(i)) {
Signature · 1 line
2.54.0
#1 lore raw

PATCH 2/2 net/bnxt: fix MAC address removal

MAC addresses removal was tied with VMDq pools even when not used. So if VMDq is not enabled, no address would be ever removed.

Fixes 9de506a6c781 ("ethdev: skip VMDq pools unless configured")

---
I could not test the change as I don't have this NIC.

Probably worth squashing in 9de506a6c781 before pulling to main

---
 drivers/net/bnxt/bnxt_ethdev.c | 17 +++++++++++++++--
 1 file changed, 15 insertions(+), 2 deletions(-)
drivers/net/bnxt/bnxt_ethdev.c +15 -2
index c6f566c214..d37e2d16c9 100644
@@ -2019,14 +2019,21 @@ static void bnxt_mac_addr_remove_op(struct rte_eth_dev *eth_dev,
 				    uint32_t index)
 {
 	struct bnxt *bp = eth_dev->data->dev_private;
-	uint64_t pool_mask = eth_dev->data->mac_pool_sel[index];
+	uint64_t pool_mask;
 	struct bnxt_vnic_info *vnic;
 	struct bnxt_filter_info *filter, *temp_filter;
 	uint32_t i;
+	bool vmdq;
 
 	if (is_bnxt_in_error(bp))
 		return;
 
+	vmdq = (eth_dev->data->dev_conf.rxmode.mq_mode & RTE_ETH_MQ_RX_VMDQ_FLAG) != 0;
+	if (!vmdq)
+		pool_mask = 1;
+	else
+		pool_mask = eth_dev->data->mac_pool_sel[index];
+
 	/*
 	 * Loop through all VNICs from the specified filter flow pools to
 	 * remove the corresponding MAC addr filter
@@ -4540,6 +4547,7 @@ static int bnxt_restore_mac_filters(struct bnxt *bp)
 	uint64_t pool_mask;
 	uint32_t pool = 0;
 	uint32_t i;
+	bool vmdq;
 	int rc;
 
 	if (BNXT_VF(bp) && !BNXT_VF_IS_TRUSTED(bp))
@@ -4549,6 +4557,8 @@ static int bnxt_restore_mac_filters(struct bnxt *bp)
 	if (rc)
 		return rc;
 
+	vmdq = (dev->data->dev_conf.rxmode.mq_mode & RTE_ETH_MQ_RX_VMDQ_FLAG) != 0;
+
 	/* replay MAC address configuration */
 	for (i = 1; i < dev_info.max_mac_addrs; i++) {
 		addr = &dev->data->mac_addrs[i];
@@ -4558,7 +4568,10 @@ static int bnxt_restore_mac_filters(struct bnxt *bp)
 			continue;
 
 		pool = 0;
-		pool_mask = dev->data->mac_pool_sel[i];
+		if (!vmdq)
+			pool_mask = 1;
+		else
+			pool_mask = dev->data->mac_pool_sel[i];
 
 		do {
 			if (pool_mask & 1ULL) {
Signature · 1 line
2.54.0
#2 lore raw
In reply to David Marchand
Quoted 8 lines · David Marchand
 drivers/net/intel/i40e/i40e_ethdev.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/net/intel/i40e/i40e_ethdev.c +0 -0
index b6b2d291ee..5bc3c22def 100644

drivers/net/intel/i40e/i40e_ethdev.c i40e_macaddr_remove(struct rte_eth_dev *dev, uint32_t index) · line 4520

Quoted 9 lines
drivers/net/intel/i40e/i40e_ethdev.c +5 -1
@@ -4513,7 +4513,11 @@ i40e_macaddr_remove(struct rte_eth_dev *dev, uint32_t index)
 
        macaddr = &(data->mac_addrs[index]);
 
-       pool_sel = dev->data->mac_pool_sel[index];
+       vmdq = (dev->data->dev_conf.rxmode.mq_mode & RTE_ETH_MQ_RX_VMDQ_FLAG) != 0;
+       if (!vmdq)
+               pool_mask = 1;
+       else
+               pool_mask = dev->data->mac_pool_sel[index];

Arf... some git commit -a --amend was missing before sending... Will send v2 soon.

Signature · 1 line
David Marchand
#3 lore raw

PATCH v2 1/2 net/i40e: fix MAC address removal

In reply to David Marchand

MAC addresses removal was tied with VMDq pools even when not used. So if VMDq is not enabled, no address would be ever removed.

Fixes 9de506a6c781 ("ethdev: skip VMDq pools unless configured")

---
I could not test the change as my setups are KO atm.

Probably worth squashing in 9de506a6c781 before pulling to main

Changes since v1:
- fixed compilation,

---
 drivers/net/intel/i40e/i40e_ethdev.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
drivers/net/intel/i40e/i40e_ethdev.c +6 -1
index b6b2d291ee..3c01354c39 100644
@@ -4509,11 +4509,16 @@ i40e_macaddr_remove(struct rte_eth_dev *dev, uint32_t index)
 	struct rte_ether_addr *macaddr;
 	int ret;
 	uint32_t i;
+	bool vmdq;
 	uint64_t pool_sel;
 
 	macaddr = &(data->mac_addrs[index]);
 
-	pool_sel = dev->data->mac_pool_sel[index];
+	vmdq = (dev->data->dev_conf.rxmode.mq_mode & RTE_ETH_MQ_RX_VMDQ_FLAG) != 0;
+	if (!vmdq)
+		pool_sel = 1;
+	else
+		pool_sel = dev->data->mac_pool_sel[index];
 
 	for (i = 0; i < sizeof(pool_sel) * CHAR_BIT; i++) {
 		if (pool_sel & RTE_BIT64(i)) {
Signature · 1 line
2.54.0
#4 lore raw

PATCH v2 2/2 net/bnxt: fix MAC address removal

MAC addresses removal was tied with VMDq pools even when not used. So if VMDq is not enabled, no address would be ever removed.

Fixes 9de506a6c781 ("ethdev: skip VMDq pools unless configured")

---
I could not test the change as I don't have this NIC.

Probably worth squashing in 9de506a6c781 before pulling to main

---
 drivers/net/bnxt/bnxt_ethdev.c | 17 +++++++++++++++--
 1 file changed, 15 insertions(+), 2 deletions(-)
drivers/net/bnxt/bnxt_ethdev.c +15 -2
index c6f566c214..d37e2d16c9 100644
@@ -2019,14 +2019,21 @@ static void bnxt_mac_addr_remove_op(struct rte_eth_dev *eth_dev,
 				    uint32_t index)
 {
 	struct bnxt *bp = eth_dev->data->dev_private;
-	uint64_t pool_mask = eth_dev->data->mac_pool_sel[index];
+	uint64_t pool_mask;
 	struct bnxt_vnic_info *vnic;
 	struct bnxt_filter_info *filter, *temp_filter;
 	uint32_t i;
+	bool vmdq;
 
 	if (is_bnxt_in_error(bp))
 		return;
 
+	vmdq = (eth_dev->data->dev_conf.rxmode.mq_mode & RTE_ETH_MQ_RX_VMDQ_FLAG) != 0;
+	if (!vmdq)
+		pool_mask = 1;
+	else
+		pool_mask = eth_dev->data->mac_pool_sel[index];
+
 	/*
 	 * Loop through all VNICs from the specified filter flow pools to
 	 * remove the corresponding MAC addr filter
@@ -4540,6 +4547,7 @@ static int bnxt_restore_mac_filters(struct bnxt *bp)
 	uint64_t pool_mask;
 	uint32_t pool = 0;
 	uint32_t i;
+	bool vmdq;
 	int rc;
 
 	if (BNXT_VF(bp) && !BNXT_VF_IS_TRUSTED(bp))
@@ -4549,6 +4557,8 @@ static int bnxt_restore_mac_filters(struct bnxt *bp)
 	if (rc)
 		return rc;
 
+	vmdq = (dev->data->dev_conf.rxmode.mq_mode & RTE_ETH_MQ_RX_VMDQ_FLAG) != 0;
+
 	/* replay MAC address configuration */
 	for (i = 1; i < dev_info.max_mac_addrs; i++) {
 		addr = &dev->data->mac_addrs[i];
@@ -4558,7 +4568,10 @@ static int bnxt_restore_mac_filters(struct bnxt *bp)
 			continue;
 
 		pool = 0;
-		pool_mask = dev->data->mac_pool_sel[i];
+		if (!vmdq)
+			pool_mask = 1;
+		else
+			pool_mask = dev->data->mac_pool_sel[i];
 
 		do {
 			if (pool_mask & 1ULL) {
Signature · 1 line
2.54.0
#5 lore raw

Re: [PATCH v2 2/2] net/bnxt: fix MAC address removal

Quoted 14 lines · On Mon, 7 Sep 2026 13:17:24 +0200 David Marchand <[email protected]>…
drivers/net/bnxt/bnxt_ethdev.c +2 -1
index c6f566c214..d37e2d16c9 100644
@@ -2019,14 +2019,21 @@ static void bnxt_mac_addr_remove_op(struct rte_eth_dev *eth_dev,
 				    uint32_t index)
 {
 	struct bnxt *bp = eth_dev->data->dev_private;
-	uint64_t pool_mask = eth_dev->data->mac_pool_sel[index];
+	uint64_t pool_mask;
 	struct bnxt_vnic_info *vnic;
 	struct bnxt_filter_info *filter, *temp_filter;
 	uint32_t i;
+	bool vmdq;

drivers/net/bnxt/bnxt_ethdev.c static void bnxt_mac_addr_remove_op(struct rte_eth_dev *eth_dev, · line 2036

Quoted 10 lines
drivers/net/bnxt/bnxt_ethdev.c +6 -0
 
 	if (is_bnxt_in_error(bp))
 		return;
 
+	vmdq = (eth_dev->data->dev_conf.rxmode.mq_mode & RTE_ETH_MQ_RX_VMDQ_FLAG) != 0;
+	if (!vmdq)
+		pool_mask = 1;
+	else
+		pool_mask = eth_dev->data->mac_pool_sel[index];
+

Why bother with the vmdq temporary at all here?

	if (eth_dev->data->dev_conf.rxmode.mq_mode & RTE_ETH_MQ_RX_VMDQ_FLAG)
		pool_mask = 1;
	else
		pool_mask = eth_dev->data->mac_pool_sel[index];

Or use ternary if you want here.

#6 lore raw
In reply to David Marchand
Quoted 28 lines · David Marchand

MAC addresses removal was tied with VMDq pools even when not used. So if VMDq is not enabled, no address would be ever removed.

Fixes 9de506a6c781 ("ethdev: skip VMDq pools unless configured")

---
I could not test the change as my setups are KO atm.

Probably worth squashing in 9de506a6c781 before pulling to main

Changes since v1:
- fixed compilation,

---
 drivers/net/intel/i40e/i40e_ethdev.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
drivers/net/intel/i40e/i40e_ethdev.c +1 -0
index b6b2d291ee..3c01354c39 100644
@@ -4509,11 +4509,16 @@ i40e_macaddr_remove(struct rte_eth_dev *dev, uint32_t index)
 	struct rte_ether_addr *macaddr;
 	int ret;
 	uint32_t i;
+	bool vmdq;
 	uint64_t pool_sel;

drivers/net/intel/i40e/i40e_ethdev.c i40e_macaddr_remove(struct rte_eth_dev *dev, uint32_t index) · line 4522

Quoted 10 lines
drivers/net/intel/i40e/i40e_ethdev.c +5 -1
 
 	macaddr = &(data->mac_addrs[index]);
 
-	pool_sel = dev->data->mac_pool_sel[index];
+	vmdq = (dev->data->dev_conf.rxmode.mq_mode & RTE_ETH_MQ_RX_VMDQ_FLAG) != 0;
+	if (!vmdq)
+		pool_sel = 1;
+	else
+		pool_sel = dev->data->mac_pool_sel[index];
 

The explanation makes sense, but do we really need the new temporary variable, rather than just checking the flag directly in the "if"?

Also, the rest of the code in this function, and the add function about it, uses "pf->flags & I40E_FLAG_VMDQ" as a check for vmdq support. Is there a reason we can't use that flag also here, rather than checking the rx mq_mode flags?

/Bruce

#7 lore raw
Quoted 43 lines · Bruce Richardson
Quoted 28 lines · David Marchand

MAC addresses removal was tied with VMDq pools even when not used. So if VMDq is not enabled, no address would be ever removed.

Fixes 9de506a6c781 ("ethdev: skip VMDq pools unless configured")

---
I could not test the change as my setups are KO atm.

Probably worth squashing in 9de506a6c781 before pulling to main

Changes since v1:
- fixed compilation,

---
 drivers/net/intel/i40e/i40e_ethdev.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
drivers/net/intel/i40e/i40e_ethdev.c +1 -0
index b6b2d291ee..3c01354c39 100644
@@ -4509,11 +4509,16 @@ i40e_macaddr_remove(struct rte_eth_dev *dev, uint32_t index)
      struct rte_ether_addr *macaddr;
      int ret;
      uint32_t i;
+     bool vmdq;
      uint64_t pool_sel;

drivers/net/intel/i40e/i40e_ethdev.c i40e_macaddr_remove(struct rte_eth_dev *dev, uint32_t index) · line 4522

Quoted 10 lines
drivers/net/intel/i40e/i40e_ethdev.c +5 -1
 
      macaddr = &(data->mac_addrs[index]);
 
-     pool_sel = dev->data->mac_pool_sel[index];
+     vmdq = (dev->data->dev_conf.rxmode.mq_mode & RTE_ETH_MQ_RX_VMDQ_FLAG) != 0;
+     if (!vmdq)
+             pool_sel = 1;
+     else
+             pool_sel = dev->data->mac_pool_sel[index];
 

The explanation makes sense, but do we really need the new temporary variable, rather than just checking the flag directly in the "if"?

Quoted 4 lines

Also, the rest of the code in this function, and the add function about it, uses "pf->flags & I40E_FLAG_VMDQ" as a check for vmdq support. Is there a reason we can't use that flag also here, rather than checking the rx mq_mode flags?

No, I just did not notice this internal flag and I simply used the ethdev level config.

What do you think of:

$ git diff next-net/for-main -- drivers/net/intel/i40e
(quoted diff) +0 -0

b/drivers/net/intel/i40e/i40e_ethdev.c
index b6b2d291ee..0d914d86ea 100644

drivers/net/intel/i40e/i40e_ethdev.c +0 -0
@@ -4513,6 +4513,12 @@ i40e_macaddr_remove(struct rte_eth_dev *dev,

uint32_t index)

        macaddr = &(data->mac_addrs[index]);

+ if (!(pf->flags & I40E_FLAG_VMDQ)) {
+ if (i40e_vsi_delete_mac(pf->main_vsi, macaddr) != 0)
+ PMD_DRV_LOG(ERR, "Failed to remove MACVLAN filter");
+ return;
+ }
+

        pool_sel = dev->data->mac_pool_sel[index];

        for (i = 0; i < sizeof(pool_sel) * CHAR_BIT; i++) {
@@ -4521,8 +4527,7 @@ i40e_macaddr_remove(struct rte_eth_dev *dev,
uint32_t index)
                                vsi = pf->main_vsi;
                        else {
                                /* No VMDQ pool enabled or configured */

- if (!(pf->flags & I40E_FLAG_VMDQ) ||
- (i > pf->nb_cfg_vmdq_vsi)) {
+ if (i > pf->nb_cfg_vmdq_vsi) {
PMD_DRV_LOG(ERR,
"No VMDQ pool

enabled/configured");
                                        return;
Signature · 1 line
David Marchand
#8 lore raw
Quoted 85 lines · David Marchand
Quoted 43 lines · Bruce Richardson
Quoted 28 lines · David Marchand

MAC addresses removal was tied with VMDq pools even when not used. So if VMDq is not enabled, no address would be ever removed.

Fixes 9de506a6c781 ("ethdev: skip VMDq pools unless configured")

---
I could not test the change as my setups are KO atm.

Probably worth squashing in 9de506a6c781 before pulling to main

Changes since v1:
- fixed compilation,

---
 drivers/net/intel/i40e/i40e_ethdev.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
drivers/net/intel/i40e/i40e_ethdev.c +1 -0
index b6b2d291ee..3c01354c39 100644
@@ -4509,11 +4509,16 @@ i40e_macaddr_remove(struct rte_eth_dev *dev, uint32_t index)
      struct rte_ether_addr *macaddr;
      int ret;
      uint32_t i;
+     bool vmdq;
      uint64_t pool_sel;

drivers/net/intel/i40e/i40e_ethdev.c i40e_macaddr_remove(struct rte_eth_dev *dev, uint32_t index) · line 4522

Quoted 10 lines
drivers/net/intel/i40e/i40e_ethdev.c +5 -1
 
      macaddr = &(data->mac_addrs[index]);
 
-     pool_sel = dev->data->mac_pool_sel[index];
+     vmdq = (dev->data->dev_conf.rxmode.mq_mode & RTE_ETH_MQ_RX_VMDQ_FLAG) != 0;
+     if (!vmdq)
+             pool_sel = 1;
+     else
+             pool_sel = dev->data->mac_pool_sel[index];
 

The explanation makes sense, but do we really need the new temporary variable, rather than just checking the flag directly in the "if"?

Quoted 4 lines

Also, the rest of the code in this function, and the add function about it, uses "pf->flags & I40E_FLAG_VMDQ" as a check for vmdq support. Is there a reason we can't use that flag also here, rather than checking the rx mq_mode flags?

No, I just did not notice this internal flag and I simply used the ethdev level config.

What do you think of:

$ git diff next-net/for-main -- drivers/net/intel/i40e
drivers/net/intel/i40e/i40e_ethdev.c +6 -0
index b6b2d291ee..0d914d86ea 100644
@@ -4513,6 +4513,12 @@ i40e_macaddr_remove(struct rte_eth_dev *dev,
 uint32_t index)
 
        macaddr = &(data->mac_addrs[index]);
 
+       if (!(pf->flags & I40E_FLAG_VMDQ)) {
+               if (i40e_vsi_delete_mac(pf->main_vsi, macaddr) != 0)
+                       PMD_DRV_LOG(ERR, "Failed to remove MACVLAN filter");
+               return;
+       }
+
        pool_sel = dev->data->mac_pool_sel[index];
 
        for (i = 0; i < sizeof(pool_sel) * CHAR_BIT; i++) {
drivers/net/intel/i40e/i40e_ethdev.c +1 -2
@@ -4521,8 +4527,7 @@ i40e_macaddr_remove(struct rte_eth_dev *dev,
 uint32_t index)
                                vsi = pf->main_vsi;
                        else {
                                /* No VMDQ pool enabled or configured */
-                               if (!(pf->flags & I40E_FLAG_VMDQ) ||
-                                       (i > pf->nb_cfg_vmdq_vsi)) {
+                               if (i > pf->nb_cfg_vmdq_vsi) {
                                        PMD_DRV_LOG(ERR,
                                                "No VMDQ pool
Quoted 4 lines
enabled/configured");
                                        return;

That looks simpler. Thanks.

/Bruce

#9 lore raw

PATCH v3 1/2 net/i40e: fix MAC address removal

In reply to David Marchand

MAC addresses removal was tied with VMDq pools even when not used. So if VMDq is not enabled, no address would be ever removed.

Fixes f9ddb36e0065 ("ethdev: skip VMDq pools unless configured")
---
 drivers/net/intel/i40e/i40e_ethdev.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
drivers/net/intel/i40e/i40e_ethdev.c +7 -2
index b6b2d291ee..0d914d86ea 100644
@@ -4513,6 +4513,12 @@ i40e_macaddr_remove(struct rte_eth_dev *dev, uint32_t index)
 
 	macaddr = &(data->mac_addrs[index]);
 
+	if (!(pf->flags & I40E_FLAG_VMDQ)) {
+		if (i40e_vsi_delete_mac(pf->main_vsi, macaddr) != 0)
+			PMD_DRV_LOG(ERR, "Failed to remove MACVLAN filter");
+		return;
+	}
+
 	pool_sel = dev->data->mac_pool_sel[index];
 
 	for (i = 0; i < sizeof(pool_sel) * CHAR_BIT; i++) {
@@ -4521,8 +4527,7 @@ i40e_macaddr_remove(struct rte_eth_dev *dev, uint32_t index)
 				vsi = pf->main_vsi;
 			else {
 				/* No VMDQ pool enabled or configured */
-				if (!(pf->flags & I40E_FLAG_VMDQ) ||
-					(i > pf->nb_cfg_vmdq_vsi)) {
+				if (i > pf->nb_cfg_vmdq_vsi) {
 					PMD_DRV_LOG(ERR,
 						"No VMDQ pool enabled/configured");
 					return;
Signature · 1 line
2.54.0
#10 lore raw

PATCH v3 2/2 net/bnxt: fix MAC address removal

MAC addresses removal was tied with VMDq pools even when not used. So if VMDq is not enabled, no address would be ever removed.

Fixes f9ddb36e0065 ("ethdev: skip VMDq pools unless configured")
---
 drivers/net/bnxt/bnxt_ethdev.c | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)
drivers/net/bnxt/bnxt_ethdev.c +13 -2
index c6f566c214..178814509e 100644
@@ -2019,7 +2019,7 @@ static void bnxt_mac_addr_remove_op(struct rte_eth_dev *eth_dev,
 				    uint32_t index)
 {
 	struct bnxt *bp = eth_dev->data->dev_private;
-	uint64_t pool_mask = eth_dev->data->mac_pool_sel[index];
+	uint64_t pool_mask;
 	struct bnxt_vnic_info *vnic;
 	struct bnxt_filter_info *filter, *temp_filter;
 	uint32_t i;
@@ -2027,6 +2027,11 @@ static void bnxt_mac_addr_remove_op(struct rte_eth_dev *eth_dev,
 	if (is_bnxt_in_error(bp))
 		return;
 
+	if ((eth_dev->data->dev_conf.rxmode.mq_mode & RTE_ETH_MQ_RX_VMDQ_FLAG) == 0)
+		pool_mask = 1;
+	else
+		pool_mask = eth_dev->data->mac_pool_sel[index];
+
 	/*
 	 * Loop through all VNICs from the specified filter flow pools to
 	 * remove the corresponding MAC addr filter
@@ -4540,6 +4545,7 @@ static int bnxt_restore_mac_filters(struct bnxt *bp)
 	uint64_t pool_mask;
 	uint32_t pool = 0;
 	uint32_t i;
+	bool vmdq;
 	int rc;
 
 	if (BNXT_VF(bp) && !BNXT_VF_IS_TRUSTED(bp))
@@ -4549,6 +4555,8 @@ static int bnxt_restore_mac_filters(struct bnxt *bp)
 	if (rc)
 		return rc;
 
+	vmdq = (dev->data->dev_conf.rxmode.mq_mode & RTE_ETH_MQ_RX_VMDQ_FLAG) != 0;
+
 	/* replay MAC address configuration */
 	for (i = 1; i < dev_info.max_mac_addrs; i++) {
 		addr = &dev->data->mac_addrs[i];
@@ -4558,7 +4566,10 @@ static int bnxt_restore_mac_filters(struct bnxt *bp)
 			continue;
 
 		pool = 0;
-		pool_mask = dev->data->mac_pool_sel[i];
+		if (!vmdq)
+			pool_mask = 1;
+		else
+			pool_mask = dev->data->mac_pool_sel[i];
 
 		do {
 			if (pool_mask & 1ULL) {
Signature · 1 line
2.54.0
#11 lore raw

Re: [PATCH v3 2/2] net/bnxt: fix MAC address removal

Quoted 7 lines · On Tue, 8 Sep 2026 09:18:53 +0200 David Marchand <[email protected]>…

MAC addresses removal was tied with VMDq pools even when not used. So if VMDq is not enabled, no address would be ever removed.

Fixes f9ddb36e0065 ("ethdev: skip VMDq pools unless configured")

---

Applied to next-net

Reviewed-by on v3 1/2
#12 lore raw
In reply to David Marchand
Quoted 7 lines · David Marchand

MAC addresses removal was tied with VMDq pools even when not used. So if VMDq is not enabled, no address would be ever removed.

Fixes f9ddb36e0065 ("ethdev: skip VMDq pools unless configured")

---

Quoted 33 lines
 drivers/net/intel/i40e/i40e_ethdev.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
drivers/net/intel/i40e/i40e_ethdev.c +7 -2
index b6b2d291ee..0d914d86ea 100644
@@ -4513,6 +4513,12 @@ i40e_macaddr_remove(struct rte_eth_dev *dev, uint32_t index)
 
 	macaddr = &(data->mac_addrs[index]);
 
+	if (!(pf->flags & I40E_FLAG_VMDQ)) {
+		if (i40e_vsi_delete_mac(pf->main_vsi, macaddr) != 0)
+			PMD_DRV_LOG(ERR, "Failed to remove MACVLAN filter");
+		return;
+	}
+
 	pool_sel = dev->data->mac_pool_sel[index];
 
 	for (i = 0; i < sizeof(pool_sel) * CHAR_BIT; i++) {
@@ -4521,8 +4527,7 @@ i40e_macaddr_remove(struct rte_eth_dev *dev, uint32_t index)
 				vsi = pf->main_vsi;
 			else {
 				/* No VMDQ pool enabled or configured */
-				if (!(pf->flags & I40E_FLAG_VMDQ) ||
-					(i > pf->nb_cfg_vmdq_vsi)) {
+				if (i > pf->nb_cfg_vmdq_vsi) {
 					PMD_DRV_LOG(ERR,
 						"No VMDQ pool enabled/configured");
 					return;
Signature · 1 line
2.54.0