Skip to content

Commit 9dc63d8

Browse files
etantilovanguy11
authored andcommitted
idpf: avoid mailbox timeout delays during reset
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: 8077c72 ("idpf: add controlq init and reset checks") Co-developed-by: Joshua Hay <[email protected]> Signed-off-by: Joshua Hay <[email protected]> Signed-off-by: Emil Tantilov <[email protected]> Reviewed-by: Ahmed Zaki <[email protected]> Reviewed-by: Aleksandr Loktionov <[email protected]> Reviewed-by: Simon Horman <[email protected]> Tested-by: Samuel Salin <[email protected]> Signed-off-by: Tony Nguyen <[email protected]>
1 parent 7292af0 commit 9dc63d8

File tree

3 files changed

+15
-6
lines changed

3 files changed

+15
-6
lines changed

drivers/net/ethernet/intel/idpf/idpf_lib.c

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1801,11 +1801,19 @@ void idpf_vc_event_task(struct work_struct *work)
18011801
if (test_bit(IDPF_REMOVE_IN_PROG, adapter->flags))
18021802
return;
18031803

1804-
if (test_bit(IDPF_HR_FUNC_RESET, adapter->flags) ||
1805-
test_bit(IDPF_HR_DRV_LOAD, adapter->flags)) {
1806-
set_bit(IDPF_HR_RESET_IN_PROG, adapter->flags);
1807-
idpf_init_hard_reset(adapter);
1808-
}
1804+
if (test_bit(IDPF_HR_FUNC_RESET, adapter->flags))
1805+
goto func_reset;
1806+
1807+
if (test_bit(IDPF_HR_DRV_LOAD, adapter->flags))
1808+
goto drv_load;
1809+
1810+
return;
1811+
1812+
func_reset:
1813+
idpf_vc_xn_shutdown(adapter->vcxn_mngr);
1814+
drv_load:
1815+
set_bit(IDPF_HR_RESET_IN_PROG, adapter->flags);
1816+
idpf_init_hard_reset(adapter);
18091817
}
18101818

18111819
/**

drivers/net/ethernet/intel/idpf/idpf_virtchnl.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@ static void idpf_vc_xn_init(struct idpf_vc_xn_manager *vcxn_mngr)
347347
* All waiting threads will be woken-up and their transaction aborted. Further
348348
* operations on that object will fail.
349349
*/
350-
static void idpf_vc_xn_shutdown(struct idpf_vc_xn_manager *vcxn_mngr)
350+
void idpf_vc_xn_shutdown(struct idpf_vc_xn_manager *vcxn_mngr)
351351
{
352352
int i;
353353

drivers/net/ethernet/intel/idpf/idpf_virtchnl.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,5 +150,6 @@ int idpf_send_get_stats_msg(struct idpf_vport *vport);
150150
int idpf_send_set_sriov_vfs_msg(struct idpf_adapter *adapter, u16 num_vfs);
151151
int idpf_send_get_set_rss_key_msg(struct idpf_vport *vport, bool get);
152152
int idpf_send_get_set_rss_lut_msg(struct idpf_vport *vport, bool get);
153+
void idpf_vc_xn_shutdown(struct idpf_vc_xn_manager *vcxn_mngr);
153154

154155
#endif /* _IDPF_VIRTCHNL_H_ */

0 commit comments

Comments
 (0)