]> git.baikalelectronics.ru Git - kernel.git/commit
net: axienet: fix RX ring refill allocation failure handling
authorRobert Hancock <robert.hancock@calian.com>
Sat, 5 Mar 2022 02:24:37 +0000 (20:24 -0600)
committerDavid S. Miller <davem@davemloft.net>
Sat, 5 Mar 2022 11:12:08 +0000 (11:12 +0000)
commit04e939f1310e354232fae3655e4277d789f71ad8
tree4d42add1ac16e89d49bcc48187456b2bd4a7b011
parent808209120b26b645580f278eb14429f7d298fcd9
net: axienet: fix RX ring refill allocation failure handling

If a memory allocation error occurred during an attempt to refill a slot
in the RX ring after the packet was received, the hardware tail pointer
would still have been updated to point to or past the slot which remained
marked as previously completed. This would likely result in the DMA engine
raising an error when it eventually tried to use that slot again.

If a slot cannot be refilled, then just stop processing and do not move
the tail pointer past it. On the next attempt, we should skip receiving
the packet from the empty slot and just try to refill it again.

This failure mode has not actually been observed, but was found as part
of other driver updates.

Fixes: e69e5783903e ("drivers/net/ethernet/xilinx: added Xilinx AXI Ethernet driver")
Signed-off-by: Robert Hancock <robert.hancock@calian.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/xilinx/xilinx_axienet_main.c