[PATCH net v2 2/2] net: stmmac: dwmac-sun8i: Limit the MTU to 2018
Andrew Lunn
andrew at lunn.ch
Sun Nov 22 10:56:54 PST 2026
> The STM32F4 reference manuals has this note:
>
> Even when the start address of a receive buffer is not aligned to the
> system databus width
> the system should allocate a receive buffer of a size aligned to the
> system bus width. For
> example, if the system allocates a 1024 byte (1 KB) receive buffer
> starting from address
> 0x1000, the software can program the buffer start address in the
> receive descriptor to have
> a 0x1002 offset. The receive DMA writes the frame to this buffer with
> dummy data in the first
> two locations (0x1000 and 0x1001). The actual frame is written from
> location 0x1002.
> So for normal descriptors the buffer size is bound to (2KB - bus width).
There is a second use for this, unrelated to bus width. The ethernet
header is 14 bytes in size, 2x 6 octet MAC address plus a 2 octet
ethertype header. By offsetting the start address by two, it means the
data after the ethernet header is then 4 byte aligned, making it more
efficient to access fields in the IP, TCP UDP headers etc.
Andrew
More information about the linux-arm-kernel
mailing list