Netdev List
 help / color / mirror / Atom feed
From: memoriaru@foxmail.com
To: netdev@vger.kernel.org
Cc: Steen.Hegelund@microchip.com, daniel.machon@microchip.com,
	UNGLinuxDriver@microchip.com,
	79190669+memoriaru@users.noreply.github.com
Subject: [PATCH net 0/2] net: sparx5/lan969x: fix RX ring stall on frames from inactive ports
Date: Mon,  9 Nov 2026 02:45:39 +0800	[thread overview]
Message-ID: <tencent_ACC296C1F221C304053BD0F1F4B0D2C2BA06@qq.com> (raw)

From: Zhang Hewei <79190669+memoriaru@users.noreply.github.com>

The FDMA RX path on both sparx5 and its lan969x sibling stalls the RX
ring forever when the hardware delivers a frame whose source port does
not map to an active netdev.

In both drivers the RX NAPI loop only advances the software cursor
(fdma_db_advance/fdma_dcb_advance) after a frame has been successfully
delivered. When the source-port lookup fails:

  - sparx5 (sparx5_fdma_rx_get_frame()) logs an error, flushes the
    extraction FIFO and returns false without touching the cursor,
    leaving an skb_put()-extended skb behind in the rx->skb[][] array;
  - lan969x (lan969x_fdma_rx_get_frame()) recycles the page and returns
    NULL, which makes the poll loop break without touching the cursor.

Since the DCB still carries its hardware DONE bit, every subsequent
NAPI poll picks the same DCB again, takes the same inactive-port branch
and stops again: RX traffic on all ports stalls until the driver module
is reloaded. sparx5_xtr_flush() only drains the QS_XTR hardware FIFO
and does not clear the stall.

Patch 1 treats a bogus frame on sparx5 as consumed: free the skb, clear
the array slot and return true so the NAPI loop advances past the DB as
it does for any other received frame; the slot is refilled by the
dataptr callback when the DCB is recycled. Patch 2 splits the two NULL
meanings on lan969x (allocation failure, which keeps its retry-later
break, vs bogus frame) and advances past bogus frames in the poll loop.

Found by code inspection; the stall needs the hardware to emit a frame
with an invalid source port, which cannot be triggered without hardware.
Review from someone with access to sparx5/lan969x systems would be
appreciated.

Zhang Hewei (2):
  net: sparx5: fix RX ring stall on frames from inactive ports
  net: lan969x: fix RX ring stall on frames from inactive ports

 drivers/net/ethernet/microchip/sparx5/lan969x/lan969x_fdma.c | 18 ++++++++++++++--
 drivers/net/ethernet/microchip/sparx5/sparx5_fdma.c          |  9 ++++++++-
 2 files changed, 25 insertions(+), 2 deletions(-)

-- 
2.39.5 (Apple Git-154)


             reply	other threads:[~2026-11-08 18:45 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-08 18:45 memoriaru [this message]
2026-11-09  7:53 ` [PATCH net 0/2] net: sparx5/lan969x: fix RX ring stall on frames from inactive ports Daniel Machon
  -- strict thread matches above, loose matches on Subject: below --
2026-11-16  9:56 Daniel Machon
2026-11-18  3:00 ` patchwork-bot+netdevbpf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=tencent_ACC296C1F221C304053BD0F1F4B0D2C2BA06@qq.com \
    --to=memoriaru@foxmail.com \
    --cc=79190669+memoriaru@users.noreply.github.com \
    --cc=Steen.Hegelund@microchip.com \
    --cc=UNGLinuxDriver@microchip.com \
    --cc=daniel.machon@microchip.com \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox