linux/drivers/net/ethernet/intel
Maciej Fijalkowski 1ac2524de7 ice: xsk: Fix indexing in ice_tx_xsk_pool()
Ice driver tries to always create XDP rings array to be
num_possible_cpus() sized, regardless of user's queue count setting that
can be changed via ethtool -L for example.

Currently, ice_tx_xsk_pool() calculates the qid by decrementing the
ring->q_index by the count of XDP queues, but ring->q_index is set to 'i
+ vsi->alloc_txq'.

When user did ethtool -L $IFACE combined 1, alloc_txq is 1, but
vsi->num_xdp_txq is still num_possible_cpus(). Then, ice_tx_xsk_pool()
will do OOB access and in the final result ring would not get xsk_pool
pointer assigned. Then, each ice_xsk_wakeup() call will fail with error
and it will not be possible to get into NAPI and do the processing from
driver side.

Fix this by decrementing vsi->alloc_txq instead of vsi->num_xdp_txq from
ring-q_index in ice_tx_xsk_pool() so the calculation is reflected to the
setting of ring->q_index.

Fixes: 22bf877e52 ("ice: introduce XDP_TX fallback path")
Signed-off-by: Maciej Fijalkowski <maciej.fijalkowski@intel.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://lore.kernel.org/bpf/20220328142123.170157-5-maciej.fijalkowski@intel.com
2022-03-28 19:56:28 -07:00
..
e1000 e1000: switch to napi_build_skb() 2021-12-28 09:42:25 -08:00
e1000e e1000e: Print PHY register address when MDI read/write fails 2022-03-09 19:53:03 -08:00
fm10k fm10k: Fix syntax errors in comments 2021-12-21 09:17:47 -08:00
i40e i40e: little endian only valid checksums 2022-03-17 07:40:46 -07:00
iavf Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2022-03-17 13:56:58 -07:00
ice ice: xsk: Fix indexing in ice_tx_xsk_pool() 2022-03-28 19:56:28 -07:00
igb igb: zero hwtstamp by default 2022-03-17 08:32:28 -07:00
igbvf igbvf: Remove useless DMA-32 fallback configuration 2022-01-27 08:58:24 -08:00
igc Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2022-03-03 11:55:12 -08:00
ixgb ixgb: Remove useless DMA-32 fallback configuration 2022-01-27 08:58:23 -08:00
ixgbe ixgbe: add improvement for MDD response functionality 2022-03-08 07:41:18 -08:00
ixgbevf ixgbevf: add disable link state 2022-03-08 07:41:18 -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