From: netdev-bot+sashiko@kernel.org
To: antonio@mandelbit.com
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, kurt@linutronix.de,
joe@dama.to, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org, stable@vger.kernel.org
Subject: Re: [PATCH net v5 3/6] igb: keep the stack's Rx queues that still have an XSK pool
Date: Sun, 29 Nov 2026 00:37:07 +0000 [thread overview]
Message-ID: <179591262735.3135.13991879696193077438@kernel.org> (raw)
In-Reply-To: <20261124235723.1135808-4-antonio@mandelbit.com>
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] igb_set_real_num_queues()
(drivers/net/ethernet/intel/igb/igb_main.c) keeps…
--
igb: keep the stack's Rx queues that still have an XSK pool
When igb lowers its own queue counts (an MSI fallback on resume, or a VF
enable), this patch keeps netdev->real_num_rx_queues up to the highest
queue that still has an XSK pool. That way the pool can still be found
and disabled. The count is lowered again 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 6b299a1429a8e..47a92447aab27 100644
> --- a/drivers/net/ethernet/intel/igb/igb_main.c
> +++ b/drivers/net/ethernet/intel/igb/igb_main.c
> @@ -4125,6 +4125,26 @@ 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 the 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;
> + unsigned int i;
> +
> + for (i = netdev->real_num_rx_queues; i > rxq; i--)
> + if (xsk_get_pool_from_qid(netdev, i - 1)) {
> + rxq = i;
> + break;
> + }
[Severity: Low]
Should this loop only keep queues whose pool is in zero-copy mode?
As written, any registered pool keeps the count up, including copy-mode
(XDP_COPY) pools. The comment above gives one reason for keeping the
queue: otherwise the pool couldn't be disabled. That reason only seems to
apply to zero-copy pools:
net/xdp/xsk_buff_pool.c:xp_disable_drv_zc() {
...
if (pool->umem->zc) {
bpf.command = XDP_SETUP_XSK_POOL;
...
}
A copy-mode pool on a removed queue is cleared by
__xsk_clear_pool_at_qid(). That function walks dev->_rx[] and dev->_tx[]
up to the allocated num_rx_queues and num_tx_queues, so the extra queues
were not needed for that case before this patch.
This case also looks easy to reach. igb only sets the real queue counts
through this helper, so before the first open real_num_rx_queues is still
16 from alloc_etherdev_mq(..., IGB_MAX_TX_QUEUES) in igb_probe(). While
the device is down, xsk_reg_pool_at_qid() accepts any qid below 16.
igb_xsk_pool_enable() rejects a zero-copy bind on such a queue:
if (qid >= adapter->num_rx_queues)
return -EINVAL;
If neither XDP_ZEROCOPY nor XDP_COPY is requested, xp_assign_dev() falls
back to copy mode and leaves the pool registered at that qid. An explicit
XDP_COPY bind skips the driver entirely.
On the next __igb_open(), or after a VF enable or MSI fallback with only a
copy-mode socket on a removed queue, this loop finds that pool and calls
netif_set_real_num_queues(netdev, num_tx_queues, qid + 1). The stack would
then report RX queues that have no hardware ring (rx-N sysfs entries and
netdev-genl queue dumps) until the socket is closed and the device is
reopened.
Would checking pool->umem->zc here limit the behavior to the case
described in the commit message and the comment?
> +
> + return netif_set_real_num_queues(netdev, adapter->num_tx_queues, rxq);
> +}
> +
[ ... ]
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261124235723.1135808-1-antonio%40mandelbit.com
next prev parent reply other threads:[~2026-11-29 0:37 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-24 23:57 [PATCH net v5 0/6] igb: fix runtime PM resume issues Antonio Quartulli
2026-11-24 23:57 ` [PATCH net v5 1/6] igb: don't touch rings that don't exist when disabling an XSK pool Antonio Quartulli
2026-11-28 13:36 ` Janis Edvarts Lacis
2026-11-29 0:37 ` netdev-bot+sashiko
2026-11-24 23:57 ` [PATCH net v5 2/6] igb: fix RTNL assertion when resuming from runtime suspend Antonio Quartulli
2026-11-28 13:37 ` Janis Edvarts Lacis
2026-11-29 0:37 ` netdev-bot+sashiko
2026-11-24 23:57 ` [PATCH net v5 3/6] igb: keep the stack's Rx queues that still have an XSK pool Antonio Quartulli
2026-11-28 13:37 ` Janis Edvarts Lacis
2026-11-29 0:37 ` netdev-bot+sashiko [this message]
2026-11-24 23:57 ` [PATCH net v5 4/6] igb: link queues to NAPIs under RTNL after runtime resume Antonio Quartulli
2026-11-28 13:38 ` Janis Edvarts Lacis
2026-11-24 23:57 ` [PATCH net v5 5/6] igb: resume the device before changing XDP or XSK settings Antonio Quartulli
2026-11-28 13:38 ` Janis Edvarts Lacis
2026-11-29 0:37 ` netdev-bot+sashiko
2026-11-24 23:57 ` [PATCH net v5 6/6] igb: only allow runtime PM if the device can wake up Antonio Quartulli
2026-11-28 13:40 ` Janis Edvarts Lacis
2026-11-28 13:32 ` [PATCH net v5 0/6] igb: fix runtime PM resume issues Janis Edvarts Lacis
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=179591262735.3135.13991879696193077438@kernel.org \
--to=netdev-bot+sashiko@kernel.org \
--cc=andrew+netdev@lunn.ch \
--cc=anthony.l.nguyen@intel.com \
--cc=antonio@mandelbit.com \
--cc=davem@davemloft.net \
--cc=edumazet@kernel.org \
--cc=intel-wired-lan@lists.osuosl.org \
--cc=janislacis06@gmail.com \
--cc=joe@dama.to \
--cc=kuba@kernel.org \
--cc=kurt@linutronix.de \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=przemyslaw.kitszel@intel.com \
--cc=stable@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox