linux/drivers/net/ethernet/sfc
Íñigo Huguet ada74c5539 sfc: fix kernel panic when creating VF
When creating VFs a kernel panic can happen when calling to
efx_ef10_try_update_nic_stats_vf.

When releasing a DMA coherent buffer, sometimes, I don't know in what
specific circumstances, it has to unmap memory with vunmap. It is
disallowed to do that in IRQ context or with BH disabled. Otherwise, we
hit this line in vunmap, causing the crash:
  BUG_ON(in_interrupt());

This patch reenables BH to release the buffer.

Log messages when the bug is hit:
 kernel BUG at mm/vmalloc.c:2727!
 invalid opcode: 0000 [#1] PREEMPT SMP NOPTI
 CPU: 6 PID: 1462 Comm: NetworkManager Kdump: loaded Tainted: G          I      --------- ---  5.14.0-119.el9.x86_64 #1
 Hardware name: Dell Inc. PowerEdge R740/06WXJT, BIOS 2.8.2 08/27/2020
 RIP: 0010:vunmap+0x2e/0x30
 ...skip...
 Call Trace:
  __iommu_dma_free+0x96/0x100
  efx_nic_free_buffer+0x2b/0x40 [sfc]
  efx_ef10_try_update_nic_stats_vf+0x14a/0x1c0 [sfc]
  efx_ef10_update_stats_vf+0x18/0x40 [sfc]
  efx_start_all+0x15e/0x1d0 [sfc]
  efx_net_open+0x5a/0xe0 [sfc]
  __dev_open+0xe7/0x1a0
  __dev_change_flags+0x1d7/0x240
  dev_change_flags+0x21/0x60
  ...skip...

Fixes: d778819609 ("sfc: DMA the VF stats only when requested")
Reported-by: Ma Yuying <yuma@redhat.com>
Signed-off-by: Íñigo Huguet <ihuguet@redhat.com>
Acked-by: Edward Cree <ecree.xilinx@gmail.com>
Link: https://lore.kernel.org/r/20220713092116.21238-1-ihuguet@redhat.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
2022-07-14 12:46:56 +02:00
..
falcon net: allow gso_max_size to exceed 65536 2022-05-16 10:18:55 +01:00
siena sfc/siena: fix wrong tx channel offset with efx_separate_tx_channels 2022-06-01 17:47:17 -07:00
bitfield.h
ef10.c sfc: fix kernel panic when creating VF 2022-07-14 12:46:56 +02:00
ef10_regs.h
ef10_sriov.c sfc: fix use after free when disabling sriov 2022-07-13 19:42:09 -07:00
ef10_sriov.h
ef100.c sfc: add EF100 VF support via a write to sriov_numvfs 2022-04-29 18:43:01 -07:00
ef100.h
ef100_ethtool.c
ef100_ethtool.h
ef100_netdev.c
ef100_netdev.h
ef100_nic.c net: allow gso_max_size to exceed 65536 2022-05-16 10:18:55 +01:00
ef100_nic.h
ef100_regs.h
ef100_rx.c sfc: fix boolreturn.cocci warning and rename function 2020-08-24 18:14:23 -07:00
ef100_rx.h
ef100_sriov.c sfc: add EF100 VF support via a write to sriov_numvfs 2022-04-29 18:43:01 -07:00
ef100_sriov.h sfc: add EF100 VF support via a write to sriov_numvfs 2022-04-29 18:43:01 -07:00
ef100_tx.c
ef100_tx.h
efx.c net: make drivers set the TSO limit not the GSO limit 2022-05-06 12:07:56 +01:00
efx.h sfc: Remove duplicate definition of efx_xmit_done 2022-04-12 12:13:30 +02:00
efx_channels.c sfc: fix wrong tx channel offset with efx_separate_tx_channels 2022-05-29 12:12:53 +01:00
efx_channels.h Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2022-05-12 16:15:30 -07:00
efx_common.c sfc: Remove global definition of efx_reset_type_names 2022-04-12 12:13:30 +02:00
efx_common.h
enum.h
ethtool.c
ethtool_common.c
ethtool_common.h
farch_regs.h
filter.h
io.h
Kconfig sfc/siena: Make MCDI logging support specific for Siena 2022-05-12 16:49:30 -07:00
Makefile sfc: Add a basic Siena module 2022-05-10 15:38:15 -07:00
mcdi.c
mcdi.h
mcdi_filters.c
mcdi_filters.h
mcdi_functions.c
mcdi_functions.h
mcdi_mon.c
mcdi_pcol.h sfc: Fix spelling mistake "writting" -> "writing" 2022-04-12 09:34:05 +02:00
mcdi_port.c
mcdi_port.h
mcdi_port_common.c
mcdi_port_common.h
mtd.c
net_driver.h sfc: fix considering that all channels have TX queues 2022-05-29 12:12:53 +01:00
nic.c
nic.h sfc: Disable Siena support 2022-05-04 11:18:08 +01:00
nic_common.h
ptp.c net: sfc: fix memory leak due to ptp channel 2022-05-09 10:01:48 +01:00
ptp.h net: sfc: fix memory leak due to ptp channel 2022-05-09 10:01:48 +01:00
rx.c
rx_common.c sfc: Do not free an empty page_ring 2022-04-04 12:53:52 +01:00
rx_common.h
selftest.c
selftest.h
sriov.c
sriov.h
tx.c sfc: use hardware tx timestamps for more than PTP 2022-04-08 14:43:10 -07:00
tx.h
tx_common.c net: allow gso_max_size to exceed 65536 2022-05-16 10:18:55 +01:00
tx_common.h
tx_tso.c
vfdi.h
workarounds.h