πŸš€ go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #21754

Re: [PATCH net 2/4] net: add netif_disable_subqueue()

#21754
From: netdev-bot+sashiko
Date: Tue, 24 Nov 2026 12:33
74 lines
10524 bytes
Thank you for your contribution! Sashiko AI review found more severe
issue(s) in other patches of this series. This mail is only an FYI, in case
you want to address the nit picks below when you respin.

Low priority / nit picks for your consideration:

- [Low] The commit message for "net: add netif_disable_subqueue()"
  describes the patch as only adding a new helper ("Add a helper like…

--

net: add netif_disable_subqueue()

This commit adds netif_disable_subqueue(). The helper stops a single TX
subqueue while holding that queue's xmit lock, so ndo_start_xmit() is no
longer running on it when the helper returns. The commit also rewrites
netif_tx_disable() so that it calls the new helper for each queue.

> diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
> index 435be7880d7e5..e716b98e8b4c8 100644
> --- a/include/linux/netdevice.h
> +++ b/include/linux/netdevice.h

[ ... ]

>  static inline void netif_tx_disable(struct net_device *dev)
>  {
>  	unsigned int i;
> -	int cpu;
>
> -	local_bh_disable();
> -	cpu = smp_processor_id();
> -	spin_lock(&dev->tx_global_lock);
> -	for (i = 0; i < dev->num_tx_queues; i++) {
> -		struct netdev_queue *txq = netdev_get_tx_queue(dev, i);
> -
> -		__netif_tx_lock(txq, cpu);
> -		netif_tx_stop_queue(txq);
> -		__netif_tx_unlock(txq);
> -	}
> -	spin_unlock(&dev->tx_global_lock);
> -	local_bh_enable();
> +	spin_lock_bh(&dev->tx_global_lock);
> +	for (i = 0; i < dev->num_tx_queues; i++)
> +		netif_disable_subqueue(dev, i);
> +	spin_unlock_bh(&dev->tx_global_lock);
>  }

[Severity: Low]
This isn't a bug, but the commit message only talks about adding a new
helper:

  Add a helper like netif_tx_disable() (which drivers commonly use
  when stopping the interface) but for one queue.

It doesn't say that netif_tx_disable() itself is rewritten here.

The old body disabled BH once, read smp_processor_id() once, and used
__netif_tx_lock(txq, cpu) for each queue. The new body uses
spin_lock_bh(&dev->tx_global_lock) and calls netif_disable_subqueue()
for each queue. That helper does its own nested
__netif_tx_lock_bh()/__netif_tx_unlock_bh(), and it takes the queue
index as u16 rather than the unsigned int loop counter.

As far as I can tell the behavior is unchanged. Still, every driver
calling netif_tx_disable() on its stop path picks up this change.

Could the commit log mention the conversion? Something like "Convert
netif_tx_disable() to use the new helper, no functional change
intended." would be enough.

-- 
Sashiko AI review Β· https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261121033215.1020506-1-dimitri.daskalakis1%40gmail.com
Technical Details
Message-ID: <179552362454.3135.13950803840518714648@kernel.org>
Path: mbox-mo1.pugleaf.net!srv.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-370330-linux-kernel-netdev=dewy.ru
References: <20261121033215.1020506-3-dimitri.daskalakis1@gmail.com>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.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-370330-linux-kernel-netdev=dewy.ru
From: netdev-bot+sashiko@kernel.org
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net 2/4] net: add netif_disable_subqueue()
Date: Tue, 24 Nov 2026 12:33:44 +0000
Organization: Usenet Network
Message-ID: <179552362454.3135.13950803840518714648@kernel.org>
References: <20261121033215.1020506-3-dimitri.daskalakis1@gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="4133569"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:R2/qBdRfjz+jW1ALqPBo+/50+VU= sha256:0Ffmr0Ig1PZl2FzD3jvdoN2FdB+ApRSgKzNATY70ZtY=
	sha1:V7UkHO9jfcb2JzYni7b2TEwVwbM= sha256:Z7pci7VcZ2rQWQ3DKF8de9eSAClGV0BqtPA3OHq0goo=
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 8E825125E0A; Tue, 24 Nov 2026 15:34:03 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.4
X-Spam-Status: No, score=-3.4 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, URIBL_BLOCKED=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 iavbJ1dvCynn;
	Tue, 24 Nov 2026 15:33:59 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-370330-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 E0F59125E13; Tue, 24 Nov 2026 15:33:50 +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 032BE33799; Tue, 24 Nov 2026 12:33:47 +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=1795523626;
	b=tQBfpBFmC69L0mVfK26LYkbhJldcPNteGuqQFe4fIyqY7C3dJuQLJDPuPa/y7Rs/8K+T
	 TnKheK/DTl+/M95EJtCpkAhAiLleHjMwBdxHC9ukEAcTZMpYG5W+DIRdKvakqKZfV6SoI
	 E0WKTP0Jx9NaxOrZx5vnVJl1HXpeU5hO78BWk++G6Ox1K/QzVpEFFkJocIW7G4i2kkhye
	 q+qTSVugHprReUnfltETQQTamCOr0+vbGSU/6o23VFtjd8quln1WZUe8ZqktgGITji6jk
	 U0rlFrZjmZIMyfeP43UaRMzhHt1iJ+syZwHS0QRIxoadKnKRnhZOIVO2uOE3melpWWw==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1795523626;
	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=Z4d3nL7OYdYZt4tg7FEsgePZF7AWi0rnbr/OxJzP0IE=;
	b=SUz7So6e9P3LrS5o7hnPreOyzBVUNi3MZTFQCK7p0ruJkaHjEDfzborFFscc/DJCWYTp
	 rS5A4KKh11E2PWfkX1BPZRDlrkyKvtDP/Qy3zThuDzqCCAPoq21pjLjUjAfTpiZD05NPK
	 Gk6zjkNGGFAWXSAwxghNihFXMiDUwM5fgL7kHw77DM4Xw7UrXUw2dA+b3Oe4wcm+y1ZR4
	 kFa7G/xifVhHaxOUA7vGFrxWNnlyNucTDOKdl7YsJeVy5ep6cbVyeo4i5m0blkV7Vpj/F
	 8+GxcOO5dE3rSQyBXwxFugAx6sVQBnm51j/DmqBvyyaQWW2ar57x/EL8Ug7c72iZqIA==
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=QS5wPKP7;
	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 D08C4606A322;
	Tue, 24 Nov 2026 12:33:46 +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=QS5wPKP7
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=1795523626;
	b=NHwgg5Yqs3xKmZP9naVY1lH/VOty737hMX/NH1miE2iSJTps+TXwGZ+z4N1/e26G08Yz
	 pNM+ONH1ZDHXA2FFr8025G9PEgj2FcuSDOXFUe+d6H1YyBZpwnZ1JVldkAXhdde2a7W5b
	 j5hUOf3wCvvEyrqeRszg+Uq8JXUuW2++BWaFz95cky+AEfzv8NmM3ciaLFRt9hwyVlExB
	 ZjctuKieDdy3V67UV1laSG3qToKBw3umbzdfibWJvQpZ3rSLK3UZ1OAnz9bNwC5evRMLr
	 dx/jCajB/tShZo5SzPYa+B2INf8Bcnue9NTIElOvUUonNx70UOPP9Bi6IHXceAb9CcQ==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1795523626;
	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=Z4d3nL7OYdYZt4tg7FEsgePZF7AWi0rnbr/OxJzP0IE=;
	b=tltzES0xhhSxzOSM5UwJgGDjVjWxjZ7jzY/ZCKGdFS/3zssLiK9rqC3iINWwPXuDpONm
	 de4KB+SNzAYKO2+2EKXVs261aoD2DLRuN8KxmmG9ncDLhZhu3orYvlJOrXDT107jaJSTb
	 r1zYnKyuvPokDe9W54cKHGdM07bSdsmN+sE9c+Vu6/4bZ35igFqRkMt39Iqcs5OInjSga
	 JjtyC0k8yPICBXH8L5ltV6O7eVVorH/JLHzj6IcRKZyuR78FhFFKYZAjYeBUAwmm7vrZ6
	 KDmpD2M+mR8ePVGaZXE39LEvb9dR70PiRFIvq0Twi2eTlQydvetIXTfBLVHwchNqiVA==
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=QS5wPKP7;
	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 EF0D8606A31E
	for <netdev@vger.kernel.org>; Tue, 24 Nov 2026 12:33:45 +0000 (UTC)
