Skip to contentSkip to conversation

igb: Add I210 cable fault detection to self test

PATCH Superseded Aaron Sierra 3 participants 5 messages Feb 9, 2016 – Feb 23, 2016 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

PATCH v4 1/1 igb: Add I210 cable fault detection to self test

From: Joe Schultz <[email protected]>

Add an offline diagnostic test for the I210 internal PHY which checks for cable faults and reports the distance along the cable where the fault was detected. Fault types detected include open, short, and cross-pair short.

---
v2 - account for changes made by this patch in dev-queue:
drivers/net: get rid of unnecessary initializations in .get_drvinfo()
v3 - fix uninitialized variable compile warning
- remove unneeded igb_cable_fault_test_prep() function
- don't add unused define to e1000_defines.h
- only run cable diagnostic if link test fails
v4 - only set no-fault, link-present cable distance for I210

 drivers/net/ethernet/intel/igb/e1000_defines.h |  12 +-
 drivers/net/ethernet/intel/igb/igb_ethtool.c   | 186 ++++++++++++++++++++++++-
 2 files changed, 192 insertions(+), 6 deletions(-)
drivers/net/ethernet/intel/igb/e1000_defines.h +11 -1
index 240902e..707e1ba 100644
@@ -932,6 +932,7 @@
 #define I347AT4_PCDL1                  0x11 /* Pair 1 PHY Cable Diagnostics Length */
 #define I347AT4_PCDL2                  0x12 /* Pair 2 PHY Cable Diagnostics Length */
 #define I347AT4_PCDL3                  0x13 /* Pair 3 PHY Cable Diagnostics Length */
+#define I347AT4_PCDR                   0x14 /* PHY Cable Diagnostics Results */
 #define I347AT4_PCDC                   0x15 /* PHY Cable Diagnostics Control */
 #define I347AT4_PAGE_SELECT            0x16
 
@@ -952,7 +953,16 @@
 #define I347AT4_PSCR_DOWNSHIFT_8X     0x7000
 
 /* i347-AT4 PHY Cable Diagnostics Control */
-#define I347AT4_PCDC_CABLE_LENGTH_UNIT 0x0400 /* 0=cm 1=meters */
+#define I347AT4_PCDC_CABLE_LENGTH_UNIT	0x0400 /* 0=cm 1=meters */
+#define I347AT4_PCDC_CABLE_DIAG_STATUS	0x0800
+#define I347AT4_PCDC_DISABLE_CROSS_PAIR	0x2000
+#define I347AT4_PCDC_RUN_TEST		0x8000
+
+/* i347-AT4 PHY Cable Diagnostics Results */
+#define I347AT4_PCDR_CABLE_OK		0x0001 /* No faults detected on pair */
+#define I347AT4_PCDR_CABLE_OPEN		0x0002 /* Open pair detected */
+#define I347AT4_PCDR_CABLE_SHORT	0x0003 /* Shorted pair detected */
+#define I347AT4_PCDR_CABLE_CROSS_SHORT	0x0004 /* Cross-pair short detected */
 
 /* Marvell 1112 only registers */
 #define M88E1112_VCT_DSP_DISTANCE       0x001A
drivers/net/ethernet/intel/igb/igb_ethtool.c +181 -5

230 lines not on this page · raw message

Signature · 1 line
1.9.1
#2 lore raw

PATCH v4 1/1 igb: Add I210 cable fault detection to self test

Quoted 19 lines · Aaron Sierra

From: Joe Schultz <[email protected]>

Add an offline diagnostic test for the I210 internal PHY which checks for cable faults and reports the distance along the cable where the fault was detected. Fault types detected include open, short, and cross-pair short.

---
?v2 - account for changes made by this patch in dev-queue:
?? drivers/net: get rid of unnecessary initializations in .get_drvinfo()
?v3 - fix uninitialized variable compile warning ??? - remove unneeded igb_cable_fault_test_prep() function ??? - don't add unused define to e1000_defines.h ??? - only run cable diagnostic if link test fails ?v4 - only set no-fault, link-present cable distance for I210

