Skip to contentSkip to conversation

be2net: do external loopback test only when it is requested

PATCH Superseded Ivan Vecera 3 participants 4 messages Mar 4, 2014 – Mar 5, 2014

Subsystems (3)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

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

---
 drivers/net/ethernet/emulex/benet/be_ethtool.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)
drivers/net/ethernet/emulex/benet/be_ethtool.c +6 -3
index cf09d8f..957848f 100644
@@ -809,9 +809,12 @@ be_self_test(struct net_device *netdev, struct ethtool_test *test, u64 *data)
 						&data[1]) != 0) {
 			test->flags |= ETH_TEST_FL_FAILED;
 		}
-		if (be_loopback_test(adapter, BE_ONE_PORT_EXT_LOOPBACK,
-						&data[2]) != 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 v1 1/1
#1 lore raw
Quoted 8 lines

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

Quoted 5 lines
Quoted 30 lines
---
 drivers/net/ethernet/emulex/benet/be_ethtool.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)
drivers/net/ethernet/emulex/benet/be_ethtool.c +6 -3
index cf09d8f..957848f 100644
@@ -809,9 +809,12 @@ be_self_test(struct net_device *netdev, struct
 ethtool_test *test, u64 *data)
 						&data[1]) != 0) {
 			test->flags |= ETH_TEST_FL_FAILED;
 		}
-		if (be_loopback_test(adapter,
 BE_ONE_PORT_EXT_LOOPBACK,
-						&data[2]) != 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

#2 lore raw
In reply to Ivan Vecera

Hello.

Quoted 15 lines · Ivan Vecera
---
  drivers/net/ethernet/emulex/benet/be_ethtool.c | 9 ++++++---
  1 file changed, 6 insertions(+), 3 deletions(-)
drivers/net/ethernet/emulex/benet/be_ethtool.c +0 -0
index cf09d8f..957848f 100644
@@ -809,9 +809,12 @@ be_self_test(struct net_device *netdev, struct ethtool_test *test, u64 *data)
  						&data[1]) != 0) {

drivers/net/ethernet/emulex/benet/be_ethtool.c be_self_test(struct net_device *netdev, struct ethtool_test *test, u64 *data) · line 816

Quoted 10 lines
drivers/net/ethernet/emulex/benet/be_ethtool.c +5 -3
  			test->flags |= ETH_TEST_FL_FAILED;
  		}
-		if (be_loopback_test(adapter, BE_ONE_PORT_EXT_LOOPBACK,
-						&data[2]) != 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;
+			}

{} not needed here, according to Documentation/CodingStyle. I'm surprised
scripts/checkpatch.pl passed, it used to catch those.

WBR, Sergei

#3 lore raw
Quoted 26 lines · Sergei Shtylyov

Hello.

Quoted 22 lines · Ivan Vecera
---
  drivers/net/ethernet/emulex/benet/be_ethtool.c | 9 ++++++---
  1 file changed, 6 insertions(+), 3 deletions(-)
drivers/net/ethernet/emulex/benet/be_ethtool.c +0 -3
index cf09d8f..957848f 100644
@@ -809,9 +809,12 @@ be_self_test(struct net_device *netdev, struct
 ethtool_test *test, u64 *data)
                          &data[1]) != 0) {
              test->flags |= ETH_TEST_FL_FAILED;
          }
-        if (be_loopback_test(adapter, BE_ONE_PORT_EXT_LOOPBACK,
-                        &data[2]) != 0) {
-            test->flags |= ETH_TEST_FL_FAILED;
Quoted 9 lines

drivers/net/ethernet/emulex/benet/be_ethtool.c be_self_test(struct net_device *netdev, struct ethtool_test *test, u64 *data) · line 816

Quoted 5 lines
drivers/net/ethernet/emulex/benet/be_ethtool.c +5 -0
+        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;
+            }

{} not needed here, according to Documentation/CodingStyle. I'm
surprised scripts/checkpatch.pl passed, it used to catch those.

I wanted to preserve the same look as for other prior loopback if-blocks. I will fix them all and resend v2.

Ivan