🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #12823

[PATCH net 0/2] net: sparx5/lan969x: fix RX ring stall on frames from inactive ports

#12823
From: memoriaru
Date: Sun, 08 Nov 2026 18:45
45 lines
11309 bytes
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)
Technical Details
Message-ID: <tencent_ACC296C1F221C304053BD0F1F4B0D2C2BA06@qq.com>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-358829-linux-kernel-netdev=dewy.ru

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-358829-linux-kernel-netdev=dewy.ru
From: memoriaru@foxmail.com
Newsgroups: linux.kernel.netdev
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
Organization: Usenet Network
Message-ID: <tencent_ACC296C1F221C304053BD0F1F4B0D2C2BA06@qq.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="179181"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:nascv9wn6wOwD1wk1+/x0b8I5es= sha256:2TK31ssbKfFa8OHjMNhQic1o+wZ1m/zgh+5RFI2gZB4=
	sha1:WwsBVazqn2mZyD3Y8iMvFAu1p/E= sha256:aF/n3dpXr6UCuH6lMhbRY0Jp6HS9uLQUfmXZMwnlhaM=
List-ID: <netdev.vger.kernel.org>
X-Mailpost-Empty-Hdrs: X-Spam-Level
X-Received: from localhost (localhost [127.0.0.1])
	by mail.dewy.ru (Postfix) with ESMTP id F2C091135E6; Sun,  8 Nov 2026 21:46:35 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.049
X-Spam-Status: No, score=-3.049 tagged_above=-9999 required=6.31
	tests=[DCC_REPUT_70_89=0.1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1,
	DKIM_VALID_AU=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.001,
	FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249,
	MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001,
	SPF_PASS=-0.001] autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (1024-bit key)
	header.d=foxmail.com
X-Received: from mail.dewy.ru ([127.0.0.1])
	by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id i6yqR5lWcV_C;
	Sun,  8 Nov 2026 21:46:33 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.105.114; helo=tor.lore.kernel.org; envelope-from=netdev+bounces-358829-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=foxmail.com
X-Received: from tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114])
	by mail.dewy.ru (Postfix) with ESMTPS id BBA6F1135E2; Sun,  8 Nov 2026 21:46:21 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by tor.lore.kernel.org (Postfix) with ESMTP id 5BA3862DEB; Sun,  8 Nov 2026 18:45:58 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass;
	t=1794163556;
	b=rO2SvMZC9weNk6buslA6ott2yBX4henZLoy+NCq2NcFikytblJlqdd2v/2SVcybavBTx
	 SbsEGsXMLZPIB3C+2OM3SG7vuFGv0j0bUu7+7ZBat2Ho2HD5VeVmDvqXGG47nvYv5sXJ4
	 enjCJ/zivW0RG4932RwhlEW5cTjzlIrt0qUbo7TMF02u20xwBK5ayaaP+NFuy8vHvLmkn
	 0dYeZ3vYWbcN3l2NQ9LBKAsJfDLnk2w7bF1i9UlO25RCymDvJGaEFJkwq1tnaFoxYewM3
	 YomHLwO4U6063A1B/7EFeCSK6z9t6oLdpBEKBg0KnWtIUuCYJQXijhftKJmRe3ljSzg==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1794163556;
	h=X-Original-To:Received:DMARC-Filter:DKIM-Signature:Received:X-QQ-mid:
	 Message-ID:X-QQ-XMAILINFO:X-QQ-XMRINFO:From:To:Cc:Subject:Date:
	 X-OQ-MSGID:X-Mailer:X-Mailing-List:List-Id:List-Post:List-Help:
	 List-Subscribe:List-Unsubscribe:List-Owner:Precedence:MIME-Version:
	 Content-Transfer-Encoding;
	bh=cocHiwEszqfOsP6pMfNs0Ig4EtP/W5nSTw5C5eTkuYY=;
	b=og8w0SSRbgG6jGyFRwez2e2XrssFvs3QEMW1HWG9c+vL+HEjnE75+1cWoxgUcyjI/mpW
	 ez0vNvmoA4gwFOBVQOGKrkEadqN3nF9bPTGdF3EJZEWoHi+wvnmZMK0ZuzYtDZan7Qvm9
	 1I+tA88kaIx2BCcY+VBWG3h3e/6I+R3OfFN4WVlWUN09ziFtwa9Al7BgzYTYZ4USqeZQ4
	 3iM01Q1TTLJQxcaXjWus5zFQ0vaXMAHnkSio0XPT/Ad8mEZbAgWTjF7uuXEKgImsCFnxz
	 752aPDB/oV+f3KK+Br1Sv2PeT34mFS3xNpl9XTMgnl2DePufAPCd2R8ZAgxApqgBPiQ==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; 
	dkim=pass header.d=foxmail.com header.i=@foxmail.com header.a=rsa-sha256 header.s=s201512 header.b=AHFcJtA+;
	dmarc=pass header.from=foxmail.com;
	spf=pass smtp.mailfrom=foxmail.com;
	arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-Received: from localhost.localdomain (localhost [127.0.0.1])
	by smtp.subspace.kernel.org (Postfix) with ESMTP id 7679F606A338;
	Sun,  8 Nov 2026 18:45:56 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (1024-bit key) header.d=foxmail.com header.i=@foxmail.com header.a=rsa-sha256 header.s=s201512 header.b=AHFcJtA+
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=203.205.221.192
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1794163555;
	b=ch5gBX8bWKjzX/Bq4QfaBIJqYFjoft6B1Jc1KN+TOvSepZs8eiFusWRUCzXAThXlFaBg
	 55iV+UYCZItiIhYGkGqSCUa0BMx0IfLkDNY8CTh0AbuvTkUJ4WACdKfegTARvUU+ajJ4i
	 x4PN38YXGpP8uo3psTukX/tCjbuejrCjqVb3JXjpeU51ypUf96J04YKKWOAYEI+20x6s5
	 ZdBchmiNSXkBHYQUqsjpQgIMepwNedVkfuGUNNd23GKmdvsUoF2kKnAKw4wkRCr2PjP/t
	 DkgScKFBrGZdMvZgAUgYvQHvSeXw5WA4ekZJdAwLWg6PFo3INl7O8vE+yHaoxI3MGvA==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1794163555;
	h=DMARC-Filter:DKIM-Signature:Received:X-QQ-mid:Message-ID:
	 X-QQ-XMAILINFO:X-QQ-XMRINFO:From:To:Cc:Subject:Date:X-OQ-MSGID:
	 X-Mailer:MIME-Version:Content-Transfer-Encoding;
	bh=cocHiwEszqfOsP6pMfNs0Ig4EtP/W5nSTw5C5eTkuYY=;
	b=aS1lsb0kZcCLpKzaGbvbCFIuBVGDxjA5tUxKxR3CsQmfg0kIBABokTfqGNsyofmSBcLV
	 k5LogwbSXA5zk9REjyo8p6sjYm+XIPyVkNxr8aoi8Q9ihZ5W50SrDlZpmz6nRHd3hjES0
	 gqw7KNT6O0Rb+XEBqXR5Mg2PLlVG+mdbu129o8pPEaGSTuOnrJUgPlYpO+Uw7261s6rCr
	 /HNovDf6A2bhD73vPP8OSDM1O2ITUmhT6BeSglEexJpANL23FyY5TFWvfsr+jtP2Zowl9
	 tIeDHRcGAqMWxK72hPG2xDqw7qGLzFC+cWgASI06y7O6IY5fq9wIJ7K/dg+iFEeVhiA==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; 
	dmarc=pass header.from=foxmail.com;
	spf=pass smtp.mailfrom=foxmail.com;
	dkim=pass header.d=foxmail.com header.i=@foxmail.com header.a=rsa-sha256 header.s=s201512 header.b=AHFcJtA+;
	arc=none smtp.remote-ip=203.205.221.192
