diff mbox

[infiniband-diags,2/6] libibmad/dump.c: Add HDR support for PortInfo LinkSpeedExt* fields

Message ID 41adffa2-8e7e-20da-19d6-523e89bca9a8@dev.mellanox.co.il (mailing list archive)
State Accepted, archived
Delegated to: Ira Weiny
Headers show

Commit Message

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

Signed-off-by: Hal Rosenstock <hal@mellanox.com>
---
 libibmad/src/dump.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
diff mbox

Patch

diff --git a/libibmad/src/dump.c b/libibmad/src/dump.c
index 1f41e62..98d5a34 100644
--- a/libibmad/src/dump.c
+++ b/libibmad/src/dump.c
@@ -336,6 +336,9 @@  void mad_dump_linkspeedext(char *buf, int bufsz, void *val, int valsz)
 	case 2:
 		snprintf(buf, bufsz, "25.78125 Gbps");
 		break;
+	case 4:
+		snprintf(buf, bufsz, "53.125 Gbps");
+		break;
 	default:
 		snprintf(buf, bufsz, "undefined (%d)", speed);
 		break;
@@ -355,13 +358,16 @@  static void dump_linkspeedext(char *buf, int bufsz, int speed)
 		n += snprintf(buf + n, bufsz - n, "14.0625 Gbps or ");
 	if (n < bufsz && speed & 0x2)
 		n += snprintf(buf + n, bufsz - n, "25.78125 Gbps or ");
+	if (n < bufsz && speed & 0x4)
+		n += snprintf(buf + n, bufsz - n, "53.125 Gbps or ");
+
 	if (n >= bufsz) {
 		if (bufsz > 3)
 			buf[n - 4] = '\0';
 		return;
 	}
 
-	if (speed >> 2) {
+	if (speed >> 3) {
 		n += snprintf(buf + n, bufsz - n, "undefined (%d)", speed);
 		return;
 	} else if (bufsz > 3)