i40e: Fix MAC address setting for a VF via Host/VM
authorSlawomir Laba <slawomirx.laba@intel.com>
Wed, 14 Oct 2020 08:54:09 +0000 (08:54 +0000)
committerTony Nguyen <anthony.l.nguyen@intel.com>
Tue, 10 Nov 2020 23:03:06 +0000 (15:03 -0800)
commit3a7001788fed0311d6fb77ed0dabe7bed3567bc0
tree094f1fbd3762e4c58db3318600c998f5e07f8871
parent989ef49bdf100cc772b3a8737089df36b1ab1e30
i40e: Fix MAC address setting for a VF via Host/VM

Fix MAC setting flow for the PF driver.

Update the unicast VF's MAC address in VF structure if it is
a new setting in i40e_vc_add_mac_addr_msg.

When unicast MAC address gets deleted, record that and
set the new unicast MAC address that is already waiting in the filter
list. This logic is based on the order of messages arriving to
the PF driver.

Without this change the MAC address setting was interpreted
incorrectly in the following use cases:
1) Print incorrect VF MAC or zero MAC
ip link show dev $pf
2) Don't preserve MAC between driver reload
rmmod iavf; modprobe iavf
3) Update VF MAC when macvlan was set
ip link add link $vf address $mac $vf.1 type macvlan
4) Failed to update mac address when VF was trusted
ip link set dev $vf address $mac

This includes all other configurations including above commands.

Fixes: f657a6e1313b ("i40e: Fix VF driver MAC address configuration")
Signed-off-by: Slawomir Laba <slawomirx.laba@intel.com>
Tested-by: Konrad Jankowski <konrad0.jankowski@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c