Article View: linux.kernel.netdev
Article #21997Re: [PATCH net 2/4] net: add netif_disable_subqueue()
From: Dimitri Daskalakis
Date: Tue, 24 Nov 2026 17:43
Date: Tue, 24 Nov 2026 17:43
75 lines
14096 bytes
14096 bytes
On 11/24/26 4:33 AM, netdev-bot+sashiko@kernel.org wrote:
> 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.
>
If this series needs a re-spin, I'll address the change in the commit msg.
Technical Details
Message-ID:
<78dbd822-291c-490d-9f4f-15de0b44de78@gmail.com>Path:
mbox-mo1.pugleaf.net!srl.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-370635-linux-kernel-netdev=dewy.ruReferences:
<20261121033215.1020506-3-dimitri.daskalakis1@gmail.com> <179552362454.3135.13950803840518714648@kernel.org>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srl.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-370635-linux-kernel-netdev=dewy.ru
From: dimitri.daskalakis1@gmail.com (Dimitri Daskalakis)
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net 2/4] net: add netif_disable_subqueue()
Date: Tue, 24 Nov 2026 09:43:10 -0800
Organization: Usenet Network
Message-ID: <78dbd822-291c-490d-9f4f-15de0b44de78@gmail.com>
References: <20261121033215.1020506-3-dimitri.daskalakis1@gmail.com>
<179552362454.3135.13950803840518714648@kernel.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
logging-data="4193823"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:QL/d2QGKCIoX+BwX6h4NqA82rC8= sha256:kEp3fWqg7wyEwhgUkUi3W5166R8yLd17D9Hs48gJak4=
sha1:GXMpRBYVesot2aVoNvMuhw7Yrz4= sha256:Ma5O7Kq03Zr5OBtKMPI6xJ3UhCPElRHGGCMfruqqQ6o=
Content-Language: en-US
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 9C97C125E2C; Tue, 24 Nov 2026 20:43:44 +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 (2048-bit key)
header.d=gmail.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 fV9VkqxK5ASD;
Tue, 24 Nov 2026 20:43:41 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-370635-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN>
X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=gmail.com
X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])
by mail.dewy.ru (Postfix) with ESMTPS id 451C6125E22; Tue, 24 Nov 2026 20:43:33 +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 E2BAF3E28E; Tue, 24 Nov 2026 17:43:17 +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=1795542194;
b=3yTqrnYFTb2J2CfP+jSAitp9AT1Vc58qwCRnudMW9Bn7bPIWvFlLAzkYjzIKYmz2gtmA
szsv+xcXgY+W4EcEQRtOuIgdNe+qH4lHwFBkcKPaRAB0uHlO8uqSxcvyj+99VefoCZSHk
gAI7Z7aK6ZBKJ9IYmG7oSlHaocCg7a6XmE74UwUPYgbh5jsLnPjikW7tmahW3iqbhLKpj
uWXxb0gMOQ1jxubYcXLMrsQC5L54ROSXN3MrZV3b/ffAY0L4JJRXPYDZayrzWuE/XpTV5
MGdddzjxlUmzNhIHNmYN8ttEDXRZLbPkLn4IEMrpm/tV05Pn82Bs0u4I8ZvZ1abX5eQ==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
a=rsa-sha256; c=relaxed/relaxed; t=1795542194;
h=X-Original-To:Received:DMARC-Filter:Received:DKIM-Signature:
X-Google-DKIM-Signature:X-Forwarded-Encrypted:X-Gm-Message-State:
X-Gm-Gg:X-Received:Received:Message-ID:Date:X-Mailing-List:List-Id:
List-Post:List-Help:List-Subscribe:List-Unsubscribe:List-Owner:
Precedence:MIME-Version:User-Agent:Subject:To:Cc:References:
Content-Language:From:In-Reply-To:Content-Type:
Content-Transfer-Encoding;
bh=Xf7+cxVSKPM2QfTjbLKjCF2toHqdxNlQK1uMknroaKI=;
b=qu0a77sawTgZbtUSwbLk0yuHvdh9uWUCFiQ25Ku7c9WaQ506EN/i8Tpfmizh48MeDVQd
z/oAMoDuVtbY2VL/HrU62/OZfzYXB0M1qxcEs++BsJDiaqv2Shn08ORhVkk/1jnxPZygu
cDShw3QxFIj+xLDsB0vhS7KO9zL1Ekz9elAG9h08cSbFpTMD8YlWatR1/37tEbp44Uyus
/XroqTCVbtnIEuwwE5AEeRoMduSxHu97vhAIKvNEvfpFhUkX71/9XaBC6wahI7c7K9JAE
Ekwor6Ekp7UCOdXK3jOCAQKBH5l70/v03SbU6lWECPip1bTgEKxZf5+198Jt3I5nRcg==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org;
dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b="fIt/ZARi";
dmarc=pass header.from=gmail.com;
spf=pass smtp.mailfrom=gmail.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 9494C606A331;
Tue, 24 Nov 2026 17:43:14 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=fIt/ZARi
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=74.125.82.44
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
t=1795542193;
b=34JMGm/zoRtWPo/i9lUxXcJX4aB30yoWS6/naanTe7v0u5V3VmCucyoqi0MBBVmr/cQj
nOt/jcTboCkUWacAAUoLckvqcgoUrQPmwVv2H0mcd4iIipcxi4nn/iMEhuHiOu0svh0nm
707afUXk7+Fi8luYEQ3vaPFo39eY3sA9BRvKpAh8tjXl9Xm0bS0FD9WPBL7TUhMqYDPDo
g2smULFNqmJrKH9Nt8N0sCALgH1x6E6KP+JlWEb+XJxSngQ232BCFb51XIxJBtmUkzM4o
hI1zKkqFgKDx9qd8WlQ0ixIlL6RBjr4PsrpLoTonBllk2KuySNQNHeClRnrpD2IewUw==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
a=rsa-sha256; c=relaxed/relaxed; t=1795542193;
h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature:
X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received:
Message-ID:Date:MIME-Version:User-Agent:Subject:To:Cc:References:
Content-Language:From:In-Reply-To:Content-Type:
Content-Transfer-Encoding;
bh=Xf7+cxVSKPM2QfTjbLKjCF2toHqdxNlQK1uMknroaKI=;
b=fDtmlIkfHHBKdA35WrAYIbEijYg19sr60M2KD/6XcaTIHL823S2v4ZF7padTYfE/FUGF
0wy55rCZsAwG1P4ZPu25VNCi71+X0HF9pdPLF86Vy04kN/F3CsfXyJ2Ff5DlY9LvnipWS
iKz18VxCLVIRx4SDz2+kBKRaewempE2bMQF3UZRBXKht35nPEIb98cPrhmCwT20s3xm5M
pvR/+Hn4j79hz7J9zXJCb7+8f+URoQxfuOkPlliUxc8a9j9jNQ5E1AYxIOwyNUZ0sLx3O
P6Alb7gGUNuJszDAA+AmucI3z7lKWflWnaylXQqqGsOWlqNuVScxXEu1oWnBNlS4vOA==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org;
dmarc=pass header.from=gmail.com;
spf=pass smtp.mailfrom=gmail.com;
dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b="fIt/ZARi";
arc=none smtp.remote-ip=74.125.82.44
X-Received: from mail-dl1-f44.google.com (mail-dl1-f44.google.com [74.125.82.44])
(using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)
key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256)
(No client certificate requested)
by smtp.subspace.kernel.org (Postfix) with ESMTPS id 650C1606A332
for <netdev@vger.kernel.org>; Tue, 24 Nov 2026 17:43:12 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 650C1606A332
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com
X-Received: by mail-dl1-f44.google.com with SMTP id a92af1059eb24-1b3beeaf6f9so6105199c88.0
for <netdev@vger.kernel.org>; Tue, 24 Nov 2026 09:43:12 -0800 (PST)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=gmail.com; s=20260707; t=1795542192; x=1796146992; darn=vger.kernel.org;
h=content-transfer-encoding:content-type:in-reply-to:from
:content-language:references:cc:to:subject:user-agent:mime-version
:date:message-id:from:to:cc:subject:date:message-id:reply-to
:content-type;
bh=Xf7+cxVSKPM2QfTjbLKjCF2toHqdxNlQK1uMknroaKI=;
b=fIt/ZARideSOcZVprOCE+tjFg0lXYd46179JTXE/7fY8f7P45KZS/17ZNc9Q14PXS4
Uag2WRlSAaSwU4mDrbf/udBd82WEha4JHovzLtvgJIxje0GQulD6UVuSr5WdZ88Yr8Fv
WfhBAZyS5JqkRravt05wVHFJQZB2ErOeBkiRj2BIlFp40vzZjmWobibOeHqiLWUbm1as
a6dPk/osU0kC4ZucvbS/DufuhpxNbKPgkhLaypUcTBUmPxoz+M7dUizOjag9O3bOocs/
wiG40vh5Ys1eybXFcNrFFai1HkEpXeokFRVNP5NNAI27P3hWgZ+UgJxHFglsjPMYlQIA
woxg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20260707; t=1795542192; x=1796146992;
h=content-transfer-encoding:content-type:in-reply-to:from
:content-language:references:cc:to:subject:user-agent:mime-version
:date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
:message-id:reply-to:content-type;
bh=Xf7+cxVSKPM2QfTjbLKjCF2toHqdxNlQK1uMknroaKI=;
b=C5MEXPP7JG6Ky4t6waFxnvvsKrySRXgMYYSrK/cCS/YNojnCBwILADTt80//EEzVXJ
KcoBphfF8dg7sWlvWPJVPmgf2wOJe+kyUy7yPzo8+YDqWv6hSwdo1kYrvdB0IOQgUhcI
8WETDS/oRLgfDa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SClCrnx75BzhbepuwiZhiQldNcVtVd5aIB4Owlo2cA
ccV2Q+FH7kNeXEydL
X-Received: by 2002:a05:701b:4594:10b0:1b5:17c5:9f61 with SMTP id a92af1059eb24-1b55df5ab00mr12145648c88.0.1795542191731;
Tue, 24 Nov 2026 09:43:11 -0800 (PST)
X-Received: from ?IPV6:2a03:83e0:1151:15:c24:4ad9:f660:1904? ([2620:10d:c090:500::4:a974])
by smtp.gmail.com with ESMTPSA id a92af1059eb24-1b5568592adsm35604485c88.15.2026.11.24.09.43.10
(version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
Tue, 24 Nov 2026 09:43:11 -0800 (PST)
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-User-Agent: Mozilla Thunderbird
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: <179552362454.3135.13950803840518714648@kernel.org>