Skip to content

Commit fd5855e

Browse files
aloktionanguy11
authored andcommitted
i40e: Fix call trace in setup_tx_descriptors
After PF reset and ethtool -t there was call trace in dmesg sometimes leading to panic. When there was some time, around 5 seconds, between reset and test there were no errors. Problem was that pf reset calls i40e_vsi_close in prep_for_reset and ethtool -t calls i40e_vsi_close in diag_test. If there was not enough time between those commands the second i40e_vsi_close starts before previous i40e_vsi_close was done which leads to crash. Add check to diag_test if pf is in reset and don't start offline tests if it is true. Add netif_info("testing failed") into unhappy path of i40e_diag_test() Fixes: e17bc41 ("i40e: Disable offline diagnostics if VFs are enabled") Fixes: 510efb2 ("i40e: Fix ethtool offline diagnostic with netqueues") Signed-off-by: Michal Jaron <michalx.jaron@intel.com> Signed-off-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com> Tested-by: Gurucharan <gurucharanx.g@intel.com> (A Contingent worker at Intel) Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
1 parent 0bb0506 commit fd5855e

1 file changed

Lines changed: 17 additions & 8 deletions

File tree

drivers/net/ethernet/intel/i40e/i40e_ethtool.c

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2586,15 +2586,16 @@ static void i40e_diag_test(struct net_device *netdev,
25862586

25872587
set_bit(__I40E_TESTING, pf->state);
25882588

2589+
if (test_bit(__I40E_RESET_RECOVERY_PENDING, pf->state) ||
2590+
test_bit(__I40E_RESET_INTR_RECEIVED, pf->state)) {
2591+
dev_warn(&pf->pdev->dev,
2592+
"Cannot start offline testing when PF is in reset state.\n");
2593+
goto skip_ol_tests;
2594+
}
2595+
25892596
if (i40e_active_vfs(pf) || i40e_active_vmdqs(pf)) {
25902597
dev_warn(&pf->pdev->dev,
25912598
"Please take active VFs and Netqueues offline and restart the adapter before running NIC diagnostics\n");
2592-
data[I40E_ETH_TEST_REG] = 1;
2593-
data[I40E_ETH_TEST_EEPROM] = 1;
2594-
data[I40E_ETH_TEST_INTR] = 1;
2595-
data[I40E_ETH_TEST_LINK] = 1;
2596-
eth_test->flags |= ETH_TEST_FL_FAILED;
2597-
clear_bit(__I40E_TESTING, pf->state);
25982599
goto skip_ol_tests;
25992600
}
26002601

@@ -2641,9 +2642,17 @@ static void i40e_diag_test(struct net_device *netdev,
26412642
data[I40E_ETH_TEST_INTR] = 0;
26422643
}
26432644

2644-
skip_ol_tests:
2645-
26462645
netif_info(pf, drv, netdev, "testing finished\n");
2646+
return;
2647+
2648+
skip_ol_tests:
2649+
data[I40E_ETH_TEST_REG] = 1;
2650+
data[I40E_ETH_TEST_EEPROM] = 1;
2651+
data[I40E_ETH_TEST_INTR] = 1;
2652+
data[I40E_ETH_TEST_LINK] = 1;
2653+
eth_test->flags |= ETH_TEST_FL_FAILED;
2654+
clear_bit(__I40E_TESTING, pf->state);
2655+
netif_info(pf, drv, netdev, "testing failed\n");
26472656
}
26482657

26492658
static void i40e_get_wol(struct net_device *netdev,

0 commit comments

Comments
 (0)