Skip to contentSkip to conversation

net/i40e: fix MAC address removal without VMDq

PATCH Applied David Marchand 2 participants 4 messages Oct 27 Network drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net/i40e: fix MAC address removal without VMDq

The MAC address removal was checking if the hardware supports VMDq (I40E_FLAG_VMDQ) to decide whether to use pool-based removal. However, ethdev only populates mac_pool_sel[] when VMDq mode is actually configured. As a result, when VMDq is supported but not configured, mac_pool_sel is 0 and no MAC address gets removed.

Fix by checking if VMDq mode is configured, matching the condition used by ethdev to manage mac_pool_sel[].

Bugzilla ID: 2074

Fixes 774365884bb8 ("net/i40e: fix MAC address removal")
---
 drivers/net/intel/i40e/i40e_ethdev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/intel/i40e/i40e_ethdev.c +1 -1
index 2405d9e119..46149134fa 100644
@@ -4501,7 +4501,7 @@ i40e_macaddr_remove(struct rte_eth_dev *dev, uint32_t index)
 
 	macaddr = &(data->mac_addrs[index]);
 
-	if (!(pf->flags & I40E_FLAG_VMDQ)) {
+	if ((dev->data->dev_conf.rxmode.mq_mode & RTE_ETH_MQ_RX_VMDQ_FLAG) == 0) {
 		if (i40e_vsi_delete_mac(pf->main_vsi, macaddr) != 0)
 			PMD_DRV_LOG(ERR, "Failed to remove MACVLAN filter");
 		return;
Signature · 1 line
2.54.0
#1 lore raw
Quoted 7 lines · David Marchand

The MAC address removal was checking if the hardware supports VMDq (I40E_FLAG_VMDQ) to decide whether to use pool-based removal. However, ethdev only populates mac_pool_sel[] when VMDq mode is actually configured. As a result, when VMDq is supported but not configured, mac_pool_sel is 0 and no MAC address gets removed.

Quoted 7 lines

Fix by checking if VMDq mode is configured, matching the condition used by ethdev to manage mac_pool_sel[].

Bugzilla ID: 2074

Fixes 774365884bb8 ("net/i40e: fix MAC address removal")

AI review raises a concern that dev_conf is the requested configuration and proposes to rely on mac_pool_sel[index] == 0. This should be safe since i40e max mac_addrs count is 64 but maybe worth adding a build check here.

Bruce, wdyt?

Signature · 1 line
David Marchand
#2 lore raw
Quoted 14 lines · David Marchand
Quoted 13 lines · David Marchand

The MAC address removal was checking if the hardware supports VMDq (I40E_FLAG_VMDQ) to decide whether to use pool-based removal. However, ethdev only populates mac_pool_sel[] when VMDq mode is actually configured. As a result, when VMDq is supported but not configured, mac_pool_sel is 0 and no MAC address gets removed.

Fix by checking if VMDq mode is configured, matching the condition used by ethdev to manage mac_pool_sel[].

Bugzilla ID: 2074

Fixes 774365884bb8 ("net/i40e: fix MAC address removal")
Quoted 9 lines
Quoted 1 line

AI review raises a concern that dev_conf is the requested configuration and proposes to rely on mac_pool_sel[index] == 0. This should be safe since i40e max mac_addrs count is 64 but maybe worth adding a build check here.

Bruce, wdyt?

I think it's fine. After a successful config, the dev_conf contains the actually used config, so its fine to test against. And if the config is unsuccessful, we shouldn't be calling this function at all.

#3 lore raw
Quoted 22 lines · Bruce Richardson
Quoted 21 lines · David Marchand
Quoted 7 lines · David Marchand

The MAC address removal was checking if the hardware supports VMDq (I40E_FLAG_VMDQ) to decide whether to use pool-based removal. However, ethdev only populates mac_pool_sel[] when VMDq mode is actually configured. As a result, when VMDq is supported but not configured, mac_pool_sel is 0 and no MAC address gets removed.

Quoted 7 lines

Fix by checking if VMDq mode is configured, matching the condition used by ethdev to manage mac_pool_sel[].

Bugzilla ID: 2074

Fixes 774365884bb8 ("net/i40e: fix MAC address removal")

AI review raises a concern that dev_conf is the requested configuration and proposes to rely on mac_pool_sel[index] == 0. This should be safe since i40e max mac_addrs count is 64 but maybe worth adding a build check here.

Quoted 8 lines
Quoted 2 lines

Bruce, wdyt?

I think it's fine. After a successful config, the dev_conf contains the actually used config, so its fine to test against. And if the config is unsuccessful, we shouldn't be calling this function at all.

Applied to dpdk-next-net-intel,

Thanks,
/Bruce