Skip to contentSkip to conversation

ixgbe: Do not run all Diagnostic offline tests when VFs are active

PATCH Applied Jeff Kirsher 2 participants 2 messages Mar 26, 2010 – Mar 27, 2010

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ixgbe: Do not run all Diagnostic offline tests when VFs are active

From: Greg Rose <[email protected]>

When running the offline diagnostic tests check to see if any VFs are online. If so then only run the link test. This is necessary because the VFs running in guest VMs aren't aware of when the PF is taken offline for a diagnostic test. Also put a message to the system log telling the system administrator to take the VFs offline manually if (s)he wants to run a full diagnostic. Return 1 on each of the tests not run to alert the user of the condition.

---

 drivers/net/ixgbe/ixgbe_ethtool.c |   21 +++++++++++++++++++++
 1 files changed, 21 insertions(+), 0 deletions(-)
drivers/net/ixgbe/ixgbe_ethtool.c +21 -0
index 7949a44..1959ef7 100644
@@ -1853,6 +1853,26 @@ static void ixgbe_diag_test(struct net_device *netdev,
 		if (ixgbe_link_test(adapter, &data[4]))
 			eth_test->flags |= ETH_TEST_FL_FAILED;
 
+		if (adapter->flags & IXGBE_FLAG_SRIOV_ENABLED) {
+			int i;
+			for (i = 0; i < adapter->num_vfs; i++) {
+				if (adapter->vfinfo[i].clear_to_send) {
+					netdev_warn(netdev, "%s",
+						    "offline diagnostic is not "
+						    "supported when VFs are "
+						    "present\n");
+					data[0] = 1;
+					data[1] = 1;
+					data[2] = 1;
+					data[3] = 1;
+					eth_test->flags |= ETH_TEST_FL_FAILED;
+					clear_bit(__IXGBE_TESTING,
+						  &adapter->state);
+					goto skip_ol_tests;
+				}
+			}
+		}
+
 		if (if_running)
 			/* indicate we're in test mode */
 			dev_close(netdev);
@@ -1908,6 +1928,7 @@ skip_loopback:
 
 		clear_bit(__IXGBE_TESTING, &adapter->state);
 	}
+skip_ol_tests:
 	msleep_interruptible(4 * 1000);
 }
 
maintainer Applied
#1 lore raw

From: Jeff Kirsher <[email protected]>
Date: Thu, 25 Mar 2010 20:06:48 -0700

Quoted 10 lines

From: Greg Rose <[email protected]>

When running the offline diagnostic tests check to see if any VFs are online. If so then only run the link test. This is necessary because the VFs running in guest VMs aren't aware of when the PF is taken offline for a diagnostic test. Also put a message to the system log telling the system administrator to take the VFs offline manually if (s)he wants to run a full diagnostic. Return 1 on each of the tests not run to alert the user of the condition.

Quoted 2 lines

Applied.