Skip to contentSkip to conversation

be2net: do external loopback test only when it is requested

PATCH Applied Ivan Vecera 3 participants 3 messages Mar 5, 2014 – Mar 6, 2014

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

PATCH v2 1/1 be2net: do external loopback test only when it is requested

v2: remove unnecessary braces from all 'loopback' if-blocks (thx Sergei)

---
 drivers/net/ethernet/emulex/benet/be_ethtool.c | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)
drivers/net/ethernet/emulex/benet/be_ethtool.c +9 -7
index cf09d8f..66759b6 100644
@@ -802,16 +802,18 @@ be_self_test(struct net_device *netdev, struct ethtool_test *test, u64 *data)
 
 	if (test->flags & ETH_TEST_FL_OFFLINE) {
 		if (be_loopback_test(adapter, BE_MAC_LOOPBACK,
-						&data[0]) != 0) {
+				     &data[0]) != 0)
 			test->flags |= ETH_TEST_FL_FAILED;
-		}
+
 		if (be_loopback_test(adapter, BE_PHY_LOOPBACK,
-						&data[1]) != 0) {
-			test->flags |= ETH_TEST_FL_FAILED;
-		}
-		if (be_loopback_test(adapter, BE_ONE_PORT_EXT_LOOPBACK,
-						&data[2]) != 0) {
+				     &data[1]) != 0)
 			test->flags |= ETH_TEST_FL_FAILED;
+
+		if (test->flags & ETH_TEST_FL_EXTERNAL_LB) {
+			if (be_loopback_test(adapter, BE_ONE_PORT_EXT_LOOPBACK,
+					     &data[2]) != 0)
+				test->flags |= ETH_TEST_FL_FAILED;
+			test->flags |= ETH_TEST_FL_EXTERNAL_LB_DONE;
 		}
 	}
 
Signature · 1 line
1.8.3.2
Acked-by on v2 1/1
#1 lore raw
Quoted 9 lines

-----Original Message-----
From: Ivan Vecera [mailto:[email protected]]
Sent: Wednesday, March 05, 2014 4:54 AM
To: [email protected]
Cc: Sathya Perla; Subramanian Seetharaman; Ajit Khaparde; [email protected]
Subject: [PATCH net-next v2] be2net: do external loopback test only when it is requested

Quoted 8 lines

v2: remove unnecessary braces from all 'loopback' if-blocks (thx Sergei)

Quoted 40 lines
---
 drivers/net/ethernet/emulex/benet/be_ethtool.c | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)
drivers/net/ethernet/emulex/benet/be_ethtool.c +9 -7
index cf09d8f..66759b6 100644
@@ -802,16 +802,18 @@ be_self_test(struct net_device *netdev, struct
 ethtool_test *test, u64 *data)
 
 	if (test->flags & ETH_TEST_FL_OFFLINE) {
 		if (be_loopback_test(adapter, BE_MAC_LOOPBACK,
-						&data[0]) != 0) {
+				     &data[0]) != 0)
 			test->flags |= ETH_TEST_FL_FAILED;
-		}
+
 		if (be_loopback_test(adapter, BE_PHY_LOOPBACK,
-						&data[1]) != 0) {
-			test->flags |= ETH_TEST_FL_FAILED;
-		}
-		if (be_loopback_test(adapter,
 BE_ONE_PORT_EXT_LOOPBACK,
-						&data[2]) != 0) {
+				     &data[1]) != 0)
 			test->flags |= ETH_TEST_FL_FAILED;
+
+		if (test->flags & ETH_TEST_FL_EXTERNAL_LB) {
+			if (be_loopback_test(adapter,
 BE_ONE_PORT_EXT_LOOPBACK,
+					     &data[2]) != 0)
+				test->flags |= ETH_TEST_FL_FAILED;
+			test->flags |= ETH_TEST_FL_EXTERNAL_LB_DONE;
drivers/net/ethernet/emulex/benet/be_ethtool.c +0 -1
 		}
 	}
 
--

1.8.3.2