Article View: linux.kernel.netdev
Article #25487Re: [PATCH net v6 4/7] igb: keep the stack's Rx queues that still have an XSK pool
From: netdev-bot+sashiko
Date: Tue, 01 Dec 2026 22:20
Date: Tue, 01 Dec 2026 22:20
109 lines
11870 bytes
11870 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] After this patch, the stack's Rx queue count and igb's ring count
can disagree until the next open.
--
igb: keep the stack's Rx queues that still have an XSK pool
This patch adds igb_set_real_num_queues(). When igb lowers its own queue
counts after a VF enable or an MSI-X to MSI fallback on resume, the helper
keeps the stack's real Rx queue count up to the highest queue that still
has a zero-copy XSK pool. That way the pool can still be found and
disabled, and the count is lowered at the next open.
Closes: https://lore.kernel.org/netdev/xupy6jbpnziq2qji54zjbvm7neggrwkxg3sfrhlolmrd6ysifl@zptk6ynkbu5f/
> diff --git a/drivers/net/ethernet/intel/igb/igb_main.c b/drivers/net/ethernet/intel/igb/igb_main.c
> index 5774a4d3c9810..9752350ffc68b 100644
> --- a/drivers/net/ethernet/intel/igb/igb_main.c
> +++ b/drivers/net/ethernet/intel/igb/igb_main.c
> @@ -4128,6 +4128,29 @@ static int igb_sw_init(struct igb_adapter *adapter)
> return 0;
> }
>
> +/* ethtool refuses to remove a queue that still has an XSK pool. igb can't
> + * refuse when it lowers its queue counts by itself, so keep the stack's Rx
> + * queue instead, or a zero-copy pool couldn't be disabled anymore: lower the
> + * count once it's gone, at the next open.
> + */
> +static int igb_set_real_num_queues(struct igb_adapter *adapter)
> +{
> + struct net_device *netdev = adapter->netdev;
> + unsigned int rxq = adapter->num_rx_queues;
> + struct xsk_buff_pool *pool;
> + unsigned int i;
> +
> + for (i = netdev->real_num_rx_queues; i > rxq; i--) {
> + pool = xsk_get_pool_from_qid(netdev, i - 1);
> + if (pool && pool->umem->zc) {
> + rxq = i;
> + break;
> + }
> + }
> +
> + return netif_set_real_num_queues(netdev, adapter->num_tx_queues, rxq);
[Severity: Low]
Until the next open, can this leave the stack advertising Rx queues that
have no ring behind them?
For example, say a zero-copy pool is bound to queue 2. A VF enable or an
MSI-X to MSI fallback then lowers adapter->num_rx_queues to 1, but
real_num_rx_queues stays at 3. Queue 1 has no ring, yet the stack still
counts it as real.
In that window, a new AF_XDP bind to queue 1 passes the check in
xsk_reg_pool_at_qid():
net/xdp/xsk.c:xsk_reg_pool_at_qid() {
...
if (queue_id >= max(dev->real_num_rx_queues,
dev->real_num_tx_queues))
return -EINVAL;
...
}
With XDP_COPY, xp_assign_dev() returns 0 straight away. With default
flags, ndo_bpf(XDP_SETUP_XSK_POOL) reaches igb_xsk_pool_enable(), which
rejects the queue:
drivers/net/ethernet/intel/igb/igb_xsk.c:igb_xsk_pool_enable() {
...
if (qid >= adapter->num_rx_queues)
return -EINVAL;
...
}
xp_assign_dev() then falls back to copy mode and returns 0.
So the bind succeeds, but the socket never gets any Rx traffic, because no
ring has queue_index 1. On Tx, real_num_tx_queues follows the device, so
__xsk_generic_xmit() skips the socket and returns no error:
net/xdp/xsk.c:__xsk_generic_xmit() {
...
if (xs->queue_id >= xs->dev->real_num_tx_queues)
goto out;
...
}
Before this patch, igb would have lowered real_num_rx_queues to 1 and the
same bind would have failed with -EINVAL.
Is this window intended? Or should binds to queues at or above
adapter->num_rx_queues still be refused while the count is held up?
> +}
> +
[ ... ]
--
Sashiko AI review ยท https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261130213740.3323814-1-antonio%40mandelbit.com
Technical Details
Message-ID:
<179616363905.3146.10706452251262063361@kernel.org>Path:
mbox-mo1.pugleaf.net!srv.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-375380-linux-kernel-netdev=dewy.ruReferences:
<20261130213740.3323814-5-antonio@mandelbit.com>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-375380-linux-kernel-netdev=dewy.ru From: netdev-bot+sashiko@kernel.org Newsgroups: linux.kernel.netdev Subject: Re: [PATCH net v6 4/7] igb: keep the stack's Rx queues that still have an XSK pool Date: Tue, 01 Dec 2026 22:20:39 +0000 Organization: Usenet Network Message-ID: <179616363905.3146.10706452251262063361@kernel.org> References: <20261130213740.3323814-5-antonio@mandelbit.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Injection-Info: usenet.network; logging-data="1831153"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:vRL1h3ZDoPl3RVqSJGbfyBSzFeI= sha256:JT4VImPrOxTdz41vBzz4jAjXOdf0gnjbh3mLtT/dgFk= sha1:aafIDOUXuuK+0JRS//RrF20Wlgg= sha256:/GUVE+nL3AtP1jWde8mNIscfNwJ9YiyZx9Smiy7+XQI= 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 B42781174BD; Wed, 2 Dec 2026 01:21:04 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -3.5 X-Spam-Status: No, score=-3.5 tagged_above=-9999 required=6.31 tests=[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 1zBCsdPSqE07; Wed, 2 Dec 2026 01:21:01 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.105.114; helo=tor.lore.kernel.org; envelope-from=netdev+bounces-375380-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 E9FA01174BB; Wed, 2 Dec 2026 01:20:52 +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 C881728B35; Tue, 1 Dec 2026 22:20:48 +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=1796163642; b=oJ9lYJmHlTVMKbthmYujyWBEqNiY2PLKsI7xL6E3KxPZN5tqzu/dfWdThlDNvlN9+8j0 UGJsMUUbh7Vn8DgWyn1vnBuFk+hY9lhC8QM8w4068KbFr7Kz1LpqHblPINWrj8x7tvSwN uOmiIFvnm+oOG7Rwo6+okn0V2W/H7LriXGfEVbp0CZmic47XdwIHo/TC4lriHq57hbaU+ 2gvecfd53atzUmeKmcunsttZZw4T5sPOUmMr02+2f6k8isPY8/rLZBfC6F2LZUBb2o1Q5 7jt+iuT5jyODsB5rJxfVchORC/+VRgCRIZXKYWgg41sNbTibiY+QpQIBKAAKsvTwZJg== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796163642; 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=sLeTCPjOyXsWO7vn05owofvP6H0LXf/5E0iu3y4Ws4w=; b=Ov625JswceOFxSLxi68Plt7FBW6QvQ6GNjkUku5hA0h5SHjlxeto4IFupnFk+lNHjFKI +W3Zb6ETQMWQe7B2NS3Jkqqv3fRNYR4mfVpA5MzhPccBx68nzYA1j2Iak4MQlvp/FpXyv 0TOHPdNcT1SFxGJBwYbvhaHzGTPt+ONiRwXCIW3lMDhbH/J7fAB6t+fEdAtSAZfO79QXB ZxfpaH7rPgPLkS40U86pbVo6voiyo7g9Ry7B3jRaIGJJZSMmIDBDzoSK7VJZ1vmH2p1Jb uP/TNMP9+SV6AwrOftpW7OaJwZ3UMosSJ3IoQV2ztTytHLwlh6h09vVaALNB+ixSnaQ== 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=Lgyf0DCR; 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 35C7C606A69A; Tue, 1 Dec 2026 22:20:42 +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=Lgyf0DCR 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=1796163641; b=h8ssrH+MHLWi9khk6yRHg95+6+ClczFTGptplA7VRETIrWAxE5EVQKLsFgvMKSjnd1Bb E+sBpjVdofMn+NtsjuE2YSRklHNAm4r3U+utYU0rrcfC3OPDnUE+anN5Zw9fF7GxnYoFZ 4/GaJ/Te5LQpAPuTelxhZyjk6shMnSwwpHxZ8AzGB5uZEYjDvHJoYEzoh2pYRW4yHHYje i2dX2547Vw8bAST1ziL1Gc6ZjMTdH60G2KKdJ+Fk2gzg9oRIt9eMh6WBflcx7+lEMFCbT sikbeT0cpJengYGTpKMr7JzFEv2MtY0H/+7JUo7nhqC558Srxkq7OCNFd19H5meWjCQ== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796163641; 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=sLeTCPjOyXsWO7vn05owofvP6H0LXf/5E0iu3y4Ws4w=; b=PDAMgexrxzIiJxu58CnzdeAUVtmWHWO7qxHcsQF0u/TYCh7kSg/R18ebi3CAC12Zy0YC oaB9K8t77ELoOQAvqcJf1PoHQxFcyhmxW3vu6UtE4wnd5PsO9YmMx65BUxCKzTvLAz91g DnGwsNhm0JNwBaZC6hDa5LJbmveP1ISN6CxYkPnmn/4L/O+soijf+sRbTJMSUHlwFwbQr HgzEi3feRX0N2Y76SXUftyY0GUXWyOo9g2Pzdm1mtiszu0/f9mS1QHFQZxbaqP5w+XmJQ YO8x7kBqejVh3Bx7PKyQneiT5sw1qXYPiyKW2b8Ty/4dBwMNOYoyWdO3KynCj15Hudg== 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=Lgyf0DCR; 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 56011606A684; Tue, 1 Dec 2026 22:20:41 +0000 (UTC) X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7C5CA1F00893; Tue, 1 Dec 2026 22:20:39 +0000 (UTC) X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796163640; bh=sLeTCPjOyXsWO7vn05owofvP6H0LXf/5E0iu3y4Ws4w=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=Lgyf0DCRluPxNZsgwC5LrYf9mN8MrSafYzcNJIjLai5XG5YQOTWk+b+mYJNK62HFU h1OpyLVy8b1X6HFJCmHuUZcOB8qeB/dNdqm/fqX8Nn3/qYXOwyfTA6PHem2nmk/lNY DrjkqZbDCR+f4+PTqb1sYXdgALcL4rpbXE/+oGPGYg9o1P694sE/CMShXDMuI2cYi/ VYRRjVdKOiw5e7MouQQDkGROjdYETMgIoWQtXObwBuqaXZwvNySBnMy4dUTiKw3NL/ lO5pwWO7AQvCUt9S4Fv5oSW1cjAZT1seeto55cQkzYCQWdGq63H0bX4UjsApFRqf7U L6Dl/FLiINsEg== X-Cc: intel-wired-lan@lists.osuosl.org, anthony.l.nguyen@intel.com, przemyslaw.kitszel@intel.com, andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@kernel.org, kuba@kernel.org, pabeni@redhat.com, janislacis06@gmail.com, ast@kernel.org, daniel@iogearbox.net, hawk@kernel.org, john.fastabend@gmail.com, sdf@fomichev.me, sriram.yagnaraman@ericsson.com, kurt@linutronix.de, maciej.fijalkowski@intel.com, hkallweit1@gmail.com, joe@dama.to, rafael@kernel.org, sven.auhagen@voleatech.de, netdev@vger.kernel.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, bpf@vger.kernel.org, stable@vger.kernel.org X-In-Reply-To: <20261130213740.3323814-5-antonio@mandelbit.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