🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #13414

Re: [PATCH net] net: bcmgenet: cap the Tx queue threshold at the ring size

#13414
From: Nicolai Buchwitz
Date: Mon, 09 Nov 2026 20:28
73 lines
10885 bytes
On Mon, 2026-11-09 at 17:12 +0000, netdev-bot+sashiko@kernel.org wrote:
>  [...]


> [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;
> 
> [ ... ]

Another angle, also pre-existing, but lets fix this properly with
another patch in v2. Long term goal should be to get rid of the
undersized queues (see my response to Florian)

--
pw-bot: cr

-- 
Nicolai Buchwitz <nb@tipi-net.de>
Technical Details
Message-ID: <62513008af14da4a6fb35e1a9566146dca0efbef.camel@tipi-net.de>
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!news-ams.pugleaf.net!srl.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-359597-linux-kernel-netdev=dewy.ru
References: <20261106-nb-genet-txq-thld-net-v1-1-53bbac647b71@tipi-net.de> <179424433591.994134.17565447879442853727@kernel.org>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!news-ams.pugleaf.net!srl.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-359597-linux-kernel-netdev=dewy.ru
From: nb@tipi-net.de (Nicolai Buchwitz)
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net] net: bcmgenet: cap the Tx queue threshold at the
 ring size
Date: Mon, 09 Nov 2026 21:28:48 +0100
Organization: Usenet Network
Message-ID: <62513008af14da4a6fb35e1a9566146dca0efbef.camel@tipi-net.de>
References: <20261106-nb-genet-txq-thld-net-v1-1-53bbac647b71@tipi-net.de>
	 <179424433591.994134.17565447879442853727@kernel.org>
MIME-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Injection-Info: usenet.network;
	logging-data="444236"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:wq/9lUW7ZWpp2JTCJxpKID9BpLs= sha256:yQCDvReQdJRMFGek2v8DDxxA7scuJkYvvOTBEHrMI18=
	sha1:KJkNZ2QF37e1KX/sd6P+5zWhhys= sha256:mSyNOzDd9ujrxO2LKg0d77w58qyQwDDrYDDuY/gQFeM=
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 D588F113915; Mon,  9 Nov 2026 23:30:02 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.151
X-Spam-Status: No, score=-3.151 tagged_above=-9999 required=6.31
	tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,
	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 (2048-bit key)
	header.d=tipi-net.de
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 E_72NgiO-9Is;
	Mon,  9 Nov 2026 23:30:00 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-359597-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=none (p=none dis=none) header.from=tipi-net.de
