linux/drivers/net/ethernet
Jacob Keller fadead80fe ice: fix concurrent reset and removal of VFs
Commit c503e63200 ("ice: Stop processing VF messages during teardown")
introduced a driver state flag, ICE_VF_DEINIT_IN_PROGRESS, which is
intended to prevent some issues with concurrently handling messages from
VFs while tearing down the VFs.

This change was motivated by crashes caused while tearing down and
bringing up VFs in rapid succession.

It turns out that the fix actually introduces issues with the VF driver
caused because the PF no longer responds to any messages sent by the VF
during its .remove routine. This results in the VF potentially removing
its DMA memory before the PF has shut down the device queues.

Additionally, the fix doesn't actually resolve concurrency issues within
the ice driver. It is possible for a VF to initiate a reset just prior
to the ice driver removing VFs. This can result in the remove task
concurrently operating while the VF is being reset. This results in
similar memory corruption and panics purportedly fixed by that commit.

Fix this concurrency at its root by protecting both the reset and
removal flows using the existing VF cfg_lock. This ensures that we
cannot remove the VF while any outstanding critical tasks such as a
virtchnl message or a reset are occurring.

This locking change also fixes the root cause originally fixed by commit
c503e63200 ("ice: Stop processing VF messages during teardown"), so we
can simply revert it.

Note that I kept these two changes together because simply reverting the
original commit alone would leave the driver vulnerable to worse race
conditions.

Fixes: c503e63200 ("ice: Stop processing VF messages during teardown")
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-02-18 13:28:38 -08:00
..
3com ethernet: 3com/typhoon: don't write directly to netdev->dev_addr 2022-01-26 15:40:01 +00:00
8390 ethernet: 8390/etherh: don't write directly to netdev->dev_addr 2022-01-26 15:40:01 +00:00
actions
adaptec
aeroflex
agere et131x: Remove useless DMA-32 fallback configuration 2022-01-09 16:52:19 -08:00
alacritech
allwinner net: ethernet: sun4i-emac: Fix an error handling path in emac_probe() 2022-01-15 22:34:52 +00:00
alteon net: alteon: Simplify DMA setting 2022-01-09 16:52:18 -08:00
altera
amazon net: ena: Extract recurring driver reset code into a function 2022-01-07 19:25:52 -08:00
amd net: amd-xgbe: disable interrupts during pci removal 2022-02-09 12:52:59 +00:00
apm
apple net: apple: bmac: Fix build since dev_addr constification 2022-01-14 11:22:57 +00:00
aquantia net: atlantic: Use the bitmap API instead of hand-writing it 2022-01-24 12:57:01 +00:00
arc
asix
atheros atl1c: fix tx timeout after link flap on Mikrotik 10/25G NIC 2022-02-11 14:41:02 -08:00
broadcom Revert "net: ethernet: bgmac: Use devm_platform_ioremap_resource_byname" 2022-02-17 08:45:34 -08:00
brocade bna: Simplify DMA setting 2022-01-09 16:52:18 -08:00
cadence net: macb: Align the dma and coherent dma masks 2022-02-10 15:09:04 +00:00
calxeda
cavium
chelsio Networking fixes for 5.17-rc1, including fixes from netfilter, bpf. 2022-01-20 10:57:05 +02:00
cirrus
cisco Updates for the interrupt subsystem: 2022-01-13 08:53:45 -08:00
cortina
davicom
dec
dlink
emulex Updates for the interrupt subsystem: 2022-01-13 08:53:45 -08:00
engleder
ezchip
faraday
freescale dpaa2-eth: Initialize mutex used in one step timestamping path 2022-02-15 14:33:30 +00:00
fujitsu
google gve: Recording rx queue before sending to napi 2022-02-08 16:52:31 -08:00
hisilicon net: hns3: handle empty unknown interrupt for VF 2022-01-25 13:08:05 +00:00
huawei Updates for the interrupt subsystem: 2022-01-13 08:53:45 -08:00
i825xx ethernet: i825xx: don't write directly to netdev->dev_addr 2022-01-26 15:40:01 +00:00
ibm ibmvnic: don't release napi in __ibmvnic_open() 2022-02-08 20:36:18 -08:00
intel ice: fix concurrent reset and removal of VFs 2022-02-18 13:28:38 -08:00
litex net: ethernet: litex: Add the dependency on HAS_IOMEM 2022-02-08 20:43:40 -08:00
marvell octeontx2-af: Add KPU changes to parse NGIO as separate layer 2022-01-21 14:32:21 +00:00
mediatek net: ethernet: mtk_eth_soc: fix error checking in mtk_mac_config() 2022-01-15 22:33:17 +00:00
mellanox net/mlx5e: Avoid field-overflowing memcpy() 2022-02-01 20:59:43 -08:00
micrel
microchip net: sparx5: Fix get_stat64 crash in tcpdump 2022-02-03 19:01:15 -08:00
microsoft
moxa
mscc net: mscc: ocelot: fix use-after-free in ocelot_vlan_del() 2022-02-15 14:38:20 +00:00
myricom myri10ge: Simplify DMA setting 2022-01-09 16:52:18 -08:00
natsemi
neterion
netronome nfp: flower: netdev offload check for ip6gretap 2022-02-17 09:50:45 -08:00
ni
nvidia
nxp
oki-semi
packetengines
pasemi
pensando
qlogic net/qla3xxx: Remove useless DMA-32 fallback configuration 2022-01-09 16:52:21 -08:00
qualcomm
rdc
realtek Power management updates for 5.17-rc1 2022-01-10 20:34:00 -08:00
renesas
rocker Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2022-01-09 17:00:17 -08:00
samsung
seeq ethernet: seeq/ether3: don't write directly to netdev->dev_addr 2022-01-26 15:40:01 +00:00
sfc
sgi
silan
sis
smsc ethernet: smc911x: fix indentation in get/set EEPROM 2022-02-01 19:59:03 -08:00
socionext
stmicro net: stmmac: ensure PTP time register reads are consistent 2022-02-03 13:54:19 -08:00
sun
synopsys
tehuti
ti net: cpsw: Properly initialise struct page_pool_params 2022-01-25 11:06:33 +00:00
toshiba
tundra ethernet: tundra: don't write directly to netdev->dev_addr 2022-01-26 15:40:01 +00:00
vertexcom Revert "net: vertexcom: default to disabled on kbuild" 2022-01-10 21:11:07 -08:00
via
wiznet
xilinx net: ll_temac: check the return value of devm_kmalloc() 2022-02-18 12:00:44 +00:00
xircom
xscale
dnet.c
dnet.h
ec_bhf.c
ethoc.c
fealnx.c
jme.c
jme.h
Kconfig
korina.c
lantiq_etop.c
lantiq_xrx200.c
Makefile