Re: [PATCH net] net: stmmac: drop the rest of the frame when napi_build_skb() fails

From: Maxime Chevallier

Date: Tue Nov 17 2026 - 08:36:15 EST


Hi,

On 11/13/26 18:13, Arun Iyengar via B4 Relay wrote:
> From: Arun Iyengar <aiyengar1990@xxxxxxxxx>
>
> If napi_build_skb() fails on the first buffer of a frame that spans
> several descriptors, stmmac_rx() drops that buffer but goes on with the
> next descriptor of the same frame as if a new frame started there. The
> rest of the frame is then passed up the stack as a frame of its own. A
> frame spans several descriptors when it does not fit in the RX buffers
> of one descriptor.
>
> Mark the frame as errored instead, so that its remaining descriptors are
> discarded like those of a frame with a receive error. The frame is
> counted once in rx_dropped and once against the NAPI budget.
>
> Fixes: ec222003bd94 ("net: stmmac: Prepare to add Split Header support")
> Cc: stable@xxxxxxxxxxxxxxx
> Signed-off-by: Arun Iyengar <aiyengar1990@xxxxxxxxx>

As you say, this only makes sense until Lorenzo's work makes it, this
should be suitable for net.

Reviewed-by: Maxime Chevallier <maxime.chevallier@xxxxxxxxxxx>

Maxime