]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
idpf: avoid mailbox timeout delays during reset
authorEmil Tantilov <emil.s.tantilov@intel.com>
Thu, 8 May 2025 18:47:15 +0000 (11:47 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 19 Jun 2025 13:32:16 +0000 (15:32 +0200)
[ Upstream commit 9dc63d8ff182150d7d7b318ab9389702a2c0a292 ]

Mailbox operations are not possible while the driver is in reset.
Operations that require MBX exchange with the control plane will result
in long delays if executed while a reset is in progress:

ethtool -L <inf> combined 8& echo 1 > /sys/class/net/<inf>/device/reset
idpf 0000:83:00.0: HW reset detected
idpf 0000:83:00.0: Device HW Reset initiated
idpf 0000:83:00.0: Transaction timed-out (op:504 cookie:be00 vc_op:504 salt:be timeout:2000ms)
idpf 0000:83:00.0: Transaction timed-out (op:508 cookie:bf00 vc_op:508 salt:bf timeout:2000ms)
idpf 0000:83:00.0: Transaction timed-out (op:512 cookie:c000 vc_op:512 salt:c0 timeout:2000ms)
idpf 0000:83:00.0: Transaction timed-out (op:510 cookie:c100 vc_op:510 salt:c1 timeout:2000ms)
idpf 0000:83:00.0: Transaction timed-out (op:509 cookie:c200 vc_op:509 salt:c2 timeout:60000ms)
idpf 0000:83:00.0: Transaction timed-out (op:509 cookie:c300 vc_op:509 salt:c3 timeout:60000ms)
idpf 0000:83:00.0: Transaction timed-out (op:505 cookie:c400 vc_op:505 salt:c4 timeout:60000ms)
idpf 0000:83:00.0: Failed to configure queues for vport 0, -62

Disable mailbox communication in case of a reset, unless it's done during
a driver load, where the virtchnl operations are needed to configure the
device.

Fixes: 8077c727561aa ("idpf: add controlq init and reset checks")
Co-developed-by: Joshua Hay <joshua.a.hay@intel.com>
Signed-off-by: Joshua Hay <joshua.a.hay@intel.com>
Signed-off-by: Emil Tantilov <emil.s.tantilov@intel.com>
Reviewed-by: Ahmed Zaki <ahmed.zaki@intel.com>
Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Tested-by: Samuel Salin <Samuel.salin@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/intel/idpf/idpf_lib.c
drivers/net/ethernet/intel/idpf/idpf_virtchnl.c
drivers/net/ethernet/intel/idpf/idpf_virtchnl.h

index 615e74d038457cce7b3894686fbfb5ab3a83d291..ba645ab22d394a862db97b4de818392dc9ed587f 100644 (file)
@@ -1802,11 +1802,19 @@ void idpf_vc_event_task(struct work_struct *work)
        if (test_bit(IDPF_REMOVE_IN_PROG, adapter->flags))
                return;
 
-       if (test_bit(IDPF_HR_FUNC_RESET, adapter->flags) ||
-           test_bit(IDPF_HR_DRV_LOAD, adapter->flags)) {
-               set_bit(IDPF_HR_RESET_IN_PROG, adapter->flags);
-               idpf_init_hard_reset(adapter);
-       }
+       if (test_bit(IDPF_HR_FUNC_RESET, adapter->flags))
+               goto func_reset;
+
+       if (test_bit(IDPF_HR_DRV_LOAD, adapter->flags))
+               goto drv_load;
+
+       return;
+
+func_reset:
+       idpf_vc_xn_shutdown(adapter->vcxn_mngr);
+drv_load:
+       set_bit(IDPF_HR_RESET_IN_PROG, adapter->flags);
+       idpf_init_hard_reset(adapter);
 }
 
 /**
index 99bdb95bf22661f5ad0c30704d67f2f4ff0cee7d..151beea20d34355c471517930c99aadaf69ee4d6 100644 (file)
@@ -376,7 +376,7 @@ static void idpf_vc_xn_init(struct idpf_vc_xn_manager *vcxn_mngr)
  * All waiting threads will be woken-up and their transaction aborted. Further
  * operations on that object will fail.
  */
-static void idpf_vc_xn_shutdown(struct idpf_vc_xn_manager *vcxn_mngr)
+void idpf_vc_xn_shutdown(struct idpf_vc_xn_manager *vcxn_mngr)
 {
        int i;
 
index 83da5d8da56bf211e6d269da999b2ea78c961931..23271cf0a216056a1d2fd1ad89c3a5850499d45d 100644 (file)
@@ -66,5 +66,6 @@ int idpf_send_get_stats_msg(struct idpf_vport *vport);
 int idpf_send_set_sriov_vfs_msg(struct idpf_adapter *adapter, u16 num_vfs);
 int idpf_send_get_set_rss_key_msg(struct idpf_vport *vport, bool get);
 int idpf_send_get_set_rss_lut_msg(struct idpf_vport *vport, bool get);
+void idpf_vc_xn_shutdown(struct idpf_vc_xn_manager *vcxn_mngr);
 
 #endif /* _IDPF_VIRTCHNL_H_ */