Skip to contentSkip to conversation

iavf: Fix issue with MAC address of VF shown as zero

PATCH New Michal Wilczynski 2 participants 2 messages May 20, 2022 – May 31, 2022

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 iavf: Fix issue with MAC address of VF shown as zero

After reinitialization of iavf, ice driver gets VIRTCHNL_OP_ADD_ETH_ADDR message with incorrectly set type of mac address. Hardware address should have is_primary flag set as true. This way ice driver knows what it has to set as a mac address.

Check if the address is primary in iavf_add_filter function and set flag accordingly.

To test set all-zero mac on a VF. This triggers iavf re-initialization and VIRTCHNL_OP_ADD_ETH_ADDR message gets sent to PF.
For example:

ip link set dev ens785 vf 0 mac 00:00:00:00:00:00

This triggers re-initialization of iavf. New mac should be assigned. Now check if mac is non-zero:

ip link show dev ens785

Fixes a3e839d539e0 ("iavf: Add usage of new virtchnl format to set default MAC")
---
 drivers/net/ethernet/intel/iavf/iavf_main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/intel/iavf/iavf_main.c +1 -1
index 7dfcf78b57fb..f3ecb3bca33d 100644
@@ -984,7 +984,7 @@ struct iavf_mac_filter *iavf_add_filter(struct iavf_adapter *adapter,
 		list_add_tail(&f->list, &adapter->mac_filter_list);
 		f->add = true;
 		f->is_new_mac = true;
-		f->is_primary = false;
+		f->is_primary = ether_addr_equal(macaddr, adapter->hw.mac.addr);
 		adapter->aq_required |= IAVF_FLAG_AQ_ADD_MAC_FILTER;
 	} else {
 		f->remove = false;
Signature · 1 line
2.27.0
#1 lore raw

PATCH 1/1 iavf: Fix issue with MAC address of VF shown as zero

Quoted 45 lines

-----Original Message-----
From: Intel-wired-lan <[email protected]> On Behalf Of Michal Wilczynski
Sent: Friday, May 20, 2022 1:19 PM
To: intel-wired-lan at osuosl.org
Cc: Wilczynski, Michal <[email protected]>
Subject: [Intel-wired-lan] [PATCH net v1] iavf: Fix issue with MAC address of VF shown as zero

After reinitialization of iavf, ice driver gets VIRTCHNL_OP_ADD_ETH_ADDR message with incorrectly set type of mac address. Hardware address should have is_primary flag set as true. This way ice driver knows what it has to set as a mac address.

Check if the address is primary in iavf_add_filter function and set flag accordingly.

To test set all-zero mac on a VF. This triggers iavf re-initialization and VIRTCHNL_OP_ADD_ETH_ADDR message gets sent to PF.
For example:

ip link set dev ens785 vf 0 mac 00:00:00:00:00:00

This triggers re-initialization of iavf. New mac should be assigned. Now check if mac is non-zero:

ip link show dev ens785

Fixes a3e839d539e0 ("iavf: Add usage of new virtchnl format to set default

MAC")

---
 drivers/net/ethernet/intel/iavf/iavf_main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/intel/iavf/iavf_main.c +0 -0
index 7dfcf78b57fb..f3ecb3bca33d 100644

drivers/net/ethernet/intel/iavf/iavf_main.c struct iavf_mac_filter *iavf_add_filter(struct · line 984

Quoted 1 line
drivers/net/ethernet/intel/iavf/iavf_main.c +0 -0
@@ -984,7 +984,7 @@ struct iavf_mac_filter *iavf_add_filter(struct
 iavf_adapter *adapter,