1
0
Fork 0
alistair23-linux/drivers/net/ethernet/intel/iavf
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
..
Makefile iavf: Rename i40e_adminq* files to iavf_adminq* 2019-05-31 00:15:53 -07:00
iavf.h iavf: remove current MAC address filter on VF reset 2020-02-05 21:22:45 +00:00
iavf_adminq.c iavf: change remaining i40e defines to be iavf 2019-05-31 01:03:17 -07:00
iavf_adminq.h iavf: change remaining i40e defines to be iavf 2019-05-31 01:03:17 -07:00
iavf_adminq_cmd.h iavf: replace i40e variables with iavf 2019-05-31 01:02:53 -07:00
iavf_alloc.h iavf: change iavf_status_code to iavf_status 2019-05-31 00:19:33 -07:00
iavf_client.c iavf: update comments and file checks to match iavf 2019-05-31 01:03:24 -07:00
iavf_client.h iavf: rename iavf_client.h defines to match driver name 2019-05-31 01:03:13 -07:00
iavf_common.c iavf: update comments and file checks to match iavf 2019-05-31 01:03:24 -07:00
iavf_devids.h
iavf_ethtool.c iavf: Remove timer for work triggering, use delaying work instead 2019-06-17 15:39:26 -07:00
iavf_main.c iavf: remove current MAC address filter on VF reset 2020-02-05 21:22:45 +00:00
iavf_osdep.h iavf: Fix up debug print macro 2019-06-28 15:59:56 -07:00
iavf_prototype.h iavf: replace i40e variables with iavf 2019-05-31 01:02:53 -07:00
iavf_register.h
iavf_status.h iavf: rename iavf_status structure flags 2019-05-31 01:03:04 -07:00
iavf_trace.h iavf: update comments and file checks to match iavf 2019-05-31 01:03:24 -07:00
iavf_txrx.c net: Use skb_frag_off accessors 2019-07-30 14:21:32 -07:00
iavf_txrx.h net: Use skb accessors in network drivers 2019-07-22 20:47:56 -07:00
iavf_type.h iavf: change remaining i40e defines to be iavf 2019-05-31 01:03:17 -07:00
iavf_virtchnl.c iavf: remove current MAC address filter on VF reset 2020-02-05 21:22:45 +00:00