Thread (1 message) 1 message, 1 author, 26d ago

Re: [PATCH] net: stmmac: guard FCS stripping against runt frames

From: Andrew Lunn <andrew@lunn.ch>
Date: 2026-09-24 14:10:28
Also in: lkml, stable

On Thu, Sep 24, 2026 at 10:51:11AM -0300, Aldo Ariel wrote:
Hi Andrew, Lorenzo,

Fair point on the subject — the trigger is not limited to runt frames.
 
The FCS stripping in stmmac_rx() at lines 5810-5817 runs on every
last-segment descriptor regardless of total frame size:

    if (likely(!(status & rx_not_ls))) {
        if (buf2_len) {
            buf2_len -= ETH_FCS_LEN;
        } else if (buf1_len) {
            buf1_len -= ETH_FCS_LEN;
        }
    }      
       
For a multi-descriptor frame, the last descriptor's buf2_len or
buf1_len carries only the tail of the frame. With the default
dma_buf_sz = BUF_SIZE_2KiB for MTU 1500, a 4097-byte frame splits as:
Is the MTU programmed into the hardware? Will it even try to transfer
an 4097 octet frame when the MTU is configured to 1500?

   Andrew


Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help