1
0
Fork 0
alistair23-linux/drivers/net/ethernet/intel
Stefan Assmann 7790a471e8 iavf: remove current MAC address filter on VF reset
[ Upstream commit 9e05229190 ]

Currently MAC filters are not altered during a VF reset event. This may
lead to a stale filter when an administratively set MAC is forced by the
PF.

For an administratively set MAC the PF driver deletes the VFs filters,
overwrites the VFs MAC address and triggers a VF reset. However
the VF driver itself is not aware of the filter removal, which is what
the VF reset is for.
The VF reset queues all filters present in the VF driver to be re-added
to the PF filter list (including the filter for the now stale VF MAC
address) and triggers a VIRTCHNL_OP_GET_VF_RESOURCES event, which
provides the new MAC address to the VF.

When this happens i40e will complain and reject the stale MAC filter,
at least in the untrusted VF case.
i40e 0000:08:00.0: Setting MAC 3c:fa:fa:fa:fa:01 on VF 0
iavf 0000:08:02.0: Reset warning received from the PF
iavf 0000:08:02.0: Scheduling reset task
i40e 0000:08:00.0: Bring down and up the VF interface to make this change effective.
i40e 0000:08:00.0: VF attempting to override administratively set MAC address, bring down and up the VF interface to resume normal operation
i40e 0000:08:00.0: VF 0 failed opcode 10, retval: -1
iavf 0000:08:02.0: Failed to add MAC filter, error IAVF_ERR_NVM

To avoid re-adding the stale MAC filter it needs to be removed from the
VF driver's filter list before queuing the existing filters. Then during
the VIRTCHNL_OP_GET_VF_RESOURCES event the correct filter needs to be
added again, at which point the MAC address has been updated.

As a bonus this change makes bringing the VF down and up again
superfluous for the administratively set MAC case.

Signed-off-by: Stefan Assmann <sassmann@kpanic.de>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2020-02-05 21:22:45 +00:00
..
e1000 e1000: fix memory leaks 2019-11-01 13:20:33 -07:00
e1000e e1000e: Revert "e1000e: Make watchdog use delayed work" 2020-02-05 21:22:39 +00:00
fm10k fm10k: use a local variable for the frag pointer 2019-09-09 10:08:38 -07:00
i40e i40e: Fix virtchnl_queue_select bitmap validation 2020-02-05 21:22:44 +00:00
iavf iavf: remove current MAC address filter on VF reset 2020-02-05 21:22:45 +00:00
ice ice: fix stack leakage 2020-01-26 10:01:01 +01:00
igb igb: Fix SGMII SFP module discovery for 100FX/LX. 2020-02-05 21:22:45 +00:00
igbvf net: Use skb accessors in network drivers 2019-07-22 20:47:56 -07:00
igc igb/igc: use ktime accessors for skb->tstamp 2019-11-08 16:10:51 -08:00
ixgb net: Use skb accessors in network drivers 2019-07-22 20:47:56 -07:00
ixgbe ixgbe: Fix calculation of queue with VFs and flow director on interface flap 2020-02-05 21:22:44 +00:00
ixgbevf ixgbevf: Remove limit of 10 entries for unicast filter list 2020-02-05 21:22:44 +00:00
Kconfig treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
Makefile igc: Add skeletal frame for Intel(R) 2.5G Ethernet Controller support 2018-10-17 12:14:54 -07:00
e100.c intel: correct return from set features callback 2019-03-19 14:18:49 -07:00