* [PATCH net 0/5][pull request] Intel Wired LAN Driver Updates 2025-06-10 (i40e, iavf, ice, e1000)
@ 2025-06-10 17:13 Tony Nguyen
2025-06-10 17:13 ` [PATCH net 1/5] i40e: return false from i40e_reset_vf if reset is in progress Tony Nguyen
` (5 more replies)
0 siblings, 6 replies; 7+ messages in thread
From: Tony Nguyen @ 2025-06-10 17:13 UTC (permalink / raw)
To: davem, kuba, pabeni, edumazet, andrew+netdev, netdev; +Cc: Tony Nguyen
For i40e:
Robert Malz improves reset handling for situations where multiple reset
requests could cause some to be missed.
For iavf:
Ahmed adds detection, and handling, of reset that could occur early in
the initialization process to stop long wait/hangs.
For ice:
Anton, properly, sets missed use_nsecs value.
For e1000:
Joe Damato moves cancel_work_sync() call to avoid deadlock.
The following are changes since commit fdd9ebccfc32c060d027ab9a2c957097e6997de6:
Merge tag 'for-net-2025-06-05' of git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth
and are available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/net-queue 40GbE
Ahmed Zaki (1):
iavf: fix reset_task for early reset event
Anton Nadezhdin (1):
ice/ptp: fix crosstimestamp reporting
Joe Damato (1):
e1000: Move cancel_work_sync to avoid deadlock
Robert Malz (2):
i40e: return false from i40e_reset_vf if reset is in progress
i40e: retry VFLR handling if there is ongoing VF reset
drivers/net/ethernet/intel/e1000/e1000_main.c | 8 ++++----
.../net/ethernet/intel/i40e/i40e_virtchnl_pf.c | 11 +++++++----
drivers/net/ethernet/intel/iavf/iavf_main.c | 11 +++++++++++
drivers/net/ethernet/intel/iavf/iavf_virtchnl.c | 17 +++++++++++++++++
drivers/net/ethernet/intel/ice/ice_ptp.c | 1 +
5 files changed, 40 insertions(+), 8 deletions(-)
--
2.47.1
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH net 1/5] i40e: return false from i40e_reset_vf if reset is in progress
2025-06-10 17:13 [PATCH net 0/5][pull request] Intel Wired LAN Driver Updates 2025-06-10 (i40e, iavf, ice, e1000) Tony Nguyen
@ 2025-06-10 17:13 ` Tony Nguyen
2025-06-10 17:13 ` [PATCH net 2/5] i40e: retry VFLR handling if there is ongoing VF reset Tony Nguyen
` (4 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: Tony Nguyen @ 2025-06-10 17:13 UTC (permalink / raw)
To: davem, kuba, pabeni, edumazet, andrew+netdev, netdev
Cc: Robert Malz, anthony.l.nguyen, Rafal Romanowski
From: Robert Malz <robert.malz@canonical.com>
The function i40e_vc_reset_vf attempts, up to 20 times, to handle a
VF reset request, using the return value of i40e_reset_vf as an indicator
of whether the reset was successfully triggered. Currently, i40e_reset_vf
always returns true, which causes new reset requests to be ignored if a
different VF reset is already in progress.
This patch updates the return value of i40e_reset_vf to reflect when
another VF reset is in progress, allowing the caller to properly use
the retry mechanism.
Fixes: 52424f974bc5 ("i40e: Fix VF hang when reset is triggered on another VF")
Signed-off-by: Robert Malz <robert.malz@canonical.com>
Tested-by: Rafal Romanowski <rafal.romanowski@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
---
drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c b/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c
index 1120f8e4bb67..22d5b1ec2289 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c
@@ -1546,8 +1546,8 @@ static void i40e_cleanup_reset_vf(struct i40e_vf *vf)
* @vf: pointer to the VF structure
* @flr: VFLR was issued or not
*
- * Returns true if the VF is in reset, resets successfully, or resets
- * are disabled and false otherwise.
+ * Return: True if reset was performed successfully or if resets are disabled.
+ * False if reset is already in progress.
**/
bool i40e_reset_vf(struct i40e_vf *vf, bool flr)
{
@@ -1566,7 +1566,7 @@ bool i40e_reset_vf(struct i40e_vf *vf, bool flr)
/* If VF is being reset already we don't need to continue. */
if (test_and_set_bit(I40E_VF_STATE_RESETTING, &vf->vf_states))
- return true;
+ return false;
i40e_trigger_vf_reset(vf, flr);
--
2.47.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH net 2/5] i40e: retry VFLR handling if there is ongoing VF reset
2025-06-10 17:13 [PATCH net 0/5][pull request] Intel Wired LAN Driver Updates 2025-06-10 (i40e, iavf, ice, e1000) Tony Nguyen
2025-06-10 17:13 ` [PATCH net 1/5] i40e: return false from i40e_reset_vf if reset is in progress Tony Nguyen
@ 2025-06-10 17:13 ` Tony Nguyen
2025-06-10 17:13 ` [PATCH net 3/5] iavf: fix reset_task for early reset event Tony Nguyen
` (3 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: Tony Nguyen @ 2025-06-10 17:13 UTC (permalink / raw)
To: davem, kuba, pabeni, edumazet, andrew+netdev, netdev
Cc: Robert Malz, anthony.l.nguyen, Rafal Romanowski
From: Robert Malz <robert.malz@canonical.com>
When a VFLR interrupt is received during a VF reset initiated from a
different source, the VFLR may be not fully handled. This can
leave the VF in an undefined state.
To address this, set the I40E_VFLR_EVENT_PENDING bit again during VFLR
handling if the reset is not yet complete. This ensures the driver
will properly complete the VF reset in such scenarios.
Fixes: 52424f974bc5 ("i40e: Fix VF hang when reset is triggered on another VF")
Signed-off-by: Robert Malz <robert.malz@canonical.com>
Tested-by: Rafal Romanowski <rafal.romanowski@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
---
drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c b/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c
index 22d5b1ec2289..88e6bef69342 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c
@@ -4328,7 +4328,10 @@ int i40e_vc_process_vflr_event(struct i40e_pf *pf)
reg = rd32(hw, I40E_GLGEN_VFLRSTAT(reg_idx));
if (reg & BIT(bit_idx))
/* i40e_reset_vf will clear the bit in GLGEN_VFLRSTAT */
- i40e_reset_vf(vf, true);
+ if (!i40e_reset_vf(vf, true)) {
+ /* At least one VF did not finish resetting, retry next time */
+ set_bit(__I40E_VFLR_EVENT_PENDING, pf->state);
+ }
}
return 0;
--
2.47.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH net 3/5] iavf: fix reset_task for early reset event
2025-06-10 17:13 [PATCH net 0/5][pull request] Intel Wired LAN Driver Updates 2025-06-10 (i40e, iavf, ice, e1000) Tony Nguyen
2025-06-10 17:13 ` [PATCH net 1/5] i40e: return false from i40e_reset_vf if reset is in progress Tony Nguyen
2025-06-10 17:13 ` [PATCH net 2/5] i40e: retry VFLR handling if there is ongoing VF reset Tony Nguyen
@ 2025-06-10 17:13 ` Tony Nguyen
2025-06-10 17:13 ` [PATCH net 4/5] ice/ptp: fix crosstimestamp reporting Tony Nguyen
` (2 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: Tony Nguyen @ 2025-06-10 17:13 UTC (permalink / raw)
To: davem, kuba, pabeni, edumazet, andrew+netdev, netdev
Cc: Ahmed Zaki, anthony.l.nguyen, Przemek Kitszel, Marcin Szycik,
Simon Horman, Rafal Romanowski
From: Ahmed Zaki <ahmed.zaki@intel.com>
If a reset event is received from the PF early in the init cycle, the
state machine hangs for about 25 seconds.
Reproducer:
echo 1 > /sys/class/net/$PF0/device/sriov_numvfs
ip link set dev $PF0 vf 0 mac $NEW_MAC
The log shows:
[792.620416] ice 0000:5e:00.0: Enabling 1 VFs
[792.738812] iavf 0000:5e:01.0: enabling device (0000 -> 0002)
[792.744182] ice 0000:5e:00.0: Enabling 1 VFs with 17 vectors and 16 queues per VF
[792.839964] ice 0000:5e:00.0: Setting MAC 52:54:00:00:00:11 on VF 0. VF driver will be reinitialized
[813.389684] iavf 0000:5e:01.0: Failed to communicate with PF; waiting before retry
[818.635918] iavf 0000:5e:01.0: Hardware came out of reset. Attempting reinit.
[818.766273] iavf 0000:5e:01.0: Multiqueue Enabled: Queue pair count = 16
Fix it by scheduling the reset task and making the reset task capable of
resetting early in the init cycle.
Fixes: ef8693eb90ae3 ("i40evf: refactor reset handling")
Signed-off-by: Ahmed Zaki <ahmed.zaki@intel.com>
Tested-by: Przemek Kitszel <przemyslaw.kitszel@intel.com>
Reviewed-by: Przemek Kitszel <przemyslaw.kitszel@intel.com>
Signed-off-by: Marcin Szycik <marcin.szycik@linux.intel.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Tested-by: Rafal Romanowski <rafal.romanowski@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
---
drivers/net/ethernet/intel/iavf/iavf_main.c | 11 +++++++++++
drivers/net/ethernet/intel/iavf/iavf_virtchnl.c | 17 +++++++++++++++++
2 files changed, 28 insertions(+)
diff --git a/drivers/net/ethernet/intel/iavf/iavf_main.c b/drivers/net/ethernet/intel/iavf/iavf_main.c
index 2c0bb41809a4..81d7249d1149 100644
--- a/drivers/net/ethernet/intel/iavf/iavf_main.c
+++ b/drivers/net/ethernet/intel/iavf/iavf_main.c
@@ -3209,6 +3209,17 @@ static void iavf_reset_task(struct work_struct *work)
}
continue_reset:
+ /* If we are still early in the state machine, just restart. */
+ if (adapter->state <= __IAVF_INIT_FAILED) {
+ iavf_shutdown_adminq(hw);
+ iavf_change_state(adapter, __IAVF_STARTUP);
+ iavf_startup(adapter);
+ queue_delayed_work(adapter->wq, &adapter->watchdog_task,
+ msecs_to_jiffies(30));
+ netdev_unlock(netdev);
+ return;
+ }
+
/* We don't use netif_running() because it may be true prior to
* ndo_open() returning, so we can't assume it means all our open
* tasks have finished, since we're not holding the rtnl_lock here.
diff --git a/drivers/net/ethernet/intel/iavf/iavf_virtchnl.c b/drivers/net/ethernet/intel/iavf/iavf_virtchnl.c
index a6f0e5990be2..07f0d0a0f1e2 100644
--- a/drivers/net/ethernet/intel/iavf/iavf_virtchnl.c
+++ b/drivers/net/ethernet/intel/iavf/iavf_virtchnl.c
@@ -79,6 +79,23 @@ iavf_poll_virtchnl_msg(struct iavf_hw *hw, struct iavf_arq_event_info *event,
return iavf_status_to_errno(status);
received_op =
(enum virtchnl_ops)le32_to_cpu(event->desc.cookie_high);
+
+ if (received_op == VIRTCHNL_OP_EVENT) {
+ struct iavf_adapter *adapter = hw->back;
+ struct virtchnl_pf_event *vpe =
+ (struct virtchnl_pf_event *)event->msg_buf;
+
+ if (vpe->event != VIRTCHNL_EVENT_RESET_IMPENDING)
+ continue;
+
+ dev_info(&adapter->pdev->dev, "Reset indication received from the PF\n");
+ if (!(adapter->flags & IAVF_FLAG_RESET_PENDING))
+ iavf_schedule_reset(adapter,
+ IAVF_FLAG_RESET_PENDING);
+
+ return -EIO;
+ }
+
if (op_to_poll == received_op)
break;
}
--
2.47.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH net 4/5] ice/ptp: fix crosstimestamp reporting
2025-06-10 17:13 [PATCH net 0/5][pull request] Intel Wired LAN Driver Updates 2025-06-10 (i40e, iavf, ice, e1000) Tony Nguyen
` (2 preceding siblings ...)
2025-06-10 17:13 ` [PATCH net 3/5] iavf: fix reset_task for early reset event Tony Nguyen
@ 2025-06-10 17:13 ` Tony Nguyen
2025-06-10 17:13 ` [PATCH net 5/5] e1000: Move cancel_work_sync to avoid deadlock Tony Nguyen
2025-06-11 21:40 ` [PATCH net 0/5][pull request] Intel Wired LAN Driver Updates 2025-06-10 (i40e, iavf, ice, e1000) patchwork-bot+netdevbpf
5 siblings, 0 replies; 7+ messages in thread
From: Tony Nguyen @ 2025-06-10 17:13 UTC (permalink / raw)
To: davem, kuba, pabeni, edumazet, andrew+netdev, netdev
Cc: Anton Nadezhdin, anthony.l.nguyen, lakshmi.sowjanya.d, tglx,
richardcochran, Aleksandr Loktionov, Arkadiusz Kubalewski,
Rinitha S
From: Anton Nadezhdin <anton.nadezhdin@intel.com>
Set use_nsecs=true as timestamp is reported in ns. Lack of this result
in smaller timestamp error window which cause error during phc2sys
execution on E825 NICs:
phc2sys[1768.256]: ioctl PTP_SYS_OFFSET_PRECISE: Invalid argument
This problem was introduced in the cited commit which omitted setting
use_nsecs to true when converting the ice driver to use
convert_base_to_cs().
Testing hints (ethX is PF netdev):
phc2sys -s ethX -c CLOCK_REALTIME -O 37 -m
phc2sys[1769.256]: CLOCK_REALTIME phc offset -5 s0 freq -0 delay 0
Fixes: d4bea547ebb57 ("ice/ptp: Remove convert_art_to_tsc()")
Signed-off-by: Anton Nadezhdin <anton.nadezhdin@intel.com>
Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
Reviewed-by: Arkadiusz Kubalewski <arkadiusz.kubalewski@intel.com>
Tested-by: Rinitha S <sx.rinitha@intel.com> (A Contingent worker at Intel)
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
---
drivers/net/ethernet/intel/ice/ice_ptp.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/net/ethernet/intel/ice/ice_ptp.c b/drivers/net/ethernet/intel/ice/ice_ptp.c
index b79a148ed0f2..55cad824c5b9 100644
--- a/drivers/net/ethernet/intel/ice/ice_ptp.c
+++ b/drivers/net/ethernet/intel/ice/ice_ptp.c
@@ -2299,6 +2299,7 @@ static int ice_capture_crosststamp(ktime_t *device,
ts = ((u64)ts_hi << 32) | ts_lo;
system->cycles = ts;
system->cs_id = CSID_X86_ART;
+ system->use_nsecs = true;
/* Read Device source clock time */
ts_lo = rd32(hw, cfg->dev_time_l[tmr_idx]);
--
2.47.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH net 5/5] e1000: Move cancel_work_sync to avoid deadlock
2025-06-10 17:13 [PATCH net 0/5][pull request] Intel Wired LAN Driver Updates 2025-06-10 (i40e, iavf, ice, e1000) Tony Nguyen
` (3 preceding siblings ...)
2025-06-10 17:13 ` [PATCH net 4/5] ice/ptp: fix crosstimestamp reporting Tony Nguyen
@ 2025-06-10 17:13 ` Tony Nguyen
2025-06-11 21:40 ` [PATCH net 0/5][pull request] Intel Wired LAN Driver Updates 2025-06-10 (i40e, iavf, ice, e1000) patchwork-bot+netdevbpf
5 siblings, 0 replies; 7+ messages in thread
From: Tony Nguyen @ 2025-06-10 17:13 UTC (permalink / raw)
To: davem, kuba, pabeni, edumazet, andrew+netdev, netdev
Cc: Joe Damato, anthony.l.nguyen, stfomichev,
syzbot+846bb38dc67fe62cc733, John, Stanislav Fomichev,
Jacob Keller
From: Joe Damato <jdamato@fastly.com>
Previously, e1000_down called cancel_work_sync for the e1000 reset task
(via e1000_down_and_stop), which takes RTNL.
As reported by users and syzbot, a deadlock is possible in the following
scenario:
CPU 0:
- RTNL is held
- e1000_close
- e1000_down
- cancel_work_sync (cancel / wait for e1000_reset_task())
CPU 1:
- process_one_work
- e1000_reset_task
- take RTNL
To remedy this, avoid calling cancel_work_sync from e1000_down
(e1000_reset_task does nothing if the device is down anyway). Instead,
call cancel_work_sync for e1000_reset_task when the device is being
removed.
Fixes: e400c7444d84 ("e1000: Hold RTNL when e1000_down can be called")
Reported-by: syzbot+846bb38dc67fe62cc733@syzkaller.appspotmail.com
Closes: https://lore.kernel.org/netdev/683837bf.a00a0220.52848.0003.GAE@google.com/
Reported-by: John <john.cs.hey@gmail.com>
Closes: https://lore.kernel.org/netdev/CAP=Rh=OEsn4y_2LvkO3UtDWurKcGPnZ_NPSXK=FbgygNXL37Sw@mail.gmail.com/
Signed-off-by: Joe Damato <jdamato@fastly.com>
Acked-by: Stanislav Fomichev <sdf@fomichev.me>
Acked-by: Jacob Keller <jacob.e.keller@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
---
drivers/net/ethernet/intel/e1000/e1000_main.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/net/ethernet/intel/e1000/e1000_main.c b/drivers/net/ethernet/intel/e1000/e1000_main.c
index 3f089c3d47b2..d8595e84326d 100644
--- a/drivers/net/ethernet/intel/e1000/e1000_main.c
+++ b/drivers/net/ethernet/intel/e1000/e1000_main.c
@@ -477,10 +477,6 @@ static void e1000_down_and_stop(struct e1000_adapter *adapter)
cancel_delayed_work_sync(&adapter->phy_info_task);
cancel_delayed_work_sync(&adapter->fifo_stall_task);
-
- /* Only kill reset task if adapter is not resetting */
- if (!test_bit(__E1000_RESETTING, &adapter->flags))
- cancel_work_sync(&adapter->reset_task);
}
void e1000_down(struct e1000_adapter *adapter)
@@ -1266,6 +1262,10 @@ static void e1000_remove(struct pci_dev *pdev)
unregister_netdev(netdev);
+ /* Only kill reset task if adapter is not resetting */
+ if (!test_bit(__E1000_RESETTING, &adapter->flags))
+ cancel_work_sync(&adapter->reset_task);
+
e1000_phy_hw_reset(hw);
kfree(adapter->tx_ring);
--
2.47.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH net 0/5][pull request] Intel Wired LAN Driver Updates 2025-06-10 (i40e, iavf, ice, e1000)
2025-06-10 17:13 [PATCH net 0/5][pull request] Intel Wired LAN Driver Updates 2025-06-10 (i40e, iavf, ice, e1000) Tony Nguyen
` (4 preceding siblings ...)
2025-06-10 17:13 ` [PATCH net 5/5] e1000: Move cancel_work_sync to avoid deadlock Tony Nguyen
@ 2025-06-11 21:40 ` patchwork-bot+netdevbpf
5 siblings, 0 replies; 7+ messages in thread
From: patchwork-bot+netdevbpf @ 2025-06-11 21:40 UTC (permalink / raw)
To: Tony Nguyen; +Cc: davem, kuba, pabeni, edumazet, andrew+netdev, netdev
Hello:
This series was applied to netdev/net.git (main)
by Tony Nguyen <anthony.l.nguyen@intel.com>:
On Tue, 10 Jun 2025 10:13:40 -0700 you wrote:
> For i40e:
> Robert Malz improves reset handling for situations where multiple reset
> requests could cause some to be missed.
>
> For iavf:
> Ahmed adds detection, and handling, of reset that could occur early in
> the initialization process to stop long wait/hangs.
>
> [...]
Here is the summary with links:
- [net,1/5] i40e: return false from i40e_reset_vf if reset is in progress
https://git.kernel.org/netdev/net/c/a2c90d63b712
- [net,2/5] i40e: retry VFLR handling if there is ongoing VF reset
https://git.kernel.org/netdev/net/c/fb4e9239e029
- [net,3/5] iavf: fix reset_task for early reset event
https://git.kernel.org/netdev/net/c/0c6f4631436e
- [net,4/5] ice/ptp: fix crosstimestamp reporting
https://git.kernel.org/netdev/net/c/a5a441ae283d
- [net,5/5] e1000: Move cancel_work_sync to avoid deadlock
https://git.kernel.org/netdev/net/c/b4a8085ceefb
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2025-06-11 21:40 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-10 17:13 [PATCH net 0/5][pull request] Intel Wired LAN Driver Updates 2025-06-10 (i40e, iavf, ice, e1000) Tony Nguyen
2025-06-10 17:13 ` [PATCH net 1/5] i40e: return false from i40e_reset_vf if reset is in progress Tony Nguyen
2025-06-10 17:13 ` [PATCH net 2/5] i40e: retry VFLR handling if there is ongoing VF reset Tony Nguyen
2025-06-10 17:13 ` [PATCH net 3/5] iavf: fix reset_task for early reset event Tony Nguyen
2025-06-10 17:13 ` [PATCH net 4/5] ice/ptp: fix crosstimestamp reporting Tony Nguyen
2025-06-10 17:13 ` [PATCH net 5/5] e1000: Move cancel_work_sync to avoid deadlock Tony Nguyen
2025-06-11 21:40 ` [PATCH net 0/5][pull request] Intel Wired LAN Driver Updates 2025-06-10 (i40e, iavf, ice, e1000) patchwork-bot+netdevbpf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).