1
0
Fork 0
mirror of synced 2025-03-06 20:59:54 +01:00
linux/drivers/net/ethernet/intel
Brett Creeley 51efbbdf1d ice: Manage VF's MAC address for both legacy and new cases
Currently there is no way for a VF driver to specify if it wants to
change it's hardware address. New bits are being added to virtchnl.h
in struct virtchnl_ether_addr that allow for the VF to correctly
communicate this information. However, legacy VF drivers that don't
support the new virtchnl.h bits still need to be supported. Make a
best effort attempt at saving the VF's primary/device address in the
legacy case and depend on the VIRTCHNL_ETHER_ADDR_PRIMARY type for
the new case.

Legacy case - If a unicast MAC is being added and the
hw_lan_addr.addr is empty, then populate it. This assumes that the
address is the VF's hardware address. If a unicast MAC is being
added and the hw_lan_addr.addr is not empty, then cache it in the
legacy_last_added_umac.addr. If a unicast MAC is being deleted and it
matches the hw_lan_addr.addr, then zero the hw_lan_addr.addr.
Also, if the legacy_last_added_umac.addr has not expired, copy the
legacy_last_added_umac.addr into the hw_lan_addr.addr. This is done
because we cannot guarantee the order of VIRTCHNL_OP_ADD_ETH_ADDR and
VIRTCHNL_OP_DEL_ETH_ADDR.

New case - If a unicast MAC is being added and it's specified as
VIRTCHNL_ETHER_ADDR_PRIMARY, then replace the current
hw_lan_addr.addr. If a unicast MAC is being deleted and it's type
is specified as VIRTCHNL_ETHER_ADDR_PRIMARY, then zero the
hw_lan_addr.addr.

Untrusted VFs - Only allow above legacy/new changes to their
hardware address if the PF has not set it administratively via
iproute2.

Trusted VFs - Always allow above legacy/new changes to their
hardware address even if the PF has administratively set it via
iproute2.

Also, change the variable dflt_lan_addr to hw_lan_addr to clearly
represent the purpose of this variable since it's purpose is to
act as a hardware programmed MAC address for the VF.

Signed-off-by: Brett Creeley <brett.creeley@intel.com>
Tested-by: Konrad Jankowski <konrad0.jankowski@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
2021-06-07 08:30:58 -07:00
..
e1000 intel: remove checker warning 2021-05-26 09:11:40 -07:00
e1000e net: e1000e: fix misspell word "retreived" 2021-05-19 12:23:25 -07:00
fm10k fm10k: move error check 2021-05-26 09:11:41 -07:00
i40e i40e: Register auxiliary devices to provide RDMA 2021-05-28 20:11:13 -07:00
iavf iavf: redefine the magic number for FDIR GTP-U header fields 2021-04-23 09:34:19 -07:00
ice ice: Manage VF's MAC address for both legacy and new cases 2021-06-07 08:30:58 -07:00
igb igb: Fix -Wunused-const-variable warning 2021-06-01 17:00:51 -07:00
igbvf igbvf: convert to strongly typed descriptors 2021-05-26 09:11:41 -07:00
igc igc: Enable HW VLAN Insertion and HW VLAN Stripping 2021-06-04 09:14:39 -07:00
ixgb intel: handle unused assignments 2020-09-25 16:28:59 -07:00
ixgbe ixgbe: Fix out-bounds warning in ixgbe_host_interface_command() 2021-05-27 16:10:00 -07:00
ixgbevf intel: call csum functions with well formatted arguments 2021-05-26 09:11:41 -07:00
e100.c e100: handle eeprom as little endian 2021-05-26 09:11:40 -07:00
Kconfig i40e: Register auxiliary devices to provide RDMA 2021-05-28 20:11:13 -07:00
Makefile igc: Add skeletal frame for Intel(R) 2.5G Ethernet Controller support 2018-10-17 12:14:54 -07:00