linux/drivers/net/ethernet/microchip
Guangshuo Li aa97f11a76 net: lan966x: restore RX state on reload failure
lan966x_fdma_reload() backs up rx->page_pool and rx->fdma before
reallocating the RX resources for the new MTU. If the allocation fails,
the restore path puts these fields back before restarting RX.

However, the reload path also updates rx->page_order and rx->max_mtu
before calling lan966x_fdma_rx_alloc(). These fields are not restored on
failure, so RX can be restarted with the old pages, old FDMA state and
old page pool, but with the page geometry from the failed new MTU.

This can make the XDP path advertise a frame size derived from the new
page_order while the actual RX pages still come from the old allocation.
For example, after a failed reload to a jumbo MTU, xdp_init_buff() may be
called with a frame size larger than the restored RX pages.

lan966x_fdma_rx_alloc_page_pool() also registers the newly allocated page
pool with each port's XDP RXQ before fdma_alloc_coherent() is called. If
fdma_alloc_coherent() fails, the new page pool is destroyed, but the
rollback path does not restore the per-port XDP RXQ mem model
registration either.

Save and restore rx->page_order and rx->max_mtu, and restore the old page
pool registration for each port's XDP RXQ before RX is started again.
This keeps the restored RX state consistent after a failed reload.

Signed-off-by: Guangshuo Li <lgs201920130244@gmail.com>
Reviewed-by: David Carlier <devnexen@gmail.com>
Link: https://patch.msgid.link/20260607145747.1494514-1-lgs201920130244@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2026-06-09 19:29:55 -07:00
..
fdma net: microchip: dead code cleanup in kconfig for FDMA 2026-04-01 19:50:12 -07:00
lan865x microchip: lan865x: Enable MAC address validation 2025-09-15 18:34:08 -07:00
lan966x net: lan966x: restore RX state on reload failure 2026-06-09 19:29:55 -07:00
sparx5 net: microchip: sparx5: clean up PSFP resources on flower setup failure 2026-06-05 19:06:42 -07:00
vcap Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
enc28j60_hw.h
enc28j60.c net: enc28j60: Use threaded interrupt instead of workqueue 2023-05-11 18:00:37 -07:00
encx24j600_hw.h net: encx24j600: Correct spelling in comments 2024-04-25 19:13:26 -07:00
encx24j600-regmap.c net: encx24j600: constify struct regmap_bus/regmap_config 2024-07-05 17:02:20 -07:00
encx24j600.c net: encx24j600: Correct spelling in comments 2024-04-25 19:13:26 -07:00
Kconfig net: lan969x: fix cyclic dependency reported by depmod 2024-12-09 13:30:16 +00:00
lan743x_ethtool.c net: microchip: lan743x: add ethtool nway_reset support 2026-02-24 15:10:56 +01:00
lan743x_ethtool.h net: lan743x: Add support to SGMII register dump for PCI11010/PCI11414 chips 2022-11-09 19:20:13 -08:00
lan743x_main.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2026-06-04 15:29:04 -07:00
lan743x_main.h net: lan743x: permit VLAN-tagged packets up to configured MTU 2026-06-02 14:09:48 -07:00
lan743x_ptp.c net: lan743x: implement ndo_hwtstamp_get() 2025-05-15 17:56:38 -07:00
lan743x_ptp.h net: lan743x: fix potential out-of-bounds write in lan743x_ptp_io_event_clock_get() 2025-06-19 15:32:14 +02:00
Makefile net: lan969x: fix cyclic dependency reported by depmod 2024-12-09 13:30:16 +00:00