]> www.infradead.org Git - users/dwmw2/linux.git/commit
ixgbe: fix double clean of Tx descriptors with xdp
authorIlya Maximets <i.maximets@samsung.com>
Thu, 22 Aug 2019 17:12:37 +0000 (20:12 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 19 Sep 2019 07:10:57 +0000 (09:10 +0200)
commitc42a7b87b8d7032c4f7d5d17b0a594ca06892f3a
treeb4cc3075007cc18cdf16af4c934496349a3632b4
parent076566aafd94943aba17a54a25889817e8365b70
ixgbe: fix double clean of Tx descriptors with xdp

commit bf280c0387ebbf8eebad1036fca8f7b85ebfde32 upstream.

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: 8221c5eba8c1 ("ixgbe: add AF_XDP zero-copy Tx support")
Signed-off-by: Ilya Maximets <i.maximets@samsung.com>
Tested-by: William Tu <u9012063@gmail.com>
Tested-by: Eelco Chaudron <echaudro@redhat.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/ethernet/intel/ixgbe/ixgbe_xsk.c