X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id EA31C1F000D0;
	Tue, 24 Nov 2026 12:33:44 +0000 (UTC)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1795523625;
	bh=Z4d3nL7OYdYZt4tg7FEsgePZF7AWi0rnbr/OxJzP0IE=;
	h=Subject:From:To:Cc:Date:In-Reply-To:References;
	b=QS5wPKP7+uhkgh87b3SgFOyHSqEAV+eq/xyQ5x2LW7gU7FJJtYOtOYMDMSnmkIsSL
	 46ZkvNrVk4eagkFRlh3uzYVdqJK6neBLVuZsrfc0wOVFDF7h/rdqillffKEVWBQXA9
	 /4ZQeRS2f/rfjH7oqYrF7OJYUDUvZ4E5bxhOUs7R0Fl7XbhulZFyxOROByplb5yDmH
	 JlsV4RUnYb2EjGqQGsM2A2b98QQh3aJRZHpmGsWqYLrr2+d2L+7sDSR5nrznvemJLy
	 22zZEfBwz5alBvtlWITvvd9NFjtxPaJEHTfHH7HyuZI8EVq9kCO0iTEB/qTHColHCG
	 nrWQHkKjEPKpw==
X-Cc: davem@davemloft.net, alexanderduyck@fb.com, kuba@kernel.org,
 kernel-team@meta.com, andrew+netdev@lunn.ch, edumazet@kernel.org,
 pabeni@redhat.com, willemb@google.com, horms@kernel.org, bjorn@kernel.org,
 bobbyeshleman@meta.com, almasrymina@google.com, daskald@meta.com,
 netdev@vger.kernel.org
X-In-Reply-To: <20261121033215.1020506-3-dimitri.daskalakis1@gmail.com>
X-sashiko-severity: Low
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