From: netdev-bot+sashiko@kernel.org
To: anthony.l.nguyen@intel.com
Cc: davem@davemloft.net, kuba@kernel.org, pabeni@redhat.com,
edumazet@kernel.org, andrew+netdev@lunn.ch,
netdev@vger.kernel.org, luoxuanqiang@kylinos.cn,
mheib@redhat.com, fballuch@redhat.com,
aleksandr.loktionov@intel.com, richardcochran@gmail.com,
saikrishnag@marvell.com, stable@vger.kernel.org,
vadim.fedorenko@linux.dev, jacob.e.keller@intel.com,
rafal.romanowski@intel.com
Subject: Re: [PATCH net 3/6] i40e: avoid resetting BQL state when freeing temporary Tx rings in set_ringparam
Date: Tue, 17 Nov 2026 00:47:50 +0000 [thread overview]
Message-ID: <179487647012.3136.17665986611017849845@kernel.org> (raw)
In-Reply-To: <20261113004602.129864-4-anthony.l.nguyen@intel.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] The commit message names the wrong function for the idiom it says
it copies.
Pre-existing issues:
- [High] This problem wasn't introduced by this patch, but the same bug
exists in the sibling ice driver and this series leaves it unfixed.
--
i40e: avoid resetting BQL state when freeing temporary Tx rings in set_ringparam
i40e_set_ringparam() builds temporary Tx rings as struct copies of the
live rings, so the copies share netdev and queue_index with them. When an
error path frees these copies before i40e_down(), the BQL state of the
live queue gets reset. That can trip the BUG_ON in dql_completed(). The
patch clears netdev on each copy before i40e_free_tx_resources() in both
error paths, so i40e_clean_tx_ring() skips netdev_tx_reset_queue().
> This mirrors the
> same idiom i40e already uses for XDP Tx rings, which also have no
> netdev_queue of their own (ring->netdev = NULL in i40e_vsi_setup_tx()).
[Severity: Low]
This isn't a bug, but is i40e_vsi_setup_tx() the right function name
here? There's no function with that name in the i40e driver.
i40e_vsi_setup_tx_resources() is the closest match, and it doesn't touch
ring->netdev.
The XDP Tx ring assignment appears to be in i40e_alloc_rings() in
i40e_main.c:
if (!i40e_enabled_xdp_vsi(vsi))
goto setup_rx;
ring->queue_index = vsi->alloc_queue_pairs + i;
...
ring->netdev = NULL;
...
set_ring_xdp(ring);
Could the commit message point to i40e_alloc_rings() instead?
> diff --git a/drivers/net/ethernet/intel/i40e/i40e_ethtool.c b/drivers/net/ethernet/intel/i40e/i40e_ethtool.c
> index ef756487d6684..58d842d676422 100644
> --- a/drivers/net/ethernet/intel/i40e/i40e_ethtool.c
> +++ b/drivers/net/ethernet/intel/i40e/i40e_ethtool.c
[ ... ]
> @@ -2248,8 +2250,11 @@ static int i40e_set_ringparam(struct net_device *netdev,
> /* error cleanup if the Rx allocations failed after getting Tx */
> if (tx_rings) {
> for (i = 0; i < tx_alloc_queue_pairs; i++) {
> - if (i40e_active_tx_ring_index(vsi, i))
> + if (i40e_active_tx_ring_index(vsi, i)) {
> + /* not live yet, skip its BQL reset on free */
> + tx_rings[i].netdev = NULL;
> i40e_free_tx_resources(&tx_rings[i]);
> + }
> }
> kfree(tx_rings);
> tx_rings = NULL;
[Severity: High]
This is a pre-existing issue, not one introduced by this patch. Does the
sibling ice driver have the same problem in ice_set_ringparam() in
drivers/net/ethernet/intel/ice/ice_ethtool.c?
There, each temporary Tx ring is also a struct copy of the live ring, so
it keeps the live netdev and q_index:
ice_for_each_txq(vsi, i) {
/* clone ring and setup updated count */
tx_rings[i] = *vsi->tx_rings[i];
tx_rings[i].count = new_tx_cnt;
tx_rings[i].desc = NULL;
tx_rings[i].tx_buf = NULL;
...
err = ice_setup_tx_ring(&tx_rings[i]);
if (err) {
while (i--)
ice_clean_tx_ring(&tx_rings[i]);
kfree(tx_rings);
goto done;
}
The free_xdp/free_tx labels are reached when the XDP ring setup, the Rx
kzalloc or ice_setup_rx_ring() fails. They also clean the copies before
ice_down() has run:
/* error cleanup if the Rx allocations failed after getting Tx */
if (tx_rings) {
ice_for_each_txq(vsi, i)
ice_free_tx_ring(&tx_rings[i]);
kfree(tx_rings);
}
ice_free_tx_ring() calls ice_clean_tx_ring() in ice_txrx.c. That function
only skips the BQL reset when netdev is NULL:
if (!tx_ring->netdev)
return;
/* cleanup Tx queue statistics */
netdev_tx_reset_queue(txring_txq(tx_ring));
txring_txq() resolves to netdev_get_tx_queue(ring->netdev, ring->q_index).
For a copy, that is the live netdev_queue.
Consider ethtool -G on a running ice interface, under memory pressure,
with Tx traffic in flight. If one of those allocations fails, can the next
netdev_tx_completed_queue() from ice_clean_tx_irq() hit this check in
dql_completed()?
BUG_ON(count > num_queued - dql->num_completed);
That would be the same panic the commit message describes for i40e.
Nothing in this series touches drivers/net/ethernet/intel/ice/.
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261113004602.129864-1-anthony.l.nguyen%40intel.com
next prev parent reply other threads:[~2026-11-17 0:47 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-13 0:45 [PATCH net 0/6][pull request] Intel Wired LAN Driver Updates 2026-11-12 (i40e, iavf) Tony Nguyen
2026-11-13 0:45 ` [PATCH net 1/6] i40e: fix napi_disable hang in i40e_down() during firmware update Tony Nguyen
2026-11-17 0:47 ` netdev-bot+sashiko
2026-11-13 0:45 ` [PATCH net 2/6] i40e: fix freeing of TX rings on RX allocation failure Tony Nguyen
2026-11-13 0:45 ` [PATCH net 3/6] i40e: avoid resetting BQL state when freeing temporary Tx rings in set_ringparam Tony Nguyen
2026-11-17 0:47 ` netdev-bot+sashiko [this message]
2026-11-13 0:45 ` [PATCH net 4/6] iavf: fix QoS capabilities memory leak Tony Nguyen
2026-11-13 0:45 ` [PATCH net 5/6] iavf: fix ASQ command buffer leak on init failure Tony Nguyen
2026-11-13 0:46 ` [PATCH net 6/6] iavf: add missing PTP adjustment callbacks Tony Nguyen
2026-11-13 0:52 ` [PATCH net 0/6][pull request] Intel Wired LAN Driver Updates 2026-11-12 (i40e, iavf) netdev-bot+sinfo
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=179487647012.3136.17665986611017849845@kernel.org \
--to=netdev-bot+sashiko@kernel.org \
--cc=aleksandr.loktionov@intel.com \
--cc=andrew+netdev@lunn.ch \
--cc=anthony.l.nguyen@intel.com \
--cc=davem@davemloft.net \
--cc=edumazet@kernel.org \
--cc=fballuch@redhat.com \
--cc=jacob.e.keller@intel.com \
--cc=kuba@kernel.org \
--cc=luoxuanqiang@kylinos.cn \
--cc=mheib@redhat.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=rafal.romanowski@intel.com \
--cc=richardcochran@gmail.com \
--cc=saikrishnag@marvell.com \
--cc=stable@vger.kernel.org \
--cc=vadim.fedorenko@linux.dev \
/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