From: Tony Nguyen <anthony.l.nguyen@intel.com> Date: 2025-06-10 17:13:54
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
From: Tony Nguyen <anthony.l.nguyen@intel.com> Date: 2025-06-10 17:13:56
From: Robert Malz <redacted>
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 <redacted>
Tested-by: Rafal Romanowski <redacted>
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(-)
@@ -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))-returntrue;+returnfalse;i40e_trigger_vf_reset(vf,flr);
From: Tony Nguyen <anthony.l.nguyen@intel.com> Date: 2025-06-10 17:13:56
From: Robert Malz <redacted>
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 <redacted>
Tested-by: Rafal Romanowski <redacted>
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(-)
@@ -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);+}}return0;
From: Tony Nguyen <anthony.l.nguyen@intel.com> Date: 2025-06-10 17:13:57
From: Ahmed Zaki <redacted>
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 <redacted>
Tested-by: Przemek Kitszel <przemyslaw.kitszel@intel.com>
Reviewed-by: Przemek Kitszel <przemyslaw.kitszel@intel.com>
Signed-off-by: Marcin Szycik <redacted>
Reviewed-by: Simon Horman <horms@kernel.org>
Tested-by: Rafal Romanowski <redacted>
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(+)
@@ -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,sowecan'tassumeitmeansallouropen*taskshavefinished,sincewe'renotholdingthertnl_lockhere.
@@ -79,6 +79,23 @@ iavf_poll_virtchnl_msg(struct iavf_hw *hw, struct iavf_arq_event_info *event,returniavf_status_to_errno(status);received_op=(enumvirtchnl_ops)le32_to_cpu(event->desc.cookie_high);++if(received_op==VIRTCHNL_OP_EVENT){+structiavf_adapter*adapter=hw->back;+structvirtchnl_pf_event*vpe=+(structvirtchnl_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;}
From: Tony Nguyen <anthony.l.nguyen@intel.com> Date: 2025-06-10 17:13:58
From: Anton Nadezhdin <redacted>
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 <redacted>
Reviewed-by: Aleksandr Loktionov <redacted>
Reviewed-by: Arkadiusz Kubalewski <arkadiusz.kubalewski@intel.com>
Tested-by: Rinitha S <redacted> (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(+)
From: Tony Nguyen <anthony.l.nguyen@intel.com> Date: 2025-06-10 17:13:58
From: Joe Damato <redacted>
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 <redacted>
Closes: https://lore.kernel.org/netdev/CAP=Rh=OEsn4y_2LvkO3UtDWurKcGPnZ_NPSXK=FbgygNXL37Sw@mail.gmail.com/
Signed-off-by: Joe Damato <redacted>
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(-)
@@ -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);}voide1000_down(structe1000_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);
Hello:
This series was applied to netdev/net.git (main)
by Tony Nguyen [off-list ref]:
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.
[...]