Quoted 4 lines

?drivers/net/ethernet/intel/igb/e1000_defines.h |? 12 +- ?drivers/net/ethernet/intel/igb/igb_ethtool.c?? | 186
++++++++++++++++++++++++-
?2 files changed, 192 insertions(+), 6 deletions(-)

I try not to be a checkpatch.pl stickler, but your patch clearly has some style issues that checkpatch.pl complains about and need to be fixed. ?I have gone ahead and applied your patch to my next-queue tree (dev-queue branch) so that Aaron can test the functional changes of your patch.

So I will require a v5 to fix the coding style issues that
checkpatch.pl whines about, but before re-spinning your patch, lets
wait to see if Aaron finds any other issues with your patch.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: This is a digitally signed message part
URL: <http://lists.osuosl.org/pipermail/intel-wired-lan/attachments/20160209/b85b7fab/attachment-0001.asc>

#3 lore raw

PATCH v4 1/1 igb: Add I210 cable fault detection to self test

Quoted 37 lines

From: Kirsher, Jeffrey T
Sent: Tuesday, February 09, 2016 2:47 AM
To: Aaron Sierra; intel-wired-lan at lists.osuosl.org
Cc: Wyborny, Carolyn; Brown, Aaron F; Joe Schultz
Subject: Re: [PATCH v4] igb: Add I210 cable fault detection to self test

Quoted 19 lines · Aaron Sierra

From: Joe Schultz <[email protected]>

Add an offline diagnostic test for the I210 internal PHY which checks
for cable faults and reports the distance along the cable where the fault was detected. Fault types detected include open, short, and cross-pair short.

---
v2 - account for changes made by this patch in dev-queue:
drivers/net: get rid of unnecessary initializations in>
.get_drvinfo()
v3 - fix uninitialized variable compile warning
- remove unneeded igb_cable_fault_test_prep() function
- don't add unused define to e1000_defines.h
- only run cable diagnostic if link test fails
v4 - only set no-fault, link-present cable distance for I210

Quoted 4 lines

drivers/net/ethernet/intel/igb/e1000_defines.h |? 12 +-

 drivers/net/ethernet/intel/igb/igb_ethtool.c   | 186
++++++++++++++++++++++++-
 2 files changed, 192 insertions(+), 6 deletions(-)

I try not to be a checkpatch.pl stickler, but your patch clearly has some style issues that checkpatch.pl complains about and need to be fixed. I have gone ahead and applied your patch to my next-queue tree (dev-queue branch) so that Aaron can test the functional changes of your patch.

Quoted 3 lines

So I will require a v5 to fix the coding style issues that checkpatch.pl whines about, but before re-spinning your patch, lets wait to see if Aaron finds any other issues with your patch.

I no longer see the kernel panics on other parts with this patch, and functionally it seems good on all the parts I have scrounged up. Thanks.

But I still see "-1" for the Pair fault distance's when a good cable is connected and diags are run offline:
...

Pair D cable fault   (offline)   0
Pair A fault distance            -1
Pair B fault distance            -1
Pair C fault distance            -1
Pair D fault distance            -1
Pair A fault open                0

...

I'm not sure the intent here, but having something other than 0 looks / feels like an error to me, It's also confusing as those values come up as 0 if the diags are run with the online keyword with a valid cable connection. The diag session itself (ethtool -t ethX offline) returns 0 so the test as a whole is registering as passing.

#4 lore raw

PATCH v4 1/1 igb: Add I210 cable fault detection to self test

----- Original Message -----

Quoted 56 lines

From: "Aaron F Brown" <[email protected]>
Sent: Saturday, February 13, 2016 12:27:19 AM

Quoted 37 lines

