Skip to contentSkip to conversation

i40e: Fix call trace in setup_tx_descriptors

PATCH Superseded Loktionov 3 participants 3 messages May 19, 2022

Subsystems (2)

v2 of 333 Superseded Latest is v333 →

lore
Share & tools
lore

Loktionov

#0 lore raw

PATCH v2 1/1 i40e: Fix call trace in setup_tx_descriptors

From: Aleksandr Loktionov <[email protected]>

After pf reset and ethtool -t there was call trace is dmesg sometimes providing to panic. When there was some time, around 5 seconds, between reset and test there was 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.

Fixes e17bc411aea8 ("i40e: Disable offline diagnostics if VFs are enabled")
---
 .../net/ethernet/intel/i40e/i40e_ethtool.c    | 25 +++++++++++++------
 1 file changed, 17 insertions(+), 8 deletions(-)
drivers/net/ethernet/intel/i40e/i40e_ethtool.c +17 -8
index e484996..06c05a6 100644
@@ -2584,15 +2584,16 @@ static void i40e_diag_test(struct net_device *netdev,
 
 		set_bit(__I40E_TESTING, pf->state);
 
+		if (test_bit(__I40E_RESET_RECOVERY_PENDING, pf->state) ||
+		    test_bit(__I40E_RESET_INTR_RECEIVED, pf->state)) {
+			dev_warn(&pf->pdev->dev,
+				 "Cannot start offline testing when PF is in reset state.\n");
+			goto skip_ol_tests;
+		}
+
 		if (i40e_active_vfs(pf) || i40e_active_vmdqs(pf)) {
 			dev_warn(&pf->pdev->dev,
 				 "Please take active VFs and Netqueues offline and restart the adapter before running NIC diagnostics\n");
-			data[I40E_ETH_TEST_REG]		= 1;
-			data[I40E_ETH_TEST_EEPROM]	= 1;
-			data[I40E_ETH_TEST_INTR]	= 1;
-			data[I40E_ETH_TEST_LINK]	= 1;
-			eth_test->flags |= ETH_TEST_FL_FAILED;
-			clear_bit(__I40E_TESTING, pf->state);
 			goto skip_ol_tests;
 		}
 
@@ -2639,9 +2640,17 @@ static void i40e_diag_test(struct net_device *netdev,
 		data[I40E_ETH_TEST_INTR] = 0;
 	}
 
-skip_ol_tests:
-
 	netif_info(pf, drv, netdev, "testing finished\n");
+	return;
+
+skip_ol_tests:
+	data[I40E_ETH_TEST_REG]		= 1;
+	data[I40E_ETH_TEST_EEPROM]	= 1;
+	data[I40E_ETH_TEST_INTR]	= 1;
+	data[I40E_ETH_TEST_LINK]	= 1;
+	eth_test->flags |= ETH_TEST_FL_FAILED;
+	clear_bit(__I40E_TESTING, pf->state);
+	netif_info(pf, drv, netdev, "testing failed\n");
 }
 
 static void i40e_get_wol(struct net_device *netdev,
Signature · 1 line
2.31.1
#1 lore raw

PATCH v2 1/1 i40e: Fix call trace in setup_tx_descriptors

Dear Aleksandr,

Am 19.05.22 um 10:02 schrieb Loktionov, Aleksandr:

Quoted 4 lines

From: Aleksandr Loktionov <[email protected]>

After pf reset and ethtool -t there was call trace is dmesg sometimes providing to panic. When there was some time, around 5

?sometimes providing to panic? sounds strange. Can you please clarify, and rephrase for v2?

Quoted 9 lines

seconds, between reset and test there was 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.

Maybe also mention the new log message:

     netif_info(pf, drv, netdev, "testing failed\n");
Quoted 44 lines
Fixes e17bc411aea8 ("i40e: Disable offline diagnostics if VFs are enabled")
---
  .../net/ethernet/intel/i40e/i40e_ethtool.c    | 25 +++++++++++++------
  1 file changed, 17 insertions(+), 8 deletions(-)
drivers/net/ethernet/intel/i40e/i40e_ethtool.c +10 -8
index e484996..06c05a6 100644
@@ -2584,15 +2584,16 @@ static void i40e_diag_test(struct net_device *netdev,
 
  		set_bit(__I40E_TESTING, pf->state);
 
+		if (test_bit(__I40E_RESET_RECOVERY_PENDING, pf->state) ||
+		    test_bit(__I40E_RESET_INTR_RECEIVED, pf->state)) {
+			dev_warn(&pf->pdev->dev,
+				 "Cannot start offline testing when PF is in reset state.\n");
+			goto skip_ol_tests;
+		}
+
  		if (i40e_active_vfs(pf) || i40e_active_vmdqs(pf)) {
  			dev_warn(&pf->pdev->dev,
  				 "Please take active VFs and Netqueues offline and restart the adapter before running NIC diagnostics\n");
-			data[I40E_ETH_TEST_REG]		= 1;
-			data[I40E_ETH_TEST_EEPROM]	= 1;
-			data[I40E_ETH_TEST_INTR]	= 1;
-			data[I40E_ETH_TEST_LINK]	= 1;
-			eth_test->flags |= ETH_TEST_FL_FAILED;
-			clear_bit(__I40E_TESTING, pf->state);
  			goto skip_ol_tests;
  		}
 
@@ -2639,9 +2640,17 @@ static void i40e_diag_test(struct net_device *netdev,
  		data[I40E_ETH_TEST_INTR] = 0;
  	}
 
-skip_ol_tests:
-
  	netif_info(pf, drv, netdev, "testing finished\n");
+	return;
+
+skip_ol_tests:

drivers/net/ethernet/intel/i40e/i40e_ethtool.c static void i40e_diag_test(struct net_device *netdev, · line 2656

Quoted 10 lines
drivers/net/ethernet/intel/i40e/i40e_ethtool.c +7 -0
+	data[I40E_ETH_TEST_REG]		= 1;
+	data[I40E_ETH_TEST_EEPROM]	= 1;
+	data[I40E_ETH_TEST_INTR]	= 1;
+	data[I40E_ETH_TEST_LINK]	= 1;
+	eth_test->flags |= ETH_TEST_FL_FAILED;
+	clear_bit(__I40E_TESTING, pf->state);
+	netif_info(pf, drv, netdev, "testing failed\n");
  }
 
  static void i40e_get_wol(struct net_device *netdev,

Kind regards,

Paul

#2 lore raw

PATCH v2 1/1 i40e: Fix call trace in setup_tx_descriptors

In reply to Loktionov
Quoted 3 lines · Aleksandr

From: Aleksandr Loktionov <[email protected]>

After pf reset and ethtool -t there was call trace is dmesg

s/pf/PF
s/trace is dmesg/trace in dmesg

Quoted 1 line

sometimes providing to panic. When there was some time, around 5

s/providing/leading ?
please include the splat from panic

Quoted 1 line

seconds, between reset and test there was no errors.

s/was/were

Quoted 10 lines

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.

Fixes e17bc411aea8 ("i40e: Disable offline diagnostics if VFs are enabled")

Hard to say which commit should we pick as fixes candidate, but if we stay with the current one then I think it would be good to include a second fixes tag that points to the commit that added "|| i40e_active_vmdqs(pf)" part.

Quoted 60 lines
---
 .../net/ethernet/intel/i40e/i40e_ethtool.c    | 25 +++++++++++++------
 1 file changed, 17 insertions(+), 8 deletions(-)
drivers/net/ethernet/intel/i40e/i40e_ethtool.c +17 -8
index e484996..06c05a6 100644
@@ -2584,15 +2584,16 @@ static void i40e_diag_test(struct net_device *netdev,
 
 		set_bit(__I40E_TESTING, pf->state);
 
+		if (test_bit(__I40E_RESET_RECOVERY_PENDING, pf->state) ||
+		    test_bit(__I40E_RESET_INTR_RECEIVED, pf->state)) {
+			dev_warn(&pf->pdev->dev,
+				 "Cannot start offline testing when PF is in reset state.\n");
+			goto skip_ol_tests;
+		}
+
 		if (i40e_active_vfs(pf) || i40e_active_vmdqs(pf)) {
 			dev_warn(&pf->pdev->dev,
 				 "Please take active VFs and Netqueues offline and restart the adapter before running NIC diagnostics\n");
-			data[I40E_ETH_TEST_REG]		= 1;
-			data[I40E_ETH_TEST_EEPROM]	= 1;
-			data[I40E_ETH_TEST_INTR]	= 1;
-			data[I40E_ETH_TEST_LINK]	= 1;
-			eth_test->flags |= ETH_TEST_FL_FAILED;
-			clear_bit(__I40E_TESTING, pf->state);
 			goto skip_ol_tests;
 		}
 
@@ -2639,9 +2640,17 @@ static void i40e_diag_test(struct net_device *netdev,
 		data[I40E_ETH_TEST_INTR] = 0;
 	}
 
-skip_ol_tests:
-
 	netif_info(pf, drv, netdev, "testing finished\n");
+	return;
+
+skip_ol_tests:
+	data[I40E_ETH_TEST_REG]		= 1;
+	data[I40E_ETH_TEST_EEPROM]	= 1;
+	data[I40E_ETH_TEST_INTR]	= 1;
+	data[I40E_ETH_TEST_LINK]	= 1;
+	eth_test->flags |= ETH_TEST_FL_FAILED;
+	clear_bit(__I40E_TESTING, pf->state);
+	netif_info(pf, drv, netdev, "testing failed\n");
 }
 
 static void i40e_get_wol(struct net_device *netdev,
Signature · 6 lines
2.31.1

_______________________________________________
Intel-wired-lan mailing list
Intel-wired-lan at osuosl.org
https://lists.osuosl.org/mailman/listinfo/intel-wired-lan