linux/drivers/net/ethernet/intel
Jacob Keller 19281e8668 ice: use ice_for_each_vf for iteration during removal
When removing VFs, the driver takes a weird approach of assigning
pf->num_alloc_vfs to 0 before iterating over the VFs using a temporary
variable.

This logic has been in the driver for a long time, and seems to have
been carried forward from i40e.

We want to refactor the way VFs are stored, and iterating over the data
structure without the ice_for_each_vf interface impedes this work.

The logic relies on implicitly using the num_alloc_vfs as a sort of
"safe guard" for accessing VF data.

While this sort of guard makes sense for Single Root IOV where all VFs
are added at once, the data structures don't work for VFs which can be
added and removed dynamically. We also have a separate state flag,
ICE_VF_DEINIT_IN_PROGRESS which is a stronger protection against
concurrent removal and access.

Avoid the custom tmp iteration and replace it with the standard
ice_for_each_vf iterator. Delay the assignment of num_alloc_vfs until
after this loop finishes.

Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Tested-by: Konrad Jankowski <konrad0.jankowski@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
2022-03-03 08:46:48 -08:00
..
e1000 e1000: switch to napi_build_skb() 2021-12-28 09:42:25 -08:00
e1000e Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2022-02-03 17:36:16 -08:00
fm10k fm10k: Fix syntax errors in comments 2021-12-21 09:17:47 -08:00
i40e Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2022-02-24 17:54:25 -08:00
iavf iavf: Remove non-inclusive language 2022-03-01 08:50:11 -08:00
ice ice: use ice_for_each_vf for iteration during removal 2022-03-03 08:46:48 -08:00
igb igb: refactor XDP registration 2022-02-07 14:23:01 -08:00
igbvf igbvf: Remove useless DMA-32 fallback configuration 2022-01-27 08:58:24 -08:00
igc igc: avoid kernel warning when changing RX ring parameters 2022-02-07 14:23:01 -08:00
ixgb ixgb: Remove useless DMA-32 fallback configuration 2022-01-27 08:58:23 -08:00
ixgbe ixgbe: Remove non-inclusive language 2022-02-23 09:55:38 -08:00
ixgbevf ixgbevf: clean up some inconsistent indenting 2022-02-23 09:55:38 -08:00
e100.c ethtool: extend ringparam setting/getting API with rx_buf_len 2021-11-22 12:31:49 +00:00
Kconfig ice: support crosstimestamping on E822 devices if supported 2021-12-21 09:11:40 -08:00
Makefile