From: Kirsher, Jeffrey T
Sent: Tuesday, February 09, 2016 2:47 AM
To: Aaron Sierra; intel-wired-lan at lists.osuosl.org
Cc: Wyborny, Carolyn; Brown, Aaron F; Joe Schultz
Subject: Re: [PATCH v4] igb: Add I210 cable fault detection to self test

Quoted 19 lines · Aaron Sierra

From: Joe Schultz <[email protected]>

Add an offline diagnostic test for the I210 internal PHY which checks
for cable faults and reports the distance along the cable where the fault was detected. Fault types detected include open, short, and cross-pair short.

---
v2 - account for changes made by this patch in dev-queue:
drivers/net: get rid of unnecessary initializations in>
.get_drvinfo()
v3 - fix uninitialized variable compile warning
- remove unneeded igb_cable_fault_test_prep() function
- don't add unused define to e1000_defines.h
- only run cable diagnostic if link test fails
v4 - only set no-fault, link-present cable distance for I210

Quoted 4 lines

drivers/net/ethernet/intel/igb/e1000_defines.h |? 12 +-

 drivers/net/ethernet/intel/igb/igb_ethtool.c   | 186
++++++++++++++++++++++++-
 2 files changed, 192 insertions(+), 6 deletions(-)

I try not to be a checkpatch.pl stickler, but your patch clearly has some style issues that checkpatch.pl complains about and need to be fixed. I have gone ahead and applied your patch to my next-queue tree (dev-queue branch) so that Aaron can test the functional changes of your patch.

Quoted 3 lines

So I will require a v5 to fix the coding style issues that checkpatch.pl whines about, but before re-spinning your patch, lets wait to see if Aaron finds any other issues with your patch.

I no longer see the kernel panics on other parts with this patch, and functionally it seems good on all the parts I have scrounged up. Thanks.

But I still see "-1" for the Pair fault distance's when a good cable is connected and diags are run offline:
...

Pair D cable fault   (offline)   0
Pair A fault distance            -1
Pair B fault distance            -1
Pair C fault distance            -1
Pair D fault distance            -1
Pair A fault open                0
Quoted 4 lines

...

I'm not sure the intent here, but having something other than 0 looks / feels like an error to me,

I wanted to avoid using values for the fault distance that could reasonably be misinterpreted as presence of a fault. For instance, if no cable is connected, open faults should be detected on all pairs. The distance to those faults will be 0 because the trace lengths to the connector are almost certainly shorter than 1 meter. If link is present, fault distance should really be undefined, but is displayed as a signed integer.

Quoted 4 lines

It's also confusing as those values come up as 0 if the diags are run with the online keyword with a valid cable connection.
The diag session itself (ethtool -t ethX offline) returns 0 so the test as a whole is registering as passing.

I can see this either way and defaulting to zero would be easier.

This difference in result output is unintentional, but this leads me to wonder what reasonable output for the online case should look like, since none of the fault tests will be run in that case. I think these strings should include an (offline) tag, like the original tests.

In order to do that I'm inclined to merge inter and intra pair shorts into a single short output, like this:

Register test         (offline)
Eeprom test           (offline)
Interrupt test        (offline)
Loopback test         (offline)
Link test          (on/offline)
Pair A cable fault    (offline)
Pair B cable fault    (offline)
Pair C cable fault    (offline)
Pair D cable fault    (offline)

Pair A fault distance (offline)
Pair B fault distance (offline)
Pair C fault distance (offline)
Pair D fault distance (offline)

Pair A fault open     (offline)
Pair B fault open     (offline)
Pair C fault open     (offline)
Pair D fault open     (offline)
Pair A fault short    (offline)
Pair B fault short    (offline)
Pair C fault short    (offline)
Pair D fault short    (offline)

Please let me know what you think.

-Aaron S.

#5 lore raw

PATCH v4 1/1 igb: Add I210 cable fault detection to self test

Quoted 49 lines

