Article View: linux.kernel.netdev
Article #12320Re: [PATCH net] r8169: enable the RxOverflow interrupt again
From: Jakub Kicinski
Date: Fri, 06 Nov 2026 21:18
Date: Fri, 06 Nov 2026 21:18
80 lines
11743 bytes
11743 bytes
On Sun, 1 Nov 2026 11:27:20 +0100 Jure Rebernik wrote:
> Commit 6994520a3328 ("r8169: disable interrupt source RxOverflow")
> removed RxOverflow (RxDescUnavail in the vendor driver) from the
> interrupt mask on the grounds that NAPI is scheduled anyway when the
> chip runs out of RX descriptors. On RTL8125B that does not hold.
>
> When the RTL8125B runs out of RX descriptors it sets RxOverflow and
> stops receiving. It does not start again when the driver returns
> descriptors to it, only when RxOverflow is cleared in IntrStatus.
> rtl8169_interrupt() clears only the bits it read on entry. If the ring
> fills while NAPI runs with the interrupt mask cleared, RxOverflow is
> set after that read and stays set: NAPI empties the ring, unmasks the
> interrupts and completes, the stopped receiver raises no RxOK, and
> RxOverflow is no longer an interrupt source. Reception stays stopped,
> and every frame is counted in rx_missed, until another event such as
> TxOK makes the handler clear all status bits.
Not really following the explanation, TBH.
In general "ring empty" IRQs are discouraged because the host is likely
overloaded, so having the NIC force the NAPI is not helpful. But sounds
like you say there's some sort of a race?
> This was observed on a machine in real use: an RTL8125B (XID 641) on
> the PCIe bus of an arm64 Qualcomm QCS8550, running v7.2.6. With UDP
> at 800 Mbit/s inbound and nothing sent by the host, reception stopped
> for seconds in 13 of 20 30 s runs, losing 5% to 31% of the datagrams,
> and a single transmitted packet restarted it. To confirm the cause,
> a debugfs dump added to a test build of the driver showed, during each
> stop, IntrMask 0x2f, IntrStatus 0x50, NAPI idle and all 256 RX
> descriptors owned by the NIC. Writing only RxOverflow to IntrStatus
> from user space, through the sysfs PCI resource mapping and with
> nothing transmitted, restarted reception in 17 of 17 stops.
> Reproducing the stall itself needs no kernel modification.
>
> With this change backported to v7.2.6, 0 of 20 runs stopped and the
> worst run lost 0.03%, on two RTL8125B boards. It was build-tested,
> not run, on this tree, where the single-vector path RTL8125B uses
> is the same as in v7.2. The multi-vector mapping used by RTL8127 is
> not changed and was not tested.
>
> Restore the mask of the chips that had RxOverflow before that commit.
> Only RTL8125B was tested.
>
> The investigation was done with an AI coding assistant (Claude Code):
> it wrote the HIL test scripts, the debugfs instrumentation and the
> register tools used above, proposed this change and drafted this
> changelog. I reviewed the change and the evidence, and the test
> results above come from runs on our hardware.
>
> Fixes: 6994520a3328 ("r8169: disable interrupt source RxOverflow")
> Cc: stable@vger.kernel.org
> Signed-off-by: Jure Rebernik <jure.rebernik@luxonis.com>
> ---
>
> Notes:
> This restores RxOverflow for every chip that had it before 6994520a3328,
> but I could only test RTL8125B. If you prefer, I can send a v2 that sets
> it for the RTL8125 family only (rtl_is_8125()).
>
> drivers/net/ethernet/realtek/r8169_main.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/net/ethernet/realtek/r8169_main.c b/drivers/net/ethernet/realtek/r8169_main.c
> index cd4ebc654dd0..62709160d354 100644
> --- a/drivers/net/ethernet/realtek/r8169_main.c
> +++ b/drivers/net/ethernet/realtek/r8169_main.c
> @@ -6086,7 +6086,9 @@ static void rtl_set_irq_mask(struct rtl8169_private *tp)
> tp->irq_mask = RxOK | RxErr | TxOK | TxErr | LinkChg;
>
> if (tp->mac_version <= RTL_GIGA_MAC_VER_06)
> - tp->irq_mask |= SYSErr | RxFIFOOver;
> + tp->irq_mask |= SYSErr | RxOverflow | RxFIFOOver;
> + else
> + tp->irq_mask |= RxOverflow;
LLMs point out that you're adding the same bit on both sides so just
add it in the unconditional init of tp->irq_mask above
--
pw-bot: cr
Technical Details
Message-ID:
<20261106131828.2844d23e@kernel.org>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-358175-linux-kernel-netdev=dewy.ruReferences:
<20261101102720.702600-1-jure.rebernik@luxonis.com>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-358175-linux-kernel-netdev=dewy.ru From: kuba@kernel.org (Jakub Kicinski) Newsgroups: linux.kernel.netdev Subject: Re: [PATCH net] r8169: enable the RxOverflow interrupt again Date: Fri, 6 Nov 2026 13:18:28 -0800 Organization: Usenet Network Message-ID: <20261106131828.2844d23e@kernel.org> References: <20261101102720.702600-1-jure.rebernik@luxonis.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Injection-Info: usenet.network; logging-data="3978198"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:BV/lQf1FoQJquiXXdgKTQjxK9KQ= sha256:ZvetHTgYCMuWCwAuKme3xv9JZNsd5ZVd2KKBov6tjRU= sha1:MaAtdNSjb8ujhIBnSIrieYaVBjs= sha256:lHWpxpSmg78j3Tqhysq5FEJKZX1t8uz/bVl6JXoZjuo= 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 D6C29113338; Sat, 7 Nov 2026 00:20:07 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -3.401 X-Spam-Status: No, score=-3.401 tagged_above=-9999 required=6.31 tests=[DCC_REPUT_70_89=0.1, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, 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 (2048-bit key) header.d=kernel.org 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 bihFmTRTmXxQ; Sat, 7 Nov 2026 00:20:04 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-358175-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> X-Authentication-Results: OpenDMARC; dmarc=pass (p=quarantine dis=none) header.from=kernel.org X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10]) by mail.dewy.ru (Postfix) with ESMTPS id 4026A11331B; Sat, 7 Nov 2026 00:19:55 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by sea.lore.kernel.org (Postfix) with ESMTP id 31FFB2F0A4; Fri, 6 Nov 2026 21:18:41 +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=1793999921; b=a5JwTvx6ccpguwzAr9VlWKVR7Z4iH9RbpqmgMiDgRRXPLDlkCVKmdG0RttuY17DnNIZ9 5o5VfE/fG3O+2LlJld83admyTTsbtbpn3yCJMkhpjjsnUv448HgdrcQWTMkorOawj7JRk 4ZLYjogm3iJ3jFDVNoW74oEH5g43N8uI8eJqFc2WdNZZJpw7ayBRoGgLyNmz9XFuMrc+u x67Q5ibbjycGcLNoD2CuavuPpT/NVF697JpKM02R7tiSDoLkyi635AyPNB/jnH6YrjtEv zo+zP8eKHbLitnlh2VVbnzKtXYOS4mwSHLEd27ZmyR9VlvLRk2Ykw4zrWnEZ+db21xg== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1793999921; h=X-Original-To:Received:Received:DKIM-Signature:Date:From:To:Cc: Subject:Message-ID:In-Reply-To:References:X-Mailing-List:List-Id: List-Post:List-Help:List-Subscribe:List-Unsubscribe:List-Owner: Precedence:MIME-Version:Content-Type:Content-Transfer-Encoding; bh=dsIj34Cu43OU8nAUF9nVgHZIUjZLU87Dom+4gQ74OIs=; b=IVSpGWze9Y59VvF9kyqXanOkLQTxsSgEs3d4CIRKrbgna64xrJbsP4cURM3KC9xrXA6Y 7DP8uYlCacTqGjHT89NXzJf5OJuFm/9At7EzlWoEmxeWjix3vpWNPU2Rvps3CAHur7avb reOp01n3VcJmsjhruqVDK4Cqpn/a2WU6Vc0vKPSPTwTNhjNx7Ds5fPbWAt009T6YbB3Dz 2ZOZlV3mzoTfqDKRGQws57k2SRtsljXPjqdJeLFixqawzbH6UnUUOCGVwOt8VkDTeYqq3 Aux0u04mX/JShUJ1XMEknpojRM/od7Gu1YjgpfJ7Xx0xBnUwsXnBDC213nwf8e7dlNg== X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=nUrYolUN; 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 09750606A331; Fri, 6 Nov 2026 21:18:41 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=nUrYolUN X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1793999910; b=WL49UFjhR4OLzXtdveM0H0d5bjYYblb6k/BasSvuQsK5zdoNYfrxklfOZBDkvnGCxqEH l//6W6Uv1wfBJLGDfkTP2JCgeSLk+Sx8sq6TcSA1d6ScQnmh4bOa+GDpAX158DgepGpMt XpYl40I0zTzMR08X4ythgirikk2dICNW6WjmEp0h8MXmLlsXD2eU7AwbrOUaR5ONCNvbJ ZVPoTnYAQjB1h9/mf9hLqqp7d/N4RQZVjrP3vwY0chG+glCe8OARwWT8ZoewoJA4lVuET y7xZrEYLCO9ymj5XzXjZY2H72lioG6gWSOwSb71nIIzMfXzUuRI+jPScm+Esy9iSA6Q== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1793999910; h=Received:DKIM-Signature:Date:From:To:Cc:Subject:Message-ID: In-Reply-To:References:MIME-Version:Content-Type: Content-Transfer-Encoding; bh=dsIj34Cu43OU8nAUF9nVgHZIUjZLU87Dom+4gQ74OIs=; b=vT8CKgVhHPeaEE/Z1TgPszVkwqQUeJ5PQc4TS2vQvKBy/GL/N547Fguey/8EZu4zL7cb 96Qj3ZvwHmKnyPWgXO4YdznxvnhntbBZERh4/ShL3P0WdoVmY4P5KtqodSZ8WfGeBNmt+ 9p81eGmWeg69mB/y2W+js97DNhClu4VvI7t29Aj7uLc9wtsFxTouJJd3CUBs5cxPWfAvS KZ3SoJSw9J20b4ludtzKp9rrbrLnAOLMnyK9YumSNm4GXNC7v861EVFs/pQx71ro2SW2H LNNwObuuCKRXJe7fEb2ZeGWKZf96dMUtj8Q2JmjrEjInYzFTwlm/HH/iwdRNUecbCEQ== X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=nUrYolUN; arc=none smtp.remote-ip=100.103.45.18 X-Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D6218606A330; Fri, 6 Nov 2026 21:18:29 +0000 (UTC) X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3E36C1F008A3; Fri, 6 Nov 2026 21:18:29 +0000 (UTC) X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1793999909; bh=dsIj34Cu43OU8nAUF9nVgHZIUjZLU87Dom+4gQ74OIs=; h=Date:From:To:Cc:Subject:In-Reply-To:References; b=nUrYolUNu79sTI9HQCzgLYCON24rJi9xrm31WxOJg6SPF651K4sbjF8g9Neasyjmr zO+Nr4Gb5rWTWejKr55D6onXVl9m8GncJ8BnyAwKypH3chakHPIHiEcqp8mAFLSn+R 7wVs6lLSsjQ4TVCHnflBkchnQetPAT/RmCFaZmIbkLAYVlhiV45OrHF+qliwTiWG7c 4pxNbUT+s5wcBJ3ULheZAE0SMl6qWEqVMfpIQi3F1KfL8/Nvwn8knFWoLr36iWUEYj kgvNJEABKNB1128pJ9rwlqVovYrqSK1iaGMrs8RDGTnkAyEEADLDQPlA8codZq1uo7 Vd7QS9nio5Baw== X-Cc: Heiner Kallweit <hkallweit1@gmail.com>, nic_swsd@realtek.com, netdev@vger.kernel.org, Andrew Lunn <andrew+netdev@lunn.ch>, "David S . Miller" <davem@davemloft.net>, Eric Dumazet <edumazet@kernel.org>, Paolo Abeni <pabeni@redhat.com>, linux-kernel@vger.kernel.org, stable@vger.kernel.org X-In-Reply-To: <20261101102720.702600-1-jure.rebernik@luxonis.com> 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