* [PATCH net 0/6][pull request] Intel Wired LAN Driver Updates 2026-11-12 (i40e, iavf)
@ 2026-11-13 0:45 Tony Nguyen
2026-11-13 0:45 ` [PATCH net 1/6] i40e: fix napi_disable hang in i40e_down() during firmware update Tony Nguyen
` (6 more replies)
0 siblings, 7 replies; 10+ messages in thread
From: Tony Nguyen @ 2026-11-13 0:45 UTC (permalink / raw)
To: davem, kuba, pabeni, edumazet, andrew+netdev, netdev
Cc: Tony Nguyen, mheib, fballuch, aleksandr.loktionov, luoxuanqiang
For i40e:
Mohammad Heib adds missing set of VSI down bit prior to calling
i40e_down() as is expected by the call.
Filip Balluch fixes incorrectly provided Tx rings in error path of
i40e_set_ringparam().
Alex further fixes the error path clearing the netdev from temporary
Tx ring's before it's freed.
For iavf:
Xuanqiang Luo fixes a couple of memory leaks and prevents NULL
pointer dereferences by implementing missing PTP callbacks.
The following are changes since commit bbcd02741c4cfbf9e1c59b1906f21ef772bd15eb:
net: mana: report RX checksum offload for IPv6
and are available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/net-queue 40GbE
Aleksandr Loktionov (1):
i40e: avoid resetting BQL state when freeing temporary Tx rings in
set_ringparam
Filip Balluch (1):
i40e: fix freeing of TX rings on RX allocation failure
Mohammad Heib (1):
i40e: fix napi_disable hang in i40e_down() during firmware update
Xuanqiang Luo (3):
iavf: fix QoS capabilities memory leak
iavf: fix ASQ command buffer leak on init failure
iavf: add missing PTP adjustment callbacks
drivers/net/ethernet/intel/i40e/i40e_ethtool.c | 9 +++++++--
drivers/net/ethernet/intel/i40e/i40e_main.c | 2 ++
drivers/net/ethernet/intel/iavf/iavf_adminq.c | 1 +
drivers/net/ethernet/intel/iavf/iavf_main.c | 1 +
drivers/net/ethernet/intel/iavf/iavf_ptp.c | 12 ++++++++++++
5 files changed, 23 insertions(+), 2 deletions(-)
--
2.47.1
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH net 1/6] i40e: fix napi_disable hang in i40e_down() during firmware update
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 ` 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
` (5 subsequent siblings)
6 siblings, 1 reply; 10+ messages in thread
From: Tony Nguyen @ 2026-11-13 0:45 UTC (permalink / raw)
To: davem, kuba, pabeni, edumazet, andrew+netdev, netdev
Cc: Mohammad Heib, anthony.l.nguyen, fballuch, aleksandr.loktionov,
luoxuanqiang, jbrandeb, Joe Damato, Alexander Nowlin
From: Mohammad Heib <mheib@redhat.com>
i40e_down() expects its caller to set __I40E_VSI_DOWN before calling it,
as noted in the comment at the top of the function. All callers do this
except i40e_vsi_reinit_locked(), which calls i40e_down() directly
without setting the flag.
Normally this doesn't cause problems because NAPI drains cleanly on its
own. But when the hardware is in a bad state, like during an NVM
firmware update, the ring descriptors can contain garbage that
i40e_napi_poll() sees as real work. Since __I40E_VSI_DOWN isn't set, the
poll function has no reason to bail out. It keeps returning budget,
napi_disable() keeps waiting, and the whole thing hangs. The thread
stuck in napi_disable() is usually NetworkManager, and because it holds
the RTNL lock, the system can end up completely frozen.
Set __I40E_VSI_DOWN in i40e_vsi_reinit_locked() before calling
i40e_down(). i40e_up_complete() already clears the flag when the VSI
comes back up, so no additional cleanup is needed.
Fixes: 41c445ff0f48 ("i40e: main driver core")
Signed-off-by: Mohammad Heib <mheib@redhat.com>
Reviewed-by: Joe Damato <joe@dama.to>
Tested-by: Alexander Nowlin <alexander.nowlin@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
---
drivers/net/ethernet/intel/i40e/i40e_main.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c
index abbc71e815ae..dd729776c64d 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_main.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
@@ -7461,6 +7461,8 @@ static void i40e_vsi_reinit_locked(struct i40e_vsi *vsi)
while (test_and_set_bit(__I40E_CONFIG_BUSY, pf->state))
usleep_range(1000, 2000);
+ /* required by i40e_down() */
+ set_bit(__I40E_VSI_DOWN, vsi->state);
i40e_down(vsi);
i40e_up(vsi);
--
2.47.1
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH net 2/6] i40e: fix freeing of TX rings on RX allocation failure
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-13 0:45 ` 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
` (4 subsequent siblings)
6 siblings, 0 replies; 10+ messages in thread
From: Tony Nguyen @ 2026-11-13 0:45 UTC (permalink / raw)
To: davem, kuba, pabeni, edumazet, andrew+netdev, netdev
Cc: Filip Balluch, anthony.l.nguyen, mheib, aleksandr.loktionov,
luoxuanqiang, bjorn, Alexander Nowlin
From: Filip Balluch <fballuch@redhat.com>
When ethtool -G is used to change ring buffer sizes while the interface is
up, i40e_set_ringparam() allocates temporary TX and RX rings. If the RX
ring allocation fails, the error path at the free_tx label incorrectly
calls i40e_free_tx_resources(vsi->tx_rings[i]), freeing the live TX rings
instead of the temporary tx_rings[i].
Since the interface is still up, the next TX completion interrupt causes
i40e_clean_tx_irq() to dereference the freed ring descriptors, resulting in
a NULL pointer dereference in IRQ context and a kernel panic.
This can be reproduced on systems with Intel X710 NICs under memory
pressure, where the second port's DMA allocation fails after the first port
succeeds.
Fix by freeing the temporary tx_rings[i] in the error path instead of
the live vsi->tx_rings[i].
Fixes: 74608d17fe29 ("i40e: add support for XDP_TX action")
Signed-off-by: Filip Balluch <fballuch@redhat.com>
Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
Tested-by: Alexander Nowlin <alexander.nowlin@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
---
drivers/net/ethernet/intel/i40e/i40e_ethtool.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/intel/i40e/i40e_ethtool.c b/drivers/net/ethernet/intel/i40e/i40e_ethtool.c
index 6a992df06fa1..ef756487d668 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_ethtool.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_ethtool.c
@@ -2249,7 +2249,7 @@ static int i40e_set_ringparam(struct net_device *netdev,
if (tx_rings) {
for (i = 0; i < tx_alloc_queue_pairs; i++) {
if (i40e_active_tx_ring_index(vsi, i))
- i40e_free_tx_resources(vsi->tx_rings[i]);
+ i40e_free_tx_resources(&tx_rings[i]);
}
kfree(tx_rings);
tx_rings = NULL;
--
2.47.1
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH net 3/6] i40e: avoid resetting BQL state when freeing temporary Tx rings in set_ringparam
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-13 0:45 ` [PATCH net 2/6] i40e: fix freeing of TX rings on RX allocation failure Tony Nguyen
@ 2026-11-13 0:45 ` Tony Nguyen
2026-11-17 0:47 ` netdev-bot+sashiko
2026-11-13 0:45 ` [PATCH net 4/6] iavf: fix QoS capabilities memory leak Tony Nguyen
` (3 subsequent siblings)
6 siblings, 1 reply; 10+ messages in thread
From: Tony Nguyen @ 2026-11-13 0:45 UTC (permalink / raw)
To: davem, kuba, pabeni, edumazet, andrew+netdev, netdev
Cc: Aleksandr Loktionov, anthony.l.nguyen, mheib, fballuch,
luoxuanqiang, jbrandeb, stable, Alexander Nowlin
From: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
Temporary Tx rings built by i40e_set_ringparam() while resizing
descriptor counts are shallow struct copies of the live vsi->tx_rings[]
entries, so they retain the same ring->netdev and ring->queue_index as
the live ring they are staged to replace.
If an error path frees one of these clones with
i40e_free_tx_resources() before i40e_down() has run - either the
i40e_setup_tx_descriptors() failure unwind loop, or the free_tx: error
label - i40e_clean_tx_ring() will call netdev_tx_reset_queue() on
txring_txq(tx_ring), which resolves to the *same* netdev_queue as the
live ring because netdev/queue_index alias. That call resets the
queue's BQL/dql state (dql_reset(): num_queued = num_completed = 0)
while the live ring is still actively transmitting and completing
Tx on that same queue.
The next time the live ring reports completions for bytes that were
queued before the reset, dql_completed() can underflow its own
sanity check and hit:
BUG_ON(count > num_queued - dql->num_completed);
i.e. a guaranteed kernel panic, not just a warning, given a queue with
outstanding (queued but not yet completed) Tx traffic at the moment
the clone is freed.
Reproduced on real hardware by forcing i40e_setup_tx_descriptors() to
fail partway through building tx_rings[] while flooding real Tx
traffic on the affected queues:
kernel BUG at lib/dynamic_queue_limits.c:99!
RIP: 0010:dql_completed+0x285/0x2a0
Call Trace:
<IRQ>
i40e_napi_poll+0x74b/0x1700 [i40e]
__napi_poll+0x10a/0x200
net_rx_action+0x2f7/0x380
handle_softirqs+0xcc/0x270
Confirmed the same trigger no longer panics with this fix applied,
including repeated resize/traffic cycles.
Clear the clone ring netdev before freeing it in both error paths, so
i40e_clean_tx_ring()'s existing `if (!tx_ring->netdev) return;` guard
skips the netdev_tx_reset_queue() call for the clone. 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()).
Only the temporary, about-to-be-freed clone is touched; the live ring
in vsi->tx_rings[] keeps its netdev.
Fixes: 9f65e15b4f98 ("i40e: Move rings from pointer to array to array of pointers")
Cc: stable@vger.kernel.org
Signed-off-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
Tested-by: Alexander Nowlin <alexander.nowlin@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
---
drivers/net/ethernet/intel/i40e/i40e_ethtool.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/intel/i40e/i40e_ethtool.c b/drivers/net/ethernet/intel/i40e/i40e_ethtool.c
index ef756487d668..58d842d67642 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_ethtool.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_ethtool.c
@@ -2143,6 +2143,8 @@ static int i40e_set_ringparam(struct net_device *netdev,
i--;
if (!i40e_active_tx_ring_index(vsi, i))
continue;
+ /* not live yet, skip its BQL reset on free */
+ tx_rings[i].netdev = NULL;
i40e_free_tx_resources(&tx_rings[i]);
}
kfree(tx_rings);
@@ -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;
--
2.47.1
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH net 4/6] iavf: fix QoS capabilities memory leak
2026-11-13 0:45 [PATCH net 0/6][pull request] Intel Wired LAN Driver Updates 2026-11-12 (i40e, iavf) Tony Nguyen
` (2 preceding siblings ...)
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-13 0:45 ` Tony Nguyen
2026-11-13 0:45 ` [PATCH net 5/6] iavf: fix ASQ command buffer leak on init failure Tony Nguyen
` (2 subsequent siblings)
6 siblings, 0 replies; 10+ messages in thread
From: Tony Nguyen @ 2026-11-13 0:45 UTC (permalink / raw)
To: davem, kuba, pabeni, edumazet, andrew+netdev, netdev
Cc: Xuanqiang Luo, anthony.l.nguyen, mheib, fballuch,
aleksandr.loktionov, jiri, stable, Jedrzej Jagielski
From: Xuanqiang Luo <luoxuanqiang@kylinos.cn>
Commit 4c1a457cb8b0 ("iavf: add support to exchange qos capabilities")
allocates adapter->qos_caps during probe, but iavf_remove() does not
free it. This leaks the allocation whenever an iavf device is removed.
Free adapter->qos_caps in iavf_remove().
Fixes: 4c1a457cb8b0 ("iavf: add support to exchange qos capabilities")
Cc: stable@vger.kernel.org
Reviewed-by: Jedrzej Jagielski <jedrzej.jagielski@intel.com>
Signed-off-by: Xuanqiang Luo <luoxuanqiang@kylinos.cn>
Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
---
drivers/net/ethernet/intel/iavf/iavf_main.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/net/ethernet/intel/iavf/iavf_main.c b/drivers/net/ethernet/intel/iavf/iavf_main.c
index 2f8a80a11336..4de3ea8525b3 100644
--- a/drivers/net/ethernet/intel/iavf/iavf_main.c
+++ b/drivers/net/ethernet/intel/iavf/iavf_main.c
@@ -5638,6 +5638,7 @@ static void iavf_remove(struct pci_dev *pdev)
iounmap(hw->hw_addr);
pci_release_regions(pdev);
kfree(adapter->vf_res);
+ kfree(adapter->qos_caps);
spin_lock_bh(&adapter->mac_vlan_list_lock);
/* If we got removed before an up/down sequence, we've got a filter
* hanging out there that we need to get rid of.
--
2.47.1
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH net 5/6] iavf: fix ASQ command buffer leak on init failure
2026-11-13 0:45 [PATCH net 0/6][pull request] Intel Wired LAN Driver Updates 2026-11-12 (i40e, iavf) Tony Nguyen
` (3 preceding siblings ...)
2026-11-13 0:45 ` [PATCH net 4/6] iavf: fix QoS capabilities memory leak Tony Nguyen
@ 2026-11-13 0:45 ` 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
6 siblings, 0 replies; 10+ messages in thread
From: Tony Nguyen @ 2026-11-13 0:45 UTC (permalink / raw)
To: davem, kuba, pabeni, edumazet, andrew+netdev, netdev
Cc: Xuanqiang Luo, anthony.l.nguyen, mheib, fballuch,
aleksandr.loktionov, stable, Jedrzej Jagielski
From: Xuanqiang Luo <luoxuanqiang@kylinos.cn>
iavf_alloc_adminq_asq_ring() allocates cmd_buf before the remaining ASQ
resources. If iavf_alloc_asq_bufs() or iavf_config_asq_regs() fails, the
unwind path elides cmd_buf while freeing the other allocations.
The ASQ count is not set until initialization succeeds, so the shutdown
path cannot reclaim the buffer. Free cmd_buf in the common unwind path.
Fixes: d358aa9a7a2d ("i40evf: init code and hardware support")
Cc: stable@vger.kernel.org
Signed-off-by: Xuanqiang Luo <luoxuanqiang@kylinos.cn>
Reviewed-by: Jedrzej Jagielski <jedrzej.jagielski@intel.com>
Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
---
drivers/net/ethernet/intel/iavf/iavf_adminq.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/net/ethernet/intel/iavf/iavf_adminq.c b/drivers/net/ethernet/intel/iavf/iavf_adminq.c
index 6937b7dd44cb..40f76f9507f4 100644
--- a/drivers/net/ethernet/intel/iavf/iavf_adminq.c
+++ b/drivers/net/ethernet/intel/iavf/iavf_adminq.c
@@ -60,6 +60,7 @@ static enum iavf_status iavf_alloc_adminq_arq_ring(struct iavf_hw *hw)
**/
static void iavf_free_adminq_asq(struct iavf_hw *hw)
{
+ iavf_free_virt_mem(hw, &hw->aq.asq.cmd_buf);
iavf_free_dma_mem(hw, &hw->aq.asq.desc_buf);
}
--
2.47.1
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH net 6/6] iavf: add missing PTP adjustment callbacks
2026-11-13 0:45 [PATCH net 0/6][pull request] Intel Wired LAN Driver Updates 2026-11-12 (i40e, iavf) Tony Nguyen
` (4 preceding siblings ...)
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 ` 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
6 siblings, 0 replies; 10+ messages in thread
From: Tony Nguyen @ 2026-11-13 0:46 UTC (permalink / raw)
To: davem, kuba, pabeni, edumazet, andrew+netdev, netdev
Cc: Xuanqiang Luo, anthony.l.nguyen, mheib, fballuch,
aleksandr.loktionov, richardcochran, saikrishnag, stable,
Vadim Fedorenko, Jacob Keller, Rafal Romanowski
From: Xuanqiang Luo <luoxuanqiang@kylinos.cn>
The PTP hardware clock documentation requires drivers to implement all
callbacks and return -EOPNOTSUPP for unsupported features.
The iavf driver registers a PHC without adjtime or adjfine callbacks.
A userspace clock_adjtime(2) request reaches ptp_clock_adjtime(), where
ADJ_SETOFFSET calls adjtime and ADJ_FREQUENCY calls adjfine. The missing
callbacks can therefore cause a NULL dereference.
Provide both callbacks and return -EOPNOTSUPP for the unsupported
operations.
Fixes: d734223b2f0d ("iavf: add initial framework for registering PTP clock")
Link: https://docs.kernel.org/driver-api/ptp.html#writing-clock-drivers
Link: https://lore.kernel.org/all/20260826101004.100979-1-xuanqiang.luo@linux.dev/
Cc: stable@vger.kernel.org
Signed-off-by: Xuanqiang Luo <luoxuanqiang@kylinos.cn>
Reviewed-by: Vadim Fedorenko <vadim.fedorenko@linux.dev>
Acked-by: Jacob Keller <jacob.e.keller@intel.com>
Tested-by: Rafal Romanowski <rafal.romanowski@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
---
drivers/net/ethernet/intel/iavf/iavf_ptp.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/drivers/net/ethernet/intel/iavf/iavf_ptp.c b/drivers/net/ethernet/intel/iavf/iavf_ptp.c
index 87b97e09df14..fcb273828bc1 100644
--- a/drivers/net/ethernet/intel/iavf/iavf_ptp.c
+++ b/drivers/net/ethernet/intel/iavf/iavf_ptp.c
@@ -252,6 +252,16 @@ static int iavf_ptp_gettimex64(struct ptp_clock_info *info,
return iavf_read_phc_indirect(adapter, ts, sts);
}
+static int iavf_ptp_adjfine(struct ptp_clock_info *info, long scaled_ppm)
+{
+ return -EOPNOTSUPP;
+}
+
+static int iavf_ptp_adjtime(struct ptp_clock_info *info, s64 delta)
+{
+ return -EOPNOTSUPP;
+}
+
static int iavf_ptp_settime64(struct ptp_clock_info *info,
const struct timespec64 *ts)
{
@@ -326,6 +336,8 @@ static int iavf_ptp_register_clock(struct iavf_adapter *adapter)
KBUILD_MODNAME, dev_name(dev));
ptp_info->owner = THIS_MODULE;
ptp_info->gettimex64 = iavf_ptp_gettimex64;
+ ptp_info->adjfine = iavf_ptp_adjfine;
+ ptp_info->adjtime = iavf_ptp_adjtime;
ptp_info->settime64 = iavf_ptp_settime64;
ptp_info->do_aux_work = iavf_ptp_do_aux_work;
--
2.47.1
^ permalink raw reply related [flat|nested] 10+ messages in thread
* Re: [PATCH net 0/6][pull request] Intel Wired LAN Driver Updates 2026-11-12 (i40e, iavf)
2026-11-13 0:45 [PATCH net 0/6][pull request] Intel Wired LAN Driver Updates 2026-11-12 (i40e, iavf) Tony Nguyen
` (5 preceding siblings ...)
2026-11-13 0:46 ` [PATCH net 6/6] iavf: add missing PTP adjustment callbacks Tony Nguyen
@ 2026-11-13 0:52 ` netdev-bot+sinfo
6 siblings, 0 replies; 10+ messages in thread
From: netdev-bot+sinfo @ 2026-11-13 0:52 UTC (permalink / raw)
To: Tony Nguyen
Cc: davem, kuba, pabeni, edumazet, andrew+netdev, netdev, mheib,
fballuch, aleksandr.loktionov, luoxuanqiang
Hi!
This is an automated message. This series looks like a fix, but its
commit messages seem to be missing some information:
- How the issue was discovered, e.g. hit in production, hit during
development, syzbot report, manual code inspection, LLM or static
analysis tool scan.
- Whether the issue was actually triggered, or is only theoretical
(e.g. found by LLM and not proven at runtime). If it was triggered
please include the symptoms, like the stack trace or kernel messages.
- What hardware the change was tested on. For driver fixes please
mention the device (and if relevant firmware version) used for
testing, or say that the change was not tested on real hardware.
Please do not repost the series just to address the above. Instead,
reply to this email with the missing information, so that reviewers
can take it into account. If the series needs another revision for
other reasons, please include the information in the commit messages
then.
The evaluation is done by an LLM so it may be wrong, if you think
that is the case please reply and explain.
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH net 1/6] i40e: fix napi_disable hang in i40e_down() during firmware update
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
0 siblings, 0 replies; 10+ messages in thread
From: netdev-bot+sashiko @ 2026-11-17 0:47 UTC (permalink / raw)
To: anthony.l.nguyen
Cc: davem, kuba, pabeni, edumazet, andrew+netdev, netdev,
luoxuanqiang, mheib, fballuch, aleksandr.loktionov,
richardcochran, saikrishnag, stable, vadim.fedorenko,
jacob.e.keller, rafal.romanowski
Thank you for your contribution! Sashiko AI review found 2 potential
issue(s) to consider.
Critical: 0 · High: 2 (1) · Medium: 0 · Low: 0
If you believe none of the issues are legitimate, please reply to each
issue of Medium severity or higher and explain why the AI is wrong.
If any of them are legitimate and you plan to respin, please let patchwork
know by including "pw-bot: cr" as a separate line at the end of your reply
(one such reply per series is enough).
- [High] The fix is incomplete and the commit message gets the root cause
wrong.
- [High] The patch adds an unconditional set_bit(__I40E_VSI_DOWN) in
i40e_vsi_reinit_locked() and still ignores the return value of…
Pre-existing issues:
- [High] This problem wasn't introduced by this patch, but
i40e_vsi_reinit_locked() calls i40e_down() unconditionally, even when…
--
i40e: fix napi_disable hang in i40e_down() during firmware update
This patch sets __I40E_VSI_DOWN in i40e_vsi_reinit_locked() before it
calls i40e_down(). With the bit set, i40e_napi_poll() bails out and
napi_disable() can complete when the rings hold garbage during an NVM
update.
> i40e_down() expects its caller to set __I40E_VSI_DOWN before calling it,
> as noted in the comment at the top of the function. All callers do this
> except i40e_vsi_reinit_locked(), which calls i40e_down() directly
> without setting the flag.
[Severity: High]
Is this accurate? i40e_set_ringparam() in i40e_ethtool.c (the ethtool -G
path) also appears to call i40e_down() on a running interface without
setting the bit:
drivers/net/ethernet/intel/i40e/i40e_ethtool.c:i40e_set_ringparam() {
...
/* Bring interface down, copy in the new ring info,
* then restore the interface
*/
i40e_down(vsi);
...
}
By then i40e_up_complete() has already cleared __I40E_VSI_DOWN, so this
bail-out in i40e_napi_poll() never fires:
if (test_bit(__I40E_VSI_DOWN, vsi->state)) {
napi_complete(napi);
return 0;
}
If the descriptors hold garbage, can this chain hang in the same way
while holding RTNL?
i40e_set_ringparam()->i40e_down()->i40e_napi_disable_all()->napi_disable()
The other callers already seem to set the bit:
- i40e_vsi_close()
- the DOWN_REQUESTED branch of i40e_do_reset()
- i40e_set_loopback()
- the err_up_complete path of i40e_vsi_open()
Two later patches in this series modify i40e_set_ringparam() but don't
add the set_bit():
- "i40e: fix freeing of TX rings on RX allocation failure"
- "i40e: avoid resetting BQL state when freeing temporary Tx rings in
set_ringparam"
Should i40e_set_ringparam() also call set_bit(__I40E_VSI_DOWN, vsi->state)
before i40e_down()? The later i40e_up()->i40e_up_complete() would clear it
again.
> diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c
> index abbc71e815ae3..dd729776c64dd 100644
> --- a/drivers/net/ethernet/intel/i40e/i40e_main.c
> +++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
> @@ -7461,6 +7461,8 @@ static void i40e_vsi_reinit_locked(struct i40e_vsi *vsi)
>
> while (test_and_set_bit(__I40E_CONFIG_BUSY, pf->state))
> usleep_range(1000, 2000);
> + /* required by i40e_down() */
> + set_bit(__I40E_VSI_DOWN, vsi->state);
> i40e_down(vsi);
[Severity: High]
This is a pre-existing issue, but i40e_vsi_reinit_locked() calls
i40e_down() unconditionally. That includes the case where the VSI is
already down but the netdev is still netif_running(). Can napi_disable()
then run a second time on NAPI instances that are already disabled?
The first napi_disable_locked() leaves NAPIF_STATE_SCHED and
NAPIF_STATE_NPSVC set, and only napi_enable() clears them. A second call
would spin here forever:
net/core/dev.c:napi_disable_locked() {
...
do {
while (val & (NAPIF_STATE_SCHED | NAPIF_STATE_NPSVC)) {
usleep_range(20, 200);
val = READ_ONCE(n->state);
}
...
}
It would do so while holding netdev_lock, and also RTNL in the MTU path.
One way to get here is a tx_timeout that escalates past level 3:
i40e_tx_timeout()
default:
set_bit(__I40E_DOWN_REQUESTED, pf->state);
set_bit(__I40E_VSI_DOWN_REQUESTED, vsi->state);
i40e_reset_subtask()
i40e_do_reset()
set_bit(__I40E_VSI_DOWN, vsi->state);
i40e_down(vsi); <- NAPI disabled, netdev still running
ip link set mtu ...
i40e_change_mtu()
if (netif_running(netdev))
i40e_vsi_reinit_locked(vsi);
i40e_down(vsi); <- second napi_disable()
A failed i40e_up() inside i40e_vsi_reinit_locked() also leaves NAPI
disabled, so the next MTU change would hit the same loop.
The new set_bit() has no effect in either case. i40e_vsi_close() and
i40e_set_loopback() use this pattern to avoid a second teardown:
if (!test_and_set_bit(__I40E_VSI_DOWN, vsi->state))
i40e_down(vsi);
Would that pattern work here as well? It should also prevent the hang
this patch targets.
>
> i40e_up(vsi);
[Severity: High]
What happens to the new __I40E_VSI_DOWN bit if i40e_up() fails here, for
example via i40e_change_mtu()->i40e_vsi_reinit_locked()? The return value
is ignored. i40e_up_complete() clears the bit only after the rings have
started:
drivers/net/ethernet/intel/i40e/i40e_main.c:i40e_up_complete() {
...
/* start rings */
err = i40e_vsi_start_rings(vsi);
if (err)
return err;
clear_bit(__I40E_VSI_DOWN, vsi->state);
i40e_napi_enable_all(vsi);
...
}
So the commit message's "i40e_up_complete() already clears the flag when
the VSI comes back up, so no additional cleanup is needed" seems to hold
only when bring-up succeeds.
i40e_vsi_start_rings() enables Rx before Tx. On -ETIMEDOUT it returns
without disabling the queues it already enabled.
If the Tx enable times out, every Rx queue could be live. Their
descriptors were already filled by i40e_vsi_configure_rx(). Meanwhile
__I40E_VSI_DOWN stays set and the netdev is still IFF_UP.
A later ndo_stop would then do:
i40e_vsi_close()
if (!test_and_set_bit(__I40E_VSI_DOWN, vsi->state))
i40e_down(vsi); <- skipped, i40e_vsi_stop_rings() never runs
i40e_vsi_free_irq(vsi);
i40e_vsi_free_tx_resources(vsi);
i40e_vsi_free_rx_resources(vsi);
Can i40e_free_rx_resources() then unmap the Rx pages and
dma_free_coherent() the descriptor ring while the hardware Rx queue is
still enabled and can DMA into that memory?
The stale bit also makes i40e_quiesce_vsi() return early without setting
__I40E_VSI_NEEDS_RESTART. A later PF reset, which is common after an NVM
update, would then not reopen the VSI, even though the netdev reports
IFF_UP.
Before this patch, the same failure led to a double napi_disable() hang
on close. i40e_down() still ran, so the rings were stopped first.
i40e_vsi_open() handles the same i40e_up_complete() failure with:
err_up_complete:
i40e_down(vsi);
Should i40e_vsi_reinit_locked() check the return value of i40e_up() and
clean up in a similar way?
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261113004602.129864-1-anthony.l.nguyen%40intel.com
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH net 3/6] i40e: avoid resetting BQL state when freeing temporary Tx rings in set_ringparam
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
0 siblings, 0 replies; 10+ messages in thread
From: netdev-bot+sashiko @ 2026-11-17 0:47 UTC (permalink / raw)
To: anthony.l.nguyen
Cc: davem, kuba, pabeni, edumazet, andrew+netdev, netdev,
luoxuanqiang, mheib, fballuch, aleksandr.loktionov,
richardcochran, saikrishnag, stable, vadim.fedorenko,
jacob.e.keller, rafal.romanowski
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
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2026-11-17 0:47 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
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
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox