]> www.infradead.org Git - users/dwmw2/linux.git/commit
net: xilinx: axienet: Fix packet counting
authorSean Anderson <sean.anderson@linux.dev>
Fri, 13 Sep 2024 14:51:56 +0000 (10:51 -0400)
committerPaolo Abeni <pabeni@redhat.com>
Thu, 19 Sep 2024 11:00:46 +0000 (13:00 +0200)
commit5a6caa2cfabb559309b5ce29ee7c8e9ce1a9a9df
treedf441882fd4a94d41ef85d74c61307023fe4a90c
parentba0da2dc934ec5ac32bbeecbd0670da16ba03565
net: xilinx: axienet: Fix packet counting

axienet_free_tx_chain returns the number of DMA descriptors it's
handled. However, axienet_tx_poll treats the return as the number of
packets. When scatter-gather SKBs are enabled, a single packet may use
multiple DMA descriptors, which causes incorrect packet counts. Fix this
by explicitly keepting track of the number of packets processed as
separate from the DMA descriptors.

Budget does not affect the number of Tx completions we can process for
NAPI, so we use the ring size as the limit instead of budget. As we no
longer return the number of descriptors processed to axienet_tx_poll, we
now update tx_bd_ci in axienet_free_tx_chain.

Fixes: 8a3b7a252dca ("drivers/net/ethernet/xilinx: added Xilinx AXI Ethernet driver")
Signed-off-by: Sean Anderson <sean.anderson@linux.dev>
Link: https://patch.msgid.link/20240913145156.2283067-1-sean.anderson@linux.dev
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
drivers/net/ethernet/xilinx/xilinx_axienet_main.c