[PATCH net-next 0/9] net: sparx5/lan969x: add support for changing the MTU

From: Daniel Machon

Date: Thu Nov 05 2026 - 08:59:07 EST


This series adds support for changing the MTU on Sparx5 and lan969x.

Currently, there is no ndo_change_mtu callback, and the MAC maximum
frame length, the FDMA buffers, the queue watermarks and the TAS guard
band are all fixed for a 1518 byte frame. This series makes them follow
the MTU, and sets the maximum MTU from the 14000 byte frame limit of the
MACs. As the FDMA is shared by all ports, new buffers are allocated
while the FDMA keeps running, and the FDMA is only stopped briefly to
replace them. Details are in the commits.

Patches 1-2 are fixes: patch 1 makes the FDMA stop sequence actually
stop the channels, and patch 2 frees the FDMA buffers on init errors
and deinit. They are routed to net-next rather than net, as they
fix issues that are not regressions, and the stop sequence is only used
on deinit until this series uses it to resize the buffers.

Patches 3-4 prepare for the MTU change, by adding a helper for setting
the MAC maximum frame length, and by making the FDMA init and alloc
functions operate on the rings passed to them.

Patches 5-6 size the FDMA buffers from the port MTUs, and add support
for resizing them.

Patches 7-8 scale the queue watermarks and the TAS guard band with the
MTU.

Patch 9 adds the ndo_change_mtu callback and sets the maximum MTU.

Tested on Sparx5 (PCB135) and lan969x (EV23X71A), by forwarding frames
up to the MTU and checking that frames one byte over the MTU are
dropped, by sending jumbo frames to and from the CPU while stepping the
MTU up and down between 1500 and 9216, and by changing the MTU
repeatedly while flooding the CPU with frames in both directions.

Signed-off-by: Daniel Machon <daniel.machon@xxxxxxxxxxxxx>
---
Daniel Machon (9):
net: sparx5/lan969x: stop the FDMA channels properly
net: sparx5/lan969x: free the FDMA buffers on init errors and deinit
net: sparx5/lan969x: add a helper for setting the MAC max frame length
net: sparx5/lan969x: pass the FDMA rings to the init and alloc functions
net: sparx5/lan969x: size the FDMA buffers from the port MTUs
net: sparx5/lan969x: add support for resizing the FDMA buffers
net: sparx5/lan969x: scale the queue watermarks with the MTU
net: sparx5/lan969x: scale the TAS guard band with the MTU
net: sparx5/lan969x: add support for changing the MTU

.../ethernet/microchip/sparx5/lan969x/lan969x.c | 10 +
.../ethernet/microchip/sparx5/lan969x/lan969x.h | 2 +
.../microchip/sparx5/lan969x/lan969x_fdma.c | 178 ++++++++++--
.../net/ethernet/microchip/sparx5/sparx5_fdma.c | 321 ++++++++++++++++++---
.../net/ethernet/microchip/sparx5/sparx5_main.c | 2 +
.../net/ethernet/microchip/sparx5/sparx5_main.h | 13 +
.../ethernet/microchip/sparx5/sparx5_main_regs.h | 34 +++
.../net/ethernet/microchip/sparx5/sparx5_netdev.c | 48 ++-
.../net/ethernet/microchip/sparx5/sparx5_port.c | 123 +++++---
.../net/ethernet/microchip/sparx5/sparx5_port.h | 5 +
drivers/net/ethernet/microchip/sparx5/sparx5_tas.c | 43 ++-
11 files changed, 679 insertions(+), 100 deletions(-)
---
base-commit: 4bca33ba24db72e2870a3352442af1c312272146
change-id: 20260930-sparx5-mtu-change-d7ebb1a7fcaa

Best regards,
--
Daniel Machon <daniel.machon@xxxxxxxxxxxxx>