X-Received: from out203-205-221-192.mail.qq.com (out203-205-221-192.mail.qq.com [203.205.221.192])
	(using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits))
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with ESMTPS id 77540606A323
	for <netdev@vger.kernel.org>; Sun,  8 Nov 2026 18:45:53 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 77540606A323
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=foxmail.com
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=foxmail.com
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foxmail.com;
	s=s201512; t=1794163545;
	bh=cocHiwEszqfOsP6pMfNs0Ig4EtP/W5nSTw5C5eTkuYY=;
	h=From:To:Cc:Subject:Date;
	b=AHFcJtA+ALe4Dc8I3eEuyLEJ43gjzk7H16kRknTwvfk4tRPZ+8Nag1Tzrd5gLUnI+
	 D0nrnemOhcF+DW15eJ1met4jvqmwbktmfKp0xaUV1OQfdJKr+sKk3Ei+tVJBTvQkzN
	 2/JIGlvzF90LKgNTcW/VkpEO68wHvfghttTdSWfE=
X-Received: from localhost.localdomain ([183.23.108.92])
	by newxmesmtplogicsvrszc43-0.qq.com (NewEsmtp) with SMTP
	id B6A9EADA; Mon, 09 Nov 2026 02:45:42 +0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 mSh7HO22hleTYWsRQhnlCQ4M9DvuYA2AcoZwjqkb/YK9VkK+20PXtAssyGXWhklNE7jd6eyhyGHZ
	 TaeQe0Dza0qcedEsjdBy4UJftBJQegjTqegpgPEw==
X-QQ-XMRINFO: M/715EihBoGS47X28/vv4NpnfpeBLnr4Qg==
X-Cc: Steen.Hegelund@microchip.com,
	daniel.machon@microchip.com,
	UNGLinuxDriver@microchip.com,
	79190669+memoriaru@users.noreply.github.com
X-OQ-MSGID: <20261108184541.74618-1-memoriaru@foxmail.com>
X-Mailer: git-send-email 2.39.5 (Apple Git-154)
X-Mailing-List: netdev@vger.kernel.org
X-List-Post: <mailto:netdev@vger.kernel.org>
X-List-Help: <mailto:netdev+help@vger.kernel.org>
X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org>
X-List-Owner: <mailto:netdev+owner@vger.kernel.org>
X-Precedence: list