-----Original Message-----
From: Aaron Sierra [mailto:asierra at xes-inc.com]
Sent: Friday, February 19, 2016 10:05 AM
To: Brown, Aaron F <[email protected]>
Cc: Kirsher, Jeffrey T <[email protected]>; intel-wired- lan at lists.osuosl.org; Wyborny, Carolyn <[email protected]>; Joe Schultz <[email protected]>
Subject: Re: [PATCH v4] igb: Add I210 cable fault detection to self test

----- Original Message -----

Quoted 32 lines

From: "Aaron F Brown" <[email protected]>
Sent: Saturday, February 13, 2016 12:27:19 AM

Quoted 7 lines

From: Kirsher, Jeffrey T
Sent: Tuesday, February 09, 2016 2:47 AM
To: Aaron Sierra; intel-wired-lan at lists.osuosl.org
Cc: Wyborny, Carolyn; Brown, Aaron F; Joe Schultz
Subject: Re: [PATCH v4] igb: Add I210 cable fault detection to self test

Quoted 12 lines
Quoted 11 lines · Aaron Sierra

From: Joe Schultz <[email protected]>

Add an offline diagnostic test for the I210 internal PHY which
checks for cable faults and reports the distance along the cable where the fault was detected. Fault types detected include open, short, and cross-pair short.

---
...

But I still see "-1" for the Pair fault distance's when a good cable is connected and diags are run offline:
...

Pair D cable fault   (offline)   0
Pair A fault distance            -1
Pair B fault distance            -1
Pair C fault distance            -1
Pair D fault distance            -1
Pair A fault open                0
Quoted 4 lines

...

I'm not sure the intent here, but having something other than 0 looks / feels like an error to me,

Quoted 6 lines

I wanted to avoid using values for the fault distance that could reasonably be misinterpreted as presence of a fault. For instance, if no cable is connected, open faults should be detected on all pairs. The distance to those faults will be 0 because the trace lengths to the connector are almost certainly shorter than 1 meter. If link is present, fault distance should really be undefined, but is displayed as a signed integer.

That make sense, and I tend to agree. Just that the Unix convention for 0 as passed / returned properly is so ingrained in me that my first instinct is something failed when I get something other than 0 back.

Quoted 11 lines
Quoted 5 lines

It's also confusing as those values come up as 0 if the diags are run with the online keyword with a valid cable connection.
The diag session itself (ethtool -t ethX offline) returns 0 so the test as a whole is registering as passing.

I can see this either way and defaulting to zero would be easier.

This difference in result output is unintentional, but this leads me to wonder what reasonable output for the online case should look like, since none of the fault tests will be run in that case.

I'm not really sure, but I feel it should be consistent with the results of an offline test that is run with a good cable attached. Anyone out there have an opinion on this and want to weigh in?

Quoted 2 lines

I think these strings should include an
(offline) tag, like the original tests.

I agree, the offline tag makes sense.

Would it be possible to suppress the fault distance messages if no fault is found? I'm not all that familiar with ethtool's inner workings.

Quoted 26 lines

In order to do that I'm inclined to merge inter and intra pair shorts into a single short output, like this:

Register test         (offline)
Eeprom test           (offline)
Interrupt test        (offline)
Loopback test         (offline)
Link test          (on/offline)
Pair A cable fault    (offline)
Pair B cable fault    (offline)
Pair C cable fault    (offline)
Pair D cable fault    (offline)

Pair A fault distance (offline)
Pair B fault distance (offline)
Pair C fault distance (offline)
Pair D fault distance (offline)

Pair A fault open     (offline)
Pair B fault open     (offline)
Pair C fault open     (offline)
Pair D fault open     (offline)
Pair A fault short    (offline)
Pair B fault short    (offline)
Pair C fault short    (offline)
Pair D fault short    (offline)
Quoted 1 line

Please let me know what you think.

I think that's just a matter of how much info you want to show and how you envision people using the info. If differentiating between inter and intra is likely to help someone track a problem down by all means keep both. If you expect people to simply toss the cable and try a new one including both forms is probably just extra noise.

Thanks Aaron B.