diff mbox

[infiniband-diags,4/6] ib[netdiscover portstate].c: Add HDR support

Message ID 5e17e529-a54e-e425-eb89-dbce256bc8f1@dev.mellanox.co.il (mailing list archive)
State Accepted, archived
Delegated to: Ira Weiny
Headers show

Commit Message

Hal Rosenstock Nov. 28, 2017, 10:12 p.m. UTC
Per MgtWG comments #9364-9366

Signed-off-by: Hal Rosenstock <hal@mellanox.com>
---
 src/ibnetdiscover.c | 3 +++
 src/ibportstate.c   | 7 ++++++-
 2 files changed, 9 insertions(+), 1 deletion(-)
diff mbox

Patch

diff --git a/src/ibnetdiscover.c b/src/ibnetdiscover.c
index 68374a2..6f360bb 100644
--- a/src/ibnetdiscover.c
+++ b/src/ibnetdiscover.c
@@ -115,6 +115,9 @@  char *dump_linkspeedext_compat(uint32_t espeed, uint32_t speed, uint32_t fdr10)
 	case 2:
 		return ("EDR");
 		break;
+	case 4:
+		return ("HDR");
+		break;
 	}
 	return ("???");
 }
diff --git a/src/ibportstate.c b/src/ibportstate.c
index 06bd5d2..6b78fa7 100644
--- a/src/ibportstate.c
+++ b/src/ibportstate.c
@@ -356,7 +356,12 @@  static void validate_speed(int speed, int peerspeed, int lsa)
 
 static void validate_extended_speed(int espeed, int peerespeed, int lsea)
 {
-	if ((espeed & peerespeed & 0x2)) {
+	if ((espeed & peerespeed & 0x4)) {
+		if (lsea != 4)
+			IBWARN
+			    ("Peer ports operating at active extended speed %d rather than 4 (53.125 Gbps)",
+			     lsea);
+	} else if ((espeed & peerespeed & 0x2)) {
 		if (lsea != 2)
 			IBWARN
 			    ("Peer ports operating at active extended speed %d rather than 2 (25.78125 Gbps)",