mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH net-next v2 0/7] net: lan743x: automatically recover from TX hang
@ 2026-11-24 14:33 Chris Babroski
  2026-11-24 14:33 ` [PATCH net-next v2 1/7] net: lan743x: check DMA channel stop and reset results Chris Babroski
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: Chris Babroski @ 2026-11-24 14:33 UTC (permalink / raw)
  To: netdev, linux-kernel
  Cc: bryan.whitehead, UNGLinuxDriver, andrew+netdev, davem, edumazet,
	kuba, pabeni, richardcochran, linux, Raju.Lakkaraju,
	maxime.chevallier, yuiko.oshino, cbabroski, nb, woojung.huh

Background
----------
On a custom HW platform that uses the LAN7430 NIC we have been able to
reproduce a scenario where the SoC stops receiving TX completion
interrupts, appearing as a TX hang. After dumping and decoding the
LAN7430 registers we see that the TX channel reports that it is in
started state with no error, but TX_HEAD stops advancing. TX MSI-X stops
incrementing while RX interrupts continue to increment.

This scenario has most often been reproduced in large server cluster
environments, but it's also been seen locally during repeated SCP and
iperf testing.

The root cause of this issue is still unknown and we are continuing to
debug. It was found that bringing the interface down and up recovers the
network.

What this patch series does
---------------------------
This patch series attempts to implement automatic recovery of the
network interface after a TX hang is detected. It does not fix the
underlying root cause of the TX hang.

At a high level, the patches implement the following:
1. ndo_tx_timeout support to reset and recover the interface when the
   netdev TX watchdog triggers.
2. BQL support to decrease the amount of time it takes for the watchdog
   to trigger.
3. Stability improvements and error handling around the open/close paths
   that now get executed more frequently as part of the TX hang recovery
   flow.

Potential issues and concerns
-----------------------------
* I do not have fixed-link hardware to test patch 4 on. The change was
  requested by Sashiko AI review of the v1 patch series.
* LLM review tools flagged several possible bugs during development and
  v1 review that resulted in the inclusion of several "Fixes:" tagged
  patches in this series. They are included in this series with the
  ndo_tx_timeout support because lan743x_netdev_open and
  lan743x_netdev_close are now called more frequently as a result of TX
  hang recovery.

Testing
-------
Testing was performed on a 7.0 based kernel using the same driver code.
Please let me know if you would like me to run any other tests.

Tests:
* Verified the TX timeout watchdog triggers and recovers the network
  interface when TX hang is reproduced. This was done as part of
  repeated SCP loop testing and is also being tested in a server cluster
  environment. dmesg was inspected for "NETDEV WATCHDOG" to verify that
  the watchdog is being triggered. No errors were seen in dmesg after
  reset.
* Performance tests using iperf3 to measure RX and TX throughput show no
  noticeable difference with the patches applied.
* Repeated module load and unload cycles produce no errors in dmesg.
  Network appears to function as expected when module is loaded.
* Repeated ifconfig down and up cycles produce no errors in dmesg.
  Network appears to function as expected when interface is back up.

Changes in v2:
- Patch 1 (was "net: lan743x: reset DMA channels that fail to stop"):
  - Retitled to "check DMA channel stop and reset results".
  - Reset a TX channel that fails to stop only after its FIFO is
    disabled, before the ring is freed (Woojung).
  - Fail lan743x_tx_open()/lan743x_rx_open() if the channel or TX FIFO
    reset times out, undoing the earlier steps (Nicolai).
- Patches 2 and 3: swapped, so TX is quiesced before phylink is moved
  and the series stays bisectable (Sashiko).
- Patch 4: new, keep the fixed link across reopen on boards that use
  the fixed-link fallback (Sashiko).
- Patch 5: new, handle a failed reopen on resume, keep the PCI
  resources when lan743x_hardware_init() fails on resume, and program
  the RX filter again after the device is attached (Nicolai, Sashiko).
- Patch 6 (reset the device on TX timeout):
  - Move the ndo_stop wrapper to patch 5.
  - Leave the device detached if the DMA controller reset fails, so it
    cannot be opened on a controller that is still in reset (Sashiko).
  - Program the RX filter again after the device is attached (Sashiko).
  - Commit message: state that ptp4l has to be restarted after a reset
    (Nicolai). PHC registration stays in open/close, as discussed with
    Microchip (Woojung).
- v1: https://lore.kernel.org/r/cover.1792008404.git.cbabroski@nvidia.com

Chris Babroski (7):
  net: lan743x: check DMA channel stop and reset results
  net: lan743x: quiesce TX before freeing the rings
  net: lan743x: start phylink last and stop it first
  net: lan743x: keep the fixed link across reopen
  net: lan743x: handle a failed reopen on resume
  net: lan743x: reset the device on TX timeout
  net: lan743x: add byte queue limits support

 drivers/net/ethernet/microchip/lan743x_main.c | 282 +++++++++++++++---
 drivers/net/ethernet/microchip/lan743x_main.h |   2 +
 2 files changed, 241 insertions(+), 43 deletions(-)


base-commit: d6816d9a93b66a12bf01e10037e377f3333ad6cc
-- 
2.34.1


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2026-11-24 14:34 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-24 14:33 [PATCH net-next v2 0/7] net: lan743x: automatically recover from TX hang Chris Babroski
2026-11-24 14:33 ` [PATCH net-next v2 1/7] net: lan743x: check DMA channel stop and reset results Chris Babroski
2026-11-24 14:33 ` [PATCH net-next v2 2/7] net: lan743x: quiesce TX before freeing the rings Chris Babroski
2026-11-24 14:33 ` [PATCH net-next v2 3/7] net: lan743x: start phylink last and stop it first Chris Babroski
2026-11-24 14:33 ` [PATCH net-next v2 4/7] net: lan743x: keep the fixed link across reopen Chris Babroski
2026-11-24 14:33 ` [PATCH net-next v2 5/7] net: lan743x: handle a failed reopen on resume Chris Babroski
2026-11-24 14:33 ` [PATCH net-next v2 6/7] net: lan743x: reset the device on TX timeout Chris Babroski
2026-11-24 14:33 ` [PATCH net-next v2 7/7] net: lan743x: add byte queue limits support Chris Babroski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®