]> git.baikalelectronics.ru Git - kernel.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)
commite54c2796083dfb3033155d349ee11e85dbc0b074
tree230dd5bd362a05f0fa41ed75360402dca9f6d715
parentcaafc90956dc6bd2baedb0ef764a2c4c394f37ea
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: f48c2b3983ab ("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