]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commit
iavf: Fix issue with MAC address of VF shown as zero
authorMichal Wilczynski <michal.wilczynski@intel.com>
Fri, 20 May 2022 11:19:27 +0000 (13:19 +0200)
committerTony Nguyen <anthony.l.nguyen@intel.com>
Thu, 9 Jun 2022 15:58:15 +0000 (08:58 -0700)
commit645603844270b69175899268be68b871295764fe
tree230dd5bd362a05f0fa41ed75360402dca9f6d715
parentfd5855e6b1358e816710afee68a1d2bc685176ca
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")
Signed-off-by: Michal Wilczynski <michal.wilczynski@intel.com>
Reviewed-by: Maciej Fijalkowski <maciej.fijalkowski@intel.com>
Tested-by: Konrad Jankowski <konrad0.jankowski@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
drivers/net/ethernet/intel/iavf/iavf_main.c