Article View: linux.kernel.netdev
Article #13333Re: [PATCH net] net: bcmgenet: cap the Tx queue threshold at the ring size
From: netdev-bot+sashiko
Date: Mon, 09 Nov 2026 17:12
Date: Mon, 09 Nov 2026 17:12
93 lines
11204 bytes
11204 bytes
Thank you for your contribution! Sashiko AI review found 1 potential
issue(s) to consider.
Critical: 0 ยท High: 1 ยท Medium: 0 ยท Low: 0
If you believe none of the issues are legitimate, please reply to each
issue of Medium severity or higher and explain why the AI is wrong.
If any of them are legitimate and you plan to respin, please let patchwork
know by including "pw-bot: cr" as a separate line at the end of your reply
(one such reply per series is enough).
- [High] This patch only partly fixes the Tx stall it targets.
--
net: bcmgenet: cap the Tx queue threshold at the ring size
This patch adds a per-ring stop_thld field, capped at size - 1. The field
replaces MAX_SKB_FRAGS + 1 as the threshold for stopping and waking Tx
queues in bcmgenet_xmit() and bcmgenet_tx_poll(). The goal is to stop the
32-descriptor priority rings from staying stopped forever when
CONFIG_MAX_SKB_FRAGS is 31 or larger.
> diff --git a/drivers/net/ethernet/broadcom/genet/bcmgenet.c b/drivers/net/ethernet/broadcom/genet/bcmgenet.c
> index 4d2be2a21ed1b..186d17781b890 100644
> --- a/drivers/net/ethernet/broadcom/genet/bcmgenet.c
> +++ b/drivers/net/ethernet/broadcom/genet/bcmgenet.c
[ ... ]
> @@ -2742,6 +2742,8 @@ static void bcmgenet_init_tx_ring(struct bcmgenet_priv *priv,
> ring->index = index;
> ring->cbs = priv->tx_cbs + start_ptr;
> ring->size = size;
> + /* A ring smaller than that would never wake */
> + ring->stop_thld = min_t(unsigned int, MAX_SKB_FRAGS + 1, size - 1);
[Severity: High]
Does this fully fix the stall on queues 1 to 4 when CONFIG_MAX_SKB_FRAGS
is 31 or more? The wake threshold is now capped, but the per-skb admission
check at the top of bcmgenet_xmit() has not changed:
bcmgenet_xmit() {
...
if (ring->free_bds <= (nr_frags + 1)) {
if (!netif_tx_queue_stopped(txq))
netif_tx_stop_queue(txq);
ret = NETDEV_TX_BUSY;
goto out;
}
...
}
free_bds can never be larger than ring->size (32). So an skb with
nr_frags >= 31 gets rejected even when the ring is completely empty.
In that case nothing is in flight, so no Tx-done interrupt arrives and
bcmgenet_tx_poll() never wakes the queue. The watchdog is the only wake
source left:
dev_watchdog()
bcmgenet_timeout()
bcmgenet_tx_reclaim(dev, ring, true);
BCMGENET_STATS64_INC((&ring->stats64), errors);
netif_tx_wake_queue(txq);
The qdisc then retries the same requeued skb and gets NETDEV_TX_BUSY
again, so the queue stops again.
Wouldn't that leave the queue, and every flow hashed to it, stuck for
good? The "NETDEV WATCHDOG: transmit queue N timed out" message and the
error count from the commit message would then come back every
watchdog_timeo.
The core does not keep such skbs away from the driver. The driver
advertises NETIF_F_SG, and it has no ndo_features_check and no
skb_linearize() fallback. Highly fragmented skbs can come from
MSG_ZEROCOPY, from splice, or from forwarded traffic.
Should bcmgenet_xmit() also handle skbs where nr_frags + 1 >= ring->size?
It could linearize or drop them, or clear NETIF_F_SG for them in
ndo_features_check.
> ring->clean_ptr = start_ptr;
> ring->c_index = 0;
> ring->free_bds = size;
[ ... ]
--
Sashiko AI review ยท https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261106-nb-genet-txq-thld-net-v1-1-53bbac647b71%40tipi-net.de
Technical Details
Message-ID:
<179424433591.994134.17565447879442853727@kernel.org>Path:
mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!news.mb-net.net!open-news-network.org!3.eu.feeder.erje.net!feeder.erje.net!feeder1.feed.ams11.usenet.farm!feed.usenet.farm!feeder.usenetexpress.com!tr3.eu1.usenetexpress.com!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-359470-linux-kernel-netdev=dewy.ruReferences:
<20261106-nb-genet-txq-thld-net-v1-1-53bbac647b71@tipi-net.de>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!news.mb-net.net!open-news-network.org!3.eu.feeder.erje.net!feeder.erje.net!feeder1.feed.ams11.usenet.farm!feed.usenet.farm!feeder.usenetexpress.com!tr3.eu1.usenetexpress.com!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-359470-linux-kernel-netdev=dewy.ru From: netdev-bot+sashiko@kernel.org Newsgroups: linux.kernel.netdev Subject: Re: [PATCH net] net: bcmgenet: cap the Tx queue threshold at the ring size Date: Mon, 09 Nov 2026 17:12:15 +0000 Organization: Usenet Network Message-ID: <179424433591.994134.17565447879442853727@kernel.org> References: <20261106-nb-genet-txq-thld-net-v1-1-53bbac647b71@tipi-net.de> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Injection-Info: usenet.network; logging-data="409499"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:cbiWs7vDPC4APMA1DUuy7lS9t5Y= sha256:BZCX3p5QvFImaT6x4Klx16QQ1nPsg5yfaDS3C7w/gtg= sha1:TEOD6TEWucj3sY+iEhPiEbsYbxM= sha256:203naMaqi0fzHsnaYC6BopRB9v4d9kLBovbLPwkmL10= 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 ADEA91138AA; Mon, 9 Nov 2026 20:18:18 +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 l4OLnGjY7rJV; Mon, 9 Nov 2026 20:18:13 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.105.114; helo=tor.lore.kernel.org; envelope-from=netdev+bounces-359470-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 tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114]) by mail.dewy.ru (Postfix) with ESMTPS id 884CB1138A6; Mon, 9 Nov 2026 20:18:05 +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 5C235C44E2; Mon, 9 Nov 2026 17:12:19 +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=1794244338; b=ljON6YgVudySJjwQc4waV34OeP1Kes32mM1PBZEvMPIyyHttfgDJHNCrgrDFHepQwc4S IJIwnA88papaRVSYhwvR0w7Sr2EAzv7Svm6OgI0ST6Q/MQFY/H+cmUy7ZrG8qD/0RYO9L r3YyE+RrK56JG/SHHJQhN8BGStyuOo/NA1JdekhGPk4pDGGHgMiJllp199BPf6atr7+SX 19yh8bCldmsIhABi09azroEnV7a5tTTjSfM6lBT2AAPuN/fm4QjbyVBdeaNDsR/F9wZ+5 ETdFVWe084GnNZl+AMjTLJCAkhZ5ju7eHBEAluDo3aSbdSlDq5oDOL3yGaYxfhyzTvw== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1794244338; h=X-Original-To:Received:Received:DKIM-Signature:Subject:From:To:Cc: Date:Message-ID:In-Reply-To:References:X-sashiko-severity: Content-Type:Content-Transfer-Encoding:X-Mailing-List:List-Id: List-Post:List-Help:List-Subscribe:List-Unsubscribe:List-Owner: Precedence:MIME-Version; bh=hzZZMQ8fpl/iDvObtrAtE4+lTu94nFzniKzTb7/B3Ks=; b=gs7fG2aen2Fh/FaLUD3pHYLtDUh44efDKWEGxhcyQXhCgNUoqkC2c/+zhfLUIKOTP6TI dJzyUKqUUeP+s3adRrL1Bfnt5ZAfE1Rzq0vwigcKAupo0QCcWFmU+x8DKCk6aI4M62Lnv GmXCz68FPn2Kuf4agqzLW6JlUNOSpqqxXa9FICgj1Qh6dhmFBtrnAk6BaokbDgLdOxmWd m/joVdrUs+sTqR1XSF14MRSx07vt5rRGWnHA0xZ76i8S2zLEYxZHqPfDim9+za8jcV9YO 8aZ9uzBO3w4tO4ng01iNA0cKP4YqtYtjItoOADBcatjFTaHNDi+0zFtfdzOxhQvenJA== 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=FCeltfjD; 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 B3EC8606A334; Mon, 9 Nov 2026 17:12:18 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=FCeltfjD 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=1794244337; b=Kung/0Xma8oV7F4Yy6PkFuh4/Xrq1UDvJ6rJr/+lJLnVPriqo3gR5V09Z7iupXQ/idmS sIlACSsq9ZyuSxxR6XuWZG1tYjkknHP7rAPDp+2uzTRO4/n46fCl/ZR3JhQpn2LX3adwY izZVL1++hMemeLQCTjkYYPaw6mrZm1WzcHnEo4Iw+8k2tvBJKX/7EjZB/YhqOQetwHCj5 XB1vKtiQh/79wTxAC1f1EY/d4vVNpK8J0+Hp8k0A3ScNKLudHEnF8VrgrZ4sVx9CLs1kS 7+XwAW+Rc3i4fAO/qmArKu1r5ID5Ky0tiKVtFoutNWvEurzE0FzNEDsQQbN/B72rswQ== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1794244337; h=Received:DKIM-Signature:Subject:From:To:Cc:Date:Message-ID: In-Reply-To:References:X-sashiko-severity:Content-Type: Content-Transfer-Encoding:MIME-Version; bh=hzZZMQ8fpl/iDvObtrAtE4+lTu94nFzniKzTb7/B3Ks=; b=UiG2VKa0mt5ivkTfcuuquCIbf3orLMkbPiGAxeHJHEOwX4Zzh3oDUMOQOSthTJT0+Hv5 EpVoUDKs/Dxk/M8mvYPwUoIW9Hc8Qrc2Dc1Dd20UvDAwIt3Av3URL3wLRtEPOeBCu3s6J giBkV45QY6Y4bx/+atgHepUtMXMlBHxHgKLrh3YXs/x9wqoRLe4mxey6TK7hzH0f3NGyN 0ltrEoI63EHCXPSpLAGxdhPJsGYLHy5sINK90NRtjQjCfB/CjtEOBs+I9i8lXyMK9mP6d 4Wp5SIRASoE36K5xWzFW9pDTTM7br4IbFSx3LqaROdhfznBA1tfPts2BKRXkMNVDzUQ== 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=FCeltfjD; 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 909D1606A31C; Mon, 9 Nov 2026 17:12:17 +0000 (UTC) X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6BBE51F0089F; Mon, 9 Nov 2026 17:12:16 +0000 (UTC) X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1794244337; bh=hzZZMQ8fpl/iDvObtrAtE4+lTu94nFzniKzTb7/B3Ks=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=FCeltfjDSjW78XeaZCd5V4lxYvLkPlVIPIYw75BfO41aULF6gUm0AktNJ/2/yZFPv jzA+MlXtYSpLzYd1h0GfzKC0XQCL3q568AF9KoBZWyyf9FbEy2Tef0WdmLEucyjEOp wGQ/7lYU3Xql+8+Di+/tCYTLZ93Lcp7qsgmyL1jfiGY0Q2CH44d2pDk92ZZj/la9Dy Pj6DWVttXPHrAHmS0ViXANeCSoosKIaryeWGuczJyy8NaCPwNOLRoJ6lNqqqmiLRhD DpJM+Z38T24ZgzHco7KT75EAKSNVvIZtnlc93/q2T4UARXymmsiwxfeFF5xVr6EJui L7IyLlOaQk81Q== X-Cc: opendmb@gmail.com, florian.fainelli@broadcom.com, andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@kernel.org, kuba@kernel.org, pabeni@redhat.com, justin.chen@broadcom.com, bcm-kernel-feedback-list@broadcom.com, razor@blackwall.org, kerneljasonxing@gmail.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org X-In-Reply-To: <20261106-nb-genet-txq-thld-net-v1-1-53bbac647b71@tipi-net.de> X-sashiko-severity: High 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