diff mbox series

[rdma-core,2/3] ibdiags: Extend support of NDR rates

Message ID 20211229085502.167651-3-yishaih@nvidia.com (mailing list archive)
State Not Applicable
Headers show
Series Add NDR support | expand

Commit Message

Yishai Hadas Dec. 29, 2021, 8:55 a.m. UTC
From: Maher Sanalla <msanalla@nvidia.com>

NDR(106.25 Gbps) support exposed new data rates:
800 Gbps - NDR 8x.
1200 Gbps - NDR 12x.

The NDR support bit from PortInfo.CapabilityMask2 was added to libibmad
as well as the new link speeds mentioned above.

validate_extended_speed() function in infiniband-diags was adjusted to
validate NDR speed.

Reference: IB Spec Release 1.5

Signed-off-by: Maher Sanalla <msanalla@nvidia.com>
Signed-off-by: Yishai Hadas <yishaih@nvidia.com>
---
 infiniband-diags/ibportstate.c | 8 +++++++-
 libibmad/iba_types.h           | 3 +++
 2 files changed, 10 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/infiniband-diags/ibportstate.c b/infiniband-diags/ibportstate.c
index 7f3afb8..5319e68 100644
--- a/infiniband-diags/ibportstate.c
+++ b/infiniband-diags/ibportstate.c
@@ -353,7 +353,13 @@  static void validate_speed(int peerspeed, int lsa)
 
 static void validate_extended_speed(int peerespeed, int lsea)
 {
-	if ((espeed & peerespeed & 0x4)) {
+
+	if ((espeed & peerespeed & 0x8)) {
+		if (lsea != 8)
+			IBWARN
+			    ("Peer ports operating at active extended speed %d rather than 8 (106.25 Gbps)",
+			     lsea);
+	} else if ((espeed & peerespeed & 0x4)) {
 		if (lsea != 4)
 			IBWARN
 			    ("Peer ports operating at active extended speed %d rather than 4 (53.125 Gbps)",
diff --git a/libibmad/iba_types.h b/libibmad/iba_types.h
index 0805aa9..f0c15ef 100644
--- a/libibmad/iba_types.h
+++ b/libibmad/iba_types.h
@@ -749,6 +749,7 @@  typedef struct {
 #define IB_PORT_CAP2_IS_SWITCH_PORT_STATE_TBL_SUPP htobe16(0x0008)
 #define IB_PORT_CAP2_IS_LINK_WIDTH_2X_SUPPORTED htobe16(0x0010)
 #define IB_PORT_CAP2_IS_LINK_SPEED_HDR_SUPPORTED htobe16(0x0020)
+#define IB_PORT_CAP2_IS_LINK_SPEED_NDR_SUPPORTED htobe16(0x0400)
 typedef struct {
 	__be32 cap_mask;
 	__be16 fec_mode_active;
@@ -803,6 +804,8 @@  typedef struct {
 #define IB_PATH_RECORD_RATE_50_GBS 20
 #define IB_PATH_RECORD_RATE_400_GBS 21
 #define IB_PATH_RECORD_RATE_600_GBS 22
+#define IB_PATH_RECORD_RATE_800_GBS 23
+#define IB_PATH_RECORD_RATE_1200_GBS 24
 #define FDR10 0x01
 typedef struct {
 	uint8_t resvd1[3];