[net,v2,0/2] net: stmmac: Limit the MTU of normal descriptors to one buffer

Message ID 20261122-sun8i-emac-mtu-limit-v2-0-c4081e5b83cf@gmail.com (mailing list archive)
Headers
Series net: stmmac: Limit the MTU of normal descriptors to one buffer |

Message

Arun Iyengar via B4 Relay Nov. 22, 2026, 9:13 a.m. UTC
Normal descriptors take frames of at most one 2047-byte buffer, but
max_mtu allows 3712 on arm64. Patch 1 limits it in the core, patch 2
limits dwmac-sun8i further to the 2044 bytes its RX DMA fills.

Tested on an Orange Pi Zero2 (H616) on net/main. Without the patches,
MTU 2029 to 2100 is accepted and ping gets no reply. With patch 1 the
maximum is 2021, with both 2018. UDP and ping are lossless up to the
maximum, and larger MTUs are refused. Ring mode and other cores are
untested.

Claude (AI) helped write these patches; I reviewed and tested them.

Signed-off-by: Arun Iyengar <aiyengar1990@gmail.com>
---
Changes in v2:
- Limit normal descriptors in the core (patch 1, Andrew Lunn, Maxime
  Chevallier), keep the lower sun8i limit as patch 2
- Link to v1: https://patch.msgid.link/20261121-sun8i-emac-mtu-limit-v1-1-22492842d318@gmail.com

---
Arun Iyengar (2):
      net: stmmac: Limit the MTU of normal descriptors to one buffer
      net: stmmac: dwmac-sun8i: Limit the MTU to 2018

 drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c | 1 +
 drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 3 +++
 2 files changed, 4 insertions(+)
---
base-commit: 890f23ba87a7ca1aba97c8320770a686e3b689fb
change-id: 20261121-sun8i-emac-mtu-limit-66a936064965

Best regards,
--  
Arun Iyengar <aiyengar1990@gmail.com>
  

Comments

Chen-Yu Tsai Nov. 22, 2026, 10:48 a.m. UTC | #1
On Sun, Nov 22, 2026 at 5:13 PM Arun Iyengar via B4 Relay
<devnull+aiyengar1990.gmail.com@kernel.org> wrote:
>
> Normal descriptors take frames of at most one 2047-byte buffer, but
> max_mtu allows 3712 on arm64. Patch 1 limits it in the core, patch 2
> limits dwmac-sun8i further to the 2044 bytes its RX DMA fills.

I think you should clearly state that *one normal descriptor* can have
a buffer of up to 2047 bytes. And the driver is currently limited to
using one descriptor per-frame.

The way you write it makes it unclear whether it's a hardware or driver
limitation. I believe it is the latter.

> Tested on an Orange Pi Zero2 (H616) on net/main. Without the patches,
> MTU 2029 to 2100 is accepted and ping gets no reply. With patch 1 the
> maximum is 2021, with both 2018. UDP and ping are lossless up to the
> maximum, and larger MTUs are refused. Ring mode and other cores are
> untested.
>
> Claude (AI) helped write these patches; I reviewed and tested them.
>
> Signed-off-by: Arun Iyengar <aiyengar1990@gmail.com>
> ---
> Changes in v2:
> - Limit normal descriptors in the core (patch 1, Andrew Lunn, Maxime
>   Chevallier), keep the lower sun8i limit as patch 2
> - Link to v1: https://patch.msgid.link/20261121-sun8i-emac-mtu-limit-v1-1-22492842d318@gmail.com
>
> ---
> Arun Iyengar (2):
>       net: stmmac: Limit the MTU of normal descriptors to one buffer
>       net: stmmac: dwmac-sun8i: Limit the MTU to 2018
>
>  drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c | 1 +
>  drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 3 +++
>  2 files changed, 4 insertions(+)
> ---
> base-commit: 890f23ba87a7ca1aba97c8320770a686e3b689fb
> change-id: 20261121-sun8i-emac-mtu-limit-66a936064965
>
> Best regards,
> --
> Arun Iyengar <aiyengar1990@gmail.com>
>
>