diff mbox

[infiniband-diags,5/6,perfquery.c,ibdiag_common.h] : Add support for HDR RS-FEC

Message ID ecd315f7-9e91-b957-54a0-4be10d5a766a@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
HDR uses different RS-FEC. Original RS-FEC is RS(528,514) and is
bit 2 in FECMode fields and value 2 in FECModeActive field.
HDR uses RS(544,514) which is bit 4 in HDRFECMode fields and
value 4 in FECModeActive field.

Per MgtWG comments #9367 and #9368

Signed-off-by: Hal Rosenstock <hal@mellanox.com>
---
 include/ibdiag_common.h | 4 ++++
 src/perfquery.c         | 3 ++-
 2 files changed, 6 insertions(+), 1 deletion(-)
diff mbox

Patch

diff --git a/include/ibdiag_common.h b/include/ibdiag_common.h
index b8c5987..ae93ba3 100644
--- a/include/ibdiag_common.h
+++ b/include/ibdiag_common.h
@@ -114,6 +114,10 @@  extern char *ibd_nd_format;
 #define IB_PORT_EXT_LOW_LATENCY_RS_FEC_MODE_ACTIVE (CL_HTON16(0x0003))
 #endif
 
+#ifndef IB_PORT_EXT_RS_FEC2_MODE_ACTIVE
+#define IB_PORT_EXT_RS_FEC2_MODE_ACTIVE (CL_HTON16(0x0004))
+#endif
+
 /* SM PortInfoExtended CapabilityMask Bits */
 #ifndef IB_PORT_EXT_CAP_IS_FEC_MODE_SUPPORTED
 #define IB_PORT_EXT_CAP_IS_FEC_MODE_SUPPORTED (CL_HTON32(0x00000001))
diff --git a/src/perfquery.c b/src/perfquery.c
index 6bc4d9c..19d4273 100644
--- a/src/perfquery.c
+++ b/src/perfquery.c
@@ -571,7 +571,8 @@  static uint8_t is_rsfec_mode_active(ib_portid_t * portid, int port,
 				 &fec_mode_active);
 		if((pie_capmask &
 		    CL_NTOH32(IB_PORT_EXT_CAP_IS_FEC_MODE_SUPPORTED)) &&
-		   (CL_NTOH16(IB_PORT_EXT_RS_FEC_MODE_ACTIVE) == (fec_mode_active & 0xffff)))
+		   ((CL_NTOH16(IB_PORT_EXT_RS_FEC_MODE_ACTIVE) == (fec_mode_active & 0xffff)) ||
+                    (CL_NTOH16(IB_PORT_EXT_RS_FEC2_MODE_ACTIVE) == (fec_mode_active & 0xffff))))
 			return 1;
 	}