X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])
	by mail.dewy.ru (Postfix) with ESMTPS id CA471113911; Mon,  9 Nov 2026 23:29:51 +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 7476E8232B; Mon,  9 Nov 2026 20:29:11 +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=1794256147;
	b=18NF2ktukH3gQZMwcW6kGIf4Y7Q1UXqD4pZ/8Y8N732xuu+GL6wBPz4jNedaP+QHatE7
	 Vgl/vmg1QYYQ0IHF1SEgjST/HSsyK3Hyzdb/f3mvO9qY2zbFRqDfAFyqmuBnm4JJvCflG
	 9g952aNLjkhVadcuKiTc6i+sNCl8G1l1gsiC/3vMF5uXasM9uWzn3p5oOU0psiJoNlErv
	 0rgPXMSj9bdWNlKym4IO/iLVFLPJ7YydwITO9aXgBzKv8wrT2S9wYHOhWBmUDiqIlau7P
	 QqAcXjfieeaoUBhg8QkS6V5TiATMEPX3wEgeNJN+EPxeZfs9v7Vj8yVKa1KNZ0VbBHA==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1794256147;
	h=X-Original-To:Received:DMARC-Filter:Received:DKIM-Signature:
	 Message-ID:Subject:From:To:Cc:Date:In-Reply-To:References:
	 Content-Type:Content-Transfer-Encoding:User-Agent:X-Mailing-List:
	 List-Id:List-Post:List-Help:List-Subscribe:List-Unsubscribe:
	 List-Owner:Precedence:MIME-Version:X-Last-TLS-Session-Version;
	bh=O8bWXtQs5tyhPqTBhmBjUN2HbzWi04nLxsVKERMlLnY=;
	b=OuvSUifhbEAa7bGULpA5e0AZvphyT/OOaPiBHKyDF5rnmOInjwhmPQV3Kxj5UyhMYGCg
	 qcvixNqRh8F2GVD1iUsHCzVKV/0CvltHxwE5yQnp4Sxa04k5G/DACN8hJifZDxfF0WKy1
	 8irl+Yp/DG4rYP929jLzDDENaPKxnyUo24m3jd4JJToCKPFQ6601Efn3HpzR6CtV0KohH
	 A0cLD3u4lYty4oxC7OoJmrcHpoe5iDu21O66m/OkpkdVtsrUMoh3tu0wvHITKrqiRnDU+
	 zaTwfF3vFaDID8uCva/Fqf8c1nRk/Tb0ie7YJkEGTIbVbpsVqVP5YkotPkbq9tXhR1A==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; 
	dkim=pass header.d=tipi-net.de header.i=@tipi-net.de header.a=rsa-sha256 header.s=dkim header.b=OfLuCSba;
	dmarc=none header.from=tipi-net.de;
	spf=pass smtp.mailfrom=tipi-net.de;
	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 1DC98606A333;
	Mon,  9 Nov 2026 20:29:07 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key) header.d=tipi-net.de header.i=@tipi-net.de header.a=rsa-sha256 header.s=dkim header.b=OfLuCSba
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=194.13.80.246
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1794256136;
	b=0jt9xDtlZj7+4CquAx+tbqMh3EzL3ZIngCSsyfd8ZiegrMXCI8RR4QHmHNBs5/SVivq3
	 MZsFhYClOa1eVOuE61Z+5q0zpFCRqe22OcGr15aooliFI7XDRQTW/buM6sij+SExEMQyo
	 /Gi7XIXnEq9tBpiYMR4yB05KeybSGVEKtgFMsrAvqRvBb5bBCHHO4MW3rmx7YMbaWq1JD
	 L4U/Nndpg5PNGansa/tNakTBe4UnPGaoYssESFvV/ds62kmpOQblRxKMb+5rZEblcx5BZ
	 74Zrvv36Qp4H3thRVX2IzqXhHuUdOi9U4/4ymwZghKeLMFq7dG4woKvOWwFNA0o2ySg==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1794256136;
	h=DMARC-Filter:Received:DKIM-Signature:Message-ID:Subject:From:To:Cc:
	 Date:In-Reply-To:References:Content-Type:Content-Transfer-Encoding:
	 User-Agent:MIME-Version:X-Last-TLS-Session-Version;
	bh=O8bWXtQs5tyhPqTBhmBjUN2HbzWi04nLxsVKERMlLnY=;
	b=yurXnaXZW71vRqm6FoCj2P7S6XAMdb3vhep4spK6YpuU7A5H8odyHKQDuR9kEzo8wi8L
	 wp9Q3sdVjPBQAMscAqt+9owwoF3/6VR6tHJca1+qsAV8NIkZT1iZTiBwdsfWutuUsNHgY
	 yjlVxGhGdSw2S6uZohxLlGe8s/Hz+JlZ39a4yCI+czSr7yIkJHgglzeefoU3mv3N/Ujyj
	 /bVUarROI8ZgHyHyVFRG+Nn6AKNvxI8AwEqec9t3vyKGB0I2k9hTOTB2GCnw+b80zZRvK
	 SjHXA6fyhZGsJxCQQBPWcMJFcvyBkbyuEWDYM+NvGPaZqCtW9XsEg2LfXITOWQ1/EKw==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; 
	dmarc=none header.from=tipi-net.de;
	spf=pass smtp.mailfrom=tipi-net.de;
	dkim=pass header.d=tipi-net.de header.i=@tipi-net.de header.a=rsa-sha256 header.s=dkim header.b=OfLuCSba;
	arc=none smtp.remote-ip=194.13.80.246
X-Received: from mail.tipi-net.de (mail.tipi-net.de [194.13.80.246])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256)
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7439A606A321;
	Mon,  9 Nov 2026 20:28:54 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 7439A606A321
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=tipi-net.de
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=tipi-net.de
X-Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 085A8A1583;
	Mon, 09 Nov 2026 21:28:48 +0100 (CET)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tipi-net.de; s=dkim;
	t=1794256131; h=from:subject:date:message-id:to:cc:mime-version:content-type:
	 content-transfer-encoding:in-reply-to:references;
	bh=O8bWXtQs5tyhPqTBhmBjUN2HbzWi04nLxsVKERMlLnY=;
	b=OfLuCSbabGbXKxsEWTqsxyM3H3PDPY0x1vCeUaij/McT8+ZLIk+jVIiEn81OsUSWcQyp+y
	EL0A2/Et5KjkhkSyrVBg5SKA52z7ZzgkT2HENFFUWlylMZ2fNRx2qMvOwMLyrTPuVt8CBk
	PL773vnoj0kE8Lyom1RbSv+Ljwd2FHKa7ynPAFMsvm62xWbdGUoJpaxB8T10Dtww2tTy5M
	ESYBAVQ4lTHKf5aWyPpRZXk9tJbaIeMGe45Q2hz7KSosP8+t0aBPQuHWjRp+THYnOh1yGU
	g4FXLYpwsReFK27ZXMrn/09xpMwviqO1DUJedIC+eIILUh5OrPHION4rBAwizQ==
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: <179424433591.994134.17565447879442853727@kernel.org>
X-User-Agent: Evolution 3.56.2-9 
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
X-Last-TLS-Session-Version: TLSv1.3