mirror_ubuntu-kernels/drivers/net/ethernet/sfc
Taehee Yoo fb5833d81e net: sfc: fix using uninitialized xdp tx_queue
In some cases, xdp tx_queue can get used before initialization.
1. interface up/down
2. ring buffer size change

When CPU cores are lower than maximum number of channels of sfc driver,
it creates new channels only for XDP.

When an interface is up or ring buffer size is changed, all channels
are initialized.
But xdp channels are always initialized later.
So, the below scenario is possible.
Packets are received to rx queue of normal channels and it is acted
XDP_TX and tx_queue of xdp channels get used.
But these tx_queues are not initialized yet.
If so, TX DMA or queue error occurs.

In order to avoid this problem.
1. initializes xdp tx_queues earlier than other rx_queue in
efx_start_channels().
2. checks whether tx_queue is initialized or not in efx_xdp_tx_buffers().

Splat looks like:
   sfc 0000:08:00.1 enp8s0f1np1: TX queue 10 spurious TX completion id 250
   sfc 0000:08:00.1 enp8s0f1np1: resetting (RECOVER_OR_ALL)
   sfc 0000:08:00.1 enp8s0f1np1: MC command 0x80 inlen 100 failed rc=-22
   (raw=22) arg=789
   sfc 0000:08:00.1 enp8s0f1np1: has been disabled

Fixes: f28100cb9c ("sfc: fix lack of XDP TX queues - error XDP TX failed (-22)")
Acked-by: Martin Habets <habetsm.xilinx@gmail.com>
Signed-off-by: Taehee Yoo <ap420073@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2022-04-06 13:50:17 +01:00
..
falcon Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2022-01-05 14:36:10 -08:00
bitfield.h
ef10_regs.h
ef10_sriov.c ethernet: constify references to netdev->dev_addr in drivers 2021-10-14 09:22:11 -07:00
ef10_sriov.h ethernet: constify references to netdev->dev_addr in drivers 2021-10-14 09:22:11 -07:00
ef10.c sfc: The size of the RX recycle ring should be more flexible 2022-02-01 20:34:59 -08:00
ef100_ethtool.c ethtool: extend ringparam setting/getting API with rx_buf_len 2021-11-22 12:31:49 +00:00
ef100_ethtool.h
ef100_netdev.c
ef100_netdev.h
ef100_nic.c sfc: The size of the RX recycle ring should be more flexible 2022-02-01 20:34:59 -08:00
ef100_nic.h
ef100_regs.h
ef100_rx.c
ef100_rx.h
ef100_tx.c
ef100_tx.h
ef100.c
ef100.h
efx_channels.c net: sfc: fix using uninitialized xdp tx_queue 2022-04-06 13:50:17 +01:00
efx_channels.h
efx_common.c net: Don't include filter.h from net/sock.h 2021-12-29 08:48:14 -08:00
efx_common.h
efx.c net: Don't include filter.h from net/sock.h 2021-12-29 08:48:14 -08:00
efx.h
enum.h sfc: Remove duplicate argument 2021-04-14 13:55:07 -07:00
ethtool_common.c sfc: Fix reading non-legacy supported link modes 2021-10-18 14:28:02 +01:00
ethtool_common.h
ethtool.c ethtool: extend ringparam setting/getting API with rx_buf_len 2021-11-22 12:31:49 +00:00
farch_regs.h
farch.c sfc: farch: fix compile warning in efx_farch_dimension_resources() 2021-05-21 13:52:26 -07:00
filter.h
io.h
Kconfig ethernet: fix PTP_1588_CLOCK dependencies 2021-08-13 17:49:05 -07:00
Makefile
mcdi_filters.c
mcdi_filters.h
mcdi_functions.c
mcdi_functions.h
mcdi_mon.c
mcdi_pcol.h
mcdi_port_common.c ethernet/sfc: remove redundant rc variable 2022-01-04 12:41:41 +00:00
mcdi_port_common.h
mcdi_port.c
mcdi_port.h
mcdi.c sfc: extend the locking on mcdi->seqno 2022-03-03 14:11:58 +00:00
mcdi.h
mtd.c
net_driver.h sfc: The size of the RX recycle ring should be more flexible 2022-02-01 20:34:59 -08:00
nic_common.h sfc: The size of the RX recycle ring should be more flexible 2022-02-01 20:34:59 -08:00
nic.c net:sfc: fix non-freed irq in legacy irq mode 2021-05-21 14:51:10 -07:00
nic.h
ptp.c net_tstamp: add new flag HWTSTAMP_FLAG_BONDED_PHC_INDEX 2021-12-14 12:28:24 +00:00
ptp.h
rx_common.c sfc: Do not free an empty page_ring 2022-04-04 12:53:52 +01:00
rx_common.h sfc: The size of the RX recycle ring should be more flexible 2022-02-01 20:34:59 -08:00
rx.c bpf: Let bpf_warn_invalid_xdp_action() report more info 2021-12-13 22:28:27 +01:00
selftest.c
selftest.h
siena_sriov.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2021-10-22 11:41:16 +01:00
siena_sriov.h ethernet: constify references to netdev->dev_addr in drivers 2021-10-14 09:22:11 -07:00
siena.c sfc: The size of the RX recycle ring should be more flexible 2022-02-01 20:34:59 -08:00
sriov.c
sriov.h
tx_common.c net: sfc: fix using uninitialized xdp tx_queue 2022-04-06 13:50:17 +01:00
tx_common.h
tx_tso.c
tx.c net: sfc: fix using uninitialized xdp tx_queue 2022-04-06 13:50:17 +01:00
tx.h
vfdi.h
workarounds.h