Re: [PATCH net v2 2/3] net: macb: propagate RX ring refill errors
From: Nicolai Buchwitz
Date: Fri Sep 25 2026 - 10:26:25 EST
On 25.9.2026 15:59, Théo Lebrun wrote:
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.
Fixes: 4df95131ea80 ("net/macb: change RX path for GEM")
Cc: stable@xxxxxxxxxxxxxxx
Signed-off-by: Théo Lebrun <theo.lebrun@xxxxxxxxxxx>
---
[...]
Reviewed-by: Nicolai Buchwitz <nb@xxxxxxxxxxx>
Thanks,
Nicolai