diff options
author | Maciej Fijalkowski <[email protected]> | 2022-03-28 16:21:23 +0200 |
---|---|---|
committer | Alexei Starovoitov <[email protected]> | 2022-03-28 19:56:28 -0700 |
commit | 1ac2524de7b366633fc336db6c94062768d0ab03 (patch) | |
tree | adb33b3d631593641aadbd245727aa44c1719741 /lib/mpi/mpiutil.c | |
parent | 0ec1713009c5cc24244c918def1cd14080be27e3 (diff) |
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: 22bf877e528f ("ice: introduce XDP_TX fallback path")
Signed-off-by: Maciej Fijalkowski <[email protected]>
Signed-off-by: Alexei Starovoitov <[email protected]>
Link: https://lore.kernel.org/bpf/[email protected]
Diffstat (limited to 'lib/mpi/mpiutil.c')
0 files changed, 0 insertions, 0 deletions