mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/
synced 2026-11-10 20:48:12 +00:00
net: macb: propagate RX ring refill errors
gem_rx_refill() is responsible for Rx SKB allocation, including at open, but its prototype indicates a void return value. Therefore we change the code to propagate allocation and DMA mapping errors back up the stack, making sure the open fails if no descriptors were allocated. Change all those to return errno-style ints: - gem_rx_refill() - its parent gem_init_rx_ring() - its grand-parent gem_init_rings() - the macbgem_ops.mog_init_rings function pointer - its grand-uncle macb_init_rings() We tolerate some allocation failures: we accept running with the rx ring only partially filled with successful descriptors. It is important we refuse the zero-valid-descriptor case: nothing would ever trigger a refill, which only happens once a frame has been received. Theoretical bugfix, never encountered in practice. To reproduce, introduce memory pressure (less than 512 SKBs of free memory) and open the interface. I expect the last queue to be unusable because it has zero usable rx buffers. Note that other callers of refill (resume, HRESP error task, NAPI) cannot do anything useful with that error and keep their best-effort refill, hoping it will improve. Signed-off-by: Théo Lebrun <theo.lebrun@bootlin.com> Reviewed-by: Nicolai Buchwitz <nb@tipi-net.de> Link: https://patch.msgid.link/20260925-macb-close-v2-2-360efa565914@bootlin.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
parent
efd90b64ce
commit
9ea465c4fb
2 changed files with 27 additions and 8 deletions
Loading…
Add table
Add a link
Reference in a new issue