Skip to content
Commit bf280c03 authored by Ilya Maximets's avatar Ilya Maximets Committed by Jeff Kirsher
Browse files

ixgbe: fix double clean of Tx descriptors with xdp



Tx code doesn't clear the descriptors' status after cleaning.
So, if the budget is larger than number of used elems in a ring, some
descriptors will be accounted twice and xsk_umem_complete_tx will move
prod_tail far beyond the prod_head breaking the completion queue ring.

Fix that by limiting the number of descriptors to clean by the number
of used descriptors in the Tx ring.

'ixgbe_clean_xdp_tx_irq()' function refactored to look more like
'ixgbe_xsk_clean_tx_ring()' since we're allowed to directly use
'next_to_clean' and 'next_to_use' indexes.

CC: stable@vger.kernel.org
Fixes: 8221c5eb ("ixgbe: add AF_XDP zero-copy Tx support")
Signed-off-by: default avatarIlya Maximets <i.maximets@samsung.com>
Tested-by: default avatarWilliam Tu <u9012063@gmail.com>
Tested-by: default avatarEelco Chaudron <echaudro@redhat.com>
Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
parent 377228ac
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment