Skip to contentSkip to conversation

libibmad: Support for Mellanox vendor specific ExtendedPortInfo SM class MAD

PATCH Superseded Hal Rosenstock 2 participants 4 messages Jul 22, 2011 – Jul 23, 2011 3 messages not in the archive InfiniBand

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/2 libibmad: Support for Mellanox vendor specific ExtendedPortInfo SM class MAD

for FDR10 operation

---
Changes since v1:
Rebased

include/infiniband/mad.h +14 -2
index b1258bd..60bc0d8 100644
@@ -141,7 +141,9 @@ enum SMI_ATTR_ID {
 	IB_ATTR_VENDORMADSTBL = 0x1d,
 	IB_ATTR_SMINFO = 0x20,
 
-	IB_ATTR_LAST
+	IB_ATTR_LAST,
+
+	IB_ATTR_MLNX_EXT_PORT_INFO = 0xff90,
 };
 
 enum SA_ATTR_ID {
@@ -1023,6 +1025,15 @@ enum MAD_FIELDS {
 	IB_PC_VL_XMIT_TIME_CONG14,
 	IB_PC_VL_XMIT_TIME_CONG_LAST_F,
 
+	/*
+	 * Mellanox ExtendedPortInfo fields
+	 */
+	IB_MLNX_EXT_PORT_STATE_CHG_ENABLE_F,
+	IB_MLNX_EXT_PORT_LINK_SPEED_SUPPORTED_F,
+	IB_MLNX_EXT_PORT_LINK_SPEED_ENABLED_F,
+	IB_MLNX_EXT_PORT_LINK_SPEED_ACTIVE_F,
+	IB_MLNX_EXT_PORT_LAST_F,
+
 	IB_FIELD_LAST_		/* must be last */
 };
 
@@ -1361,7 +1372,8 @@ MAD_EXPORT ib_mad_dump_fn
     mad_dump_perfcounters_port_vl_xmit_flow_ctl_update_errors, mad_dump_perfcounters_port_vl_xmit_wait_counters,
     mad_dump_perfcounters_sw_port_vl_congestion, mad_dump_perfcounters_rcv_con_ctrl,
     mad_dump_perfcounters_sl_rcv_fecn, mad_dump_perfcounters_sl_rcv_becn,
-    mad_dump_perfcounters_xmit_con_ctrl, mad_dump_perfcounters_vl_xmit_time_cong;
+    mad_dump_perfcounters_xmit_con_ctrl, mad_dump_perfcounters_vl_xmit_time_cong,
+    mad_dump_mlnx_ext_port_info;
 
 MAD_EXPORT void mad_dump_fields(char *buf, int bufsz, void *val, int valsz,
 				int start, int end);
src/dump.c +6 -0
index 52b2010..29fb742 100644
@@ -957,6 +957,12 @@ void mad_dump_perfcounters_vl_xmit_time_cong(char *buf, int bufsz, void *val, in
 		     IB_PC_VL_XMIT_TIME_CONG_LAST_F);
 }
 
+void mad_dump_mlnx_ext_port_info(char *buf, int bufsz, void *val, int valsz)
+{
+	_dump_fields(buf, bufsz, val, IB_MLNX_EXT_PORT_STATE_CHG_ENABLE_F,
+		     IB_MLNX_EXT_PORT_LAST_F);
+}
+
 void xdump(FILE * file, char *msg, void *p, int size)
 {
 #define HEX(x)  ((x) < 10 ? '0' + (x) : 'a' + ((x) -10))
src/fields.c +9 -0
index 23947dc..04c60c7 100644
@@ -772,6 +772,15 @@ static const ib_field_t ib_mad_f[] = {
 	{480, 32, "PortVLXmitTimeCong14", mad_dump_uint},
 	{0, 0},			/* IB_PC_VL_XMIT_TIME_CONG_LAST_F */
 
+	/*
+	 * Mellanox ExtendedPortInfo fields
+	 */
+	{BITSOFFS(24, 8), "StateChangeEnable", mad_dump_hex},
+	{BITSOFFS(56, 8), "LinkSpeedSupported", mad_dump_hex},
+	{BITSOFFS(88, 8), "LinkSpeedEnabled", mad_dump_hex},
+	{BITSOFFS(120, 8), "LinkSpeedActive", mad_dump_hex},
+	{0, 0},			/* IB_MLNX_EXT_PORT_LAST_F */
+
 	{0, 0}			/* IB_FIELD_LAST_ */
 
 };
src/libibmad.map +1 -0
index f0b42a5..508c18b 100644
@@ -18,6 +18,7 @@ IBMAD_1.3 {
 		mad_dump_linkwidth;
 		mad_dump_linkwidthen;
 		mad_dump_linkwidthsup;
+		mad_dump_mlnx_ext_port_info;
 		mad_dump_mtu;
 		mad_dump_node_type;
 		mad_dump_nodedesc;

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

#2 lore raw
In reply to a message not in the archive

I don't know if it would be more appropriate in ib_types.h or here but what are the values for the speeds indicated. I assume 0 is _not_ FDR10 but what is FDR10, 0x01? Also with that define the dump function could be more than "mad_dump_hex".

Ira

Quoted 102 lines · On Fri, 22 Jul 2011 04:22:03 -0700 Hal Rosenstock…

for FDR10 operation

---
Changes since v1:
Rebased

include/infiniband/mad.h +14 -2
index b1258bd..60bc0d8 100644
@@ -141,7 +141,9 @@ enum SMI_ATTR_ID {
 	IB_ATTR_VENDORMADSTBL = 0x1d,
 	IB_ATTR_SMINFO = 0x20,
 
-	IB_ATTR_LAST
+	IB_ATTR_LAST,
+
+	IB_ATTR_MLNX_EXT_PORT_INFO = 0xff90,
 };
 
 enum SA_ATTR_ID {
@@ -1023,6 +1025,15 @@ enum MAD_FIELDS {
 	IB_PC_VL_XMIT_TIME_CONG14,
 	IB_PC_VL_XMIT_TIME_CONG_LAST_F,
 
+	/*
+	 * Mellanox ExtendedPortInfo fields
+	 */
+	IB_MLNX_EXT_PORT_STATE_CHG_ENABLE_F,
+	IB_MLNX_EXT_PORT_LINK_SPEED_SUPPORTED_F,
+	IB_MLNX_EXT_PORT_LINK_SPEED_ENABLED_F,
+	IB_MLNX_EXT_PORT_LINK_SPEED_ACTIVE_F,
+	IB_MLNX_EXT_PORT_LAST_F,
+
 	IB_FIELD_LAST_		/* must be last */
 };
 
@@ -1361,7 +1372,8 @@ MAD_EXPORT ib_mad_dump_fn
     mad_dump_perfcounters_port_vl_xmit_flow_ctl_update_errors, mad_dump_perfcounters_port_vl_xmit_wait_counters,
     mad_dump_perfcounters_sw_port_vl_congestion, mad_dump_perfcounters_rcv_con_ctrl,
     mad_dump_perfcounters_sl_rcv_fecn, mad_dump_perfcounters_sl_rcv_becn,
-    mad_dump_perfcounters_xmit_con_ctrl, mad_dump_perfcounters_vl_xmit_time_cong;
+    mad_dump_perfcounters_xmit_con_ctrl, mad_dump_perfcounters_vl_xmit_time_cong,
+    mad_dump_mlnx_ext_port_info;
 
 MAD_EXPORT void mad_dump_fields(char *buf, int bufsz, void *val, int valsz,
 				int start, int end);
src/dump.c +6 -0
index 52b2010..29fb742 100644
@@ -957,6 +957,12 @@ void mad_dump_perfcounters_vl_xmit_time_cong(char *buf, int bufsz, void *val, in
 		     IB_PC_VL_XMIT_TIME_CONG_LAST_F);
 }
 
+void mad_dump_mlnx_ext_port_info(char *buf, int bufsz, void *val, int valsz)
+{
+	_dump_fields(buf, bufsz, val, IB_MLNX_EXT_PORT_STATE_CHG_ENABLE_F,
+		     IB_MLNX_EXT_PORT_LAST_F);
+}
+
 void xdump(FILE * file, char *msg, void *p, int size)
 {
 #define HEX(x)  ((x) < 10 ? '0' + (x) : 'a' + ((x) -10))
src/fields.c +9 -0
index 23947dc..04c60c7 100644
@@ -772,6 +772,15 @@ static const ib_field_t ib_mad_f[] = {
 	{480, 32, "PortVLXmitTimeCong14", mad_dump_uint},
 	{0, 0},			/* IB_PC_VL_XMIT_TIME_CONG_LAST_F */
 
+	/*
+	 * Mellanox ExtendedPortInfo fields
+	 */
+	{BITSOFFS(24, 8), "StateChangeEnable", mad_dump_hex},
+	{BITSOFFS(56, 8), "LinkSpeedSupported", mad_dump_hex},
+	{BITSOFFS(88, 8), "LinkSpeedEnabled", mad_dump_hex},
+	{BITSOFFS(120, 8), "LinkSpeedActive", mad_dump_hex},
+	{0, 0},			/* IB_MLNX_EXT_PORT_LAST_F */
+
 	{0, 0}			/* IB_FIELD_LAST_ */
 
 };
src/libibmad.map +1 -1
index f0b42a5..508c18b 100644
@@ -18,6 +18,7 @@ IBMAD_1.3 {
 		mad_dump_linkwidth;
 		mad_dump_linkwidthen;
 		mad_dump_linkwidthsup;
+		mad_dump_mlnx_ext_port_info;
 		mad_dump_mtu;
 		mad_dump_node_type;
 		mad_dump_nodedesc;
--

To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

Signature · 9 lines
Ira Weiny
Math Programmer/Computer Scientist
Lawrence Livermore National Lab
925-423-8008
[email protected]
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#4 lore raw
In reply to a message not in the archive
Quoted 1 line · Ira Weiny

I don't know if it would be more appropriate in ib_types.h or here but what are the values for the speeds indicated.

Typically there has been duplication between libibmad and ib_types.h.

Quoted 1 line

I assume 0 is _not_ FDR10 but what is FDR10, 0x01?

Yes; that's all that's currrently defined. The rest is reserved.

Quoted 1 line

Also with that define the dump function could be more than "mad_dump_hex".

I thought just hex dumping was sufficient for now. Other fields are done this way. Does it really need a pretty print ?

-- Hal

Quoted 100 lines

Ira

Quoted 94 lines · On Fri, 22 Jul 2011 04:22:03 -0700 Hal Rosenstock…

for FDR10 operation

---
Changes since v1:
Rebased

include/infiniband/mad.h +14 -2
index b1258bd..60bc0d8 100644
@@ -141,7 +141,9 @@ enum SMI_ATTR_ID {
 	IB_ATTR_VENDORMADSTBL = 0x1d,
 	IB_ATTR_SMINFO = 0x20,
 
-	IB_ATTR_LAST
+	IB_ATTR_LAST,
+
+	IB_ATTR_MLNX_EXT_PORT_INFO = 0xff90,
 };
 
 enum SA_ATTR_ID {
@@ -1023,6 +1025,15 @@ enum MAD_FIELDS {
 	IB_PC_VL_XMIT_TIME_CONG14,
 	IB_PC_VL_XMIT_TIME_CONG_LAST_F,
 
+	/*
+	 * Mellanox ExtendedPortInfo fields
+	 */
+	IB_MLNX_EXT_PORT_STATE_CHG_ENABLE_F,
+	IB_MLNX_EXT_PORT_LINK_SPEED_SUPPORTED_F,
+	IB_MLNX_EXT_PORT_LINK_SPEED_ENABLED_F,
+	IB_MLNX_EXT_PORT_LINK_SPEED_ACTIVE_F,
+	IB_MLNX_EXT_PORT_LAST_F,
+
 	IB_FIELD_LAST_		/* must be last */
 };
 
@@ -1361,7 +1372,8 @@ MAD_EXPORT ib_mad_dump_fn
     mad_dump_perfcounters_port_vl_xmit_flow_ctl_update_errors, mad_dump_perfcounters_port_vl_xmit_wait_counters,
     mad_dump_perfcounters_sw_port_vl_congestion, mad_dump_perfcounters_rcv_con_ctrl,
     mad_dump_perfcounters_sl_rcv_fecn, mad_dump_perfcounters_sl_rcv_becn,
-    mad_dump_perfcounters_xmit_con_ctrl, mad_dump_perfcounters_vl_xmit_time_cong;
+    mad_dump_perfcounters_xmit_con_ctrl, mad_dump_perfcounters_vl_xmit_time_cong,
+    mad_dump_mlnx_ext_port_info;
 
 MAD_EXPORT void mad_dump_fields(char *buf, int bufsz, void *val, int valsz,
 				int start, int end);
src/dump.c +6 -0
index 52b2010..29fb742 100644
@@ -957,6 +957,12 @@ void mad_dump_perfcounters_vl_xmit_time_cong(char *buf, int bufsz, void *val, in
 		     IB_PC_VL_XMIT_TIME_CONG_LAST_F);
 }
 
+void mad_dump_mlnx_ext_port_info(char *buf, int bufsz, void *val, int valsz)
+{
+	_dump_fields(buf, bufsz, val, IB_MLNX_EXT_PORT_STATE_CHG_ENABLE_F,
+		     IB_MLNX_EXT_PORT_LAST_F);
+}
+
 void xdump(FILE * file, char *msg, void *p, int size)
 {
 #define HEX(x)  ((x) < 10 ? '0' + (x) : 'a' + ((x) -10))
src/fields.c +9 -0
index 23947dc..04c60c7 100644
@@ -772,6 +772,15 @@ static const ib_field_t ib_mad_f[] = {
 	{480, 32, "PortVLXmitTimeCong14", mad_dump_uint},
 	{0, 0},			/* IB_PC_VL_XMIT_TIME_CONG_LAST_F */
 
+	/*
+	 * Mellanox ExtendedPortInfo fields
+	 */
+	{BITSOFFS(24, 8), "StateChangeEnable", mad_dump_hex},
+	{BITSOFFS(56, 8), "LinkSpeedSupported", mad_dump_hex},
+	{BITSOFFS(88, 8), "LinkSpeedEnabled", mad_dump_hex},
+	{BITSOFFS(120, 8), "LinkSpeedActive", mad_dump_hex},
+	{0, 0},			/* IB_MLNX_EXT_PORT_LAST_F */
+
 	{0, 0}			/* IB_FIELD_LAST_ */
 
 };
src/libibmad.map +0 -0
index f0b42a5..508c18b 100644
@@ -18,6 +18,7 @@ IBMAD_1.3 {
 		mad_dump_linkwidth;
 		mad_dump_linkwidthen;
 		mad_dump_linkwidthsup;
Quoted 10 lines
Quoted 8 lines
src/libibmad.map +1 -1
+		mad_dump_mlnx_ext_port_info;
 		mad_dump_mtu;
 		mad_dump_node_type;
 		mad_dump_nodedesc;
--

To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

#6 lore raw
In reply to a message not in the archive
Quoted 4 lines · On Fri, 22 Jul 2011 16:55:17 -0700 Hal Rosenstock…
Quoted 1 line · Ira Weiny

I don't know if it would be more appropriate in ib_types.h or here but what are the values for the speeds indicated.

Typically there has been duplication between libibmad and ib_types.h.

<sigh> I know... :-(

Quoted 9 lines
Quoted 2 lines

I assume 0 is _not_ FDR10 but what is FDR10, 0x01?

Yes; that's all that's currrently defined. The rest is reserved.

Quoted 1 line

Also with that define the dump function could be more than "mad_dump_hex".

I thought just hex dumping was sufficient for now. Other fields are done this way. Does it really need a pretty print ?

The pretty print is not important. But I think the enums should be there. Just for completeness.

Ira

Quoted 114 lines

-- Hal

Quoted 110 lines

Ira

Quoted 102 lines · On Fri, 22 Jul 2011 04:22:03 -0700 Hal Rosenstock…

for FDR10 operation

---
Changes since v1:
Rebased

include/infiniband/mad.h +14 -2
index b1258bd..60bc0d8 100644
@@ -141,7 +141,9 @@ enum SMI_ATTR_ID {
 	IB_ATTR_VENDORMADSTBL = 0x1d,
 	IB_ATTR_SMINFO = 0x20,
 
-	IB_ATTR_LAST
+	IB_ATTR_LAST,
+
+	IB_ATTR_MLNX_EXT_PORT_INFO = 0xff90,
 };
 
 enum SA_ATTR_ID {
@@ -1023,6 +1025,15 @@ enum MAD_FIELDS {
 	IB_PC_VL_XMIT_TIME_CONG14,
 	IB_PC_VL_XMIT_TIME_CONG_LAST_F,
 
+	/*
+	 * Mellanox ExtendedPortInfo fields
+	 */
+	IB_MLNX_EXT_PORT_STATE_CHG_ENABLE_F,
+	IB_MLNX_EXT_PORT_LINK_SPEED_SUPPORTED_F,
+	IB_MLNX_EXT_PORT_LINK_SPEED_ENABLED_F,
+	IB_MLNX_EXT_PORT_LINK_SPEED_ACTIVE_F,
+	IB_MLNX_EXT_PORT_LAST_F,
+
 	IB_FIELD_LAST_		/* must be last */
 };
 
@@ -1361,7 +1372,8 @@ MAD_EXPORT ib_mad_dump_fn
     mad_dump_perfcounters_port_vl_xmit_flow_ctl_update_errors, mad_dump_perfcounters_port_vl_xmit_wait_counters,
     mad_dump_perfcounters_sw_port_vl_congestion, mad_dump_perfcounters_rcv_con_ctrl,
     mad_dump_perfcounters_sl_rcv_fecn, mad_dump_perfcounters_sl_rcv_becn,
-    mad_dump_perfcounters_xmit_con_ctrl, mad_dump_perfcounters_vl_xmit_time_cong;
+    mad_dump_perfcounters_xmit_con_ctrl, mad_dump_perfcounters_vl_xmit_time_cong,
+    mad_dump_mlnx_ext_port_info;
 
 MAD_EXPORT void mad_dump_fields(char *buf, int bufsz, void *val, int valsz,
 				int start, int end);
src/dump.c +6 -0
index 52b2010..29fb742 100644
@@ -957,6 +957,12 @@ void mad_dump_perfcounters_vl_xmit_time_cong(char *buf, int bufsz, void *val, in
 		     IB_PC_VL_XMIT_TIME_CONG_LAST_F);
 }
 
+void mad_dump_mlnx_ext_port_info(char *buf, int bufsz, void *val, int valsz)
+{
+	_dump_fields(buf, bufsz, val, IB_MLNX_EXT_PORT_STATE_CHG_ENABLE_F,
+		     IB_MLNX_EXT_PORT_LAST_F);
+}
+
 void xdump(FILE * file, char *msg, void *p, int size)
 {
 #define HEX(x)  ((x) < 10 ? '0' + (x) : 'a' + ((x) -10))
src/fields.c +9 -0
index 23947dc..04c60c7 100644
@@ -772,6 +772,15 @@ static const ib_field_t ib_mad_f[] = {
 	{480, 32, "PortVLXmitTimeCong14", mad_dump_uint},
 	{0, 0},			/* IB_PC_VL_XMIT_TIME_CONG_LAST_F */
 
+	/*
+	 * Mellanox ExtendedPortInfo fields
+	 */
+	{BITSOFFS(24, 8), "StateChangeEnable", mad_dump_hex},
+	{BITSOFFS(56, 8), "LinkSpeedSupported", mad_dump_hex},
+	{BITSOFFS(88, 8), "LinkSpeedEnabled", mad_dump_hex},
+	{BITSOFFS(120, 8), "LinkSpeedActive", mad_dump_hex},
+	{0, 0},			/* IB_MLNX_EXT_PORT_LAST_F */
+
 	{0, 0}			/* IB_FIELD_LAST_ */
 
 };
src/libibmad.map +1 -1
index f0b42a5..508c18b 100644
@@ -18,6 +18,7 @@ IBMAD_1.3 {
 		mad_dump_linkwidth;
 		mad_dump_linkwidthen;
 		mad_dump_linkwidthsup;
+		mad_dump_mlnx_ext_port_info;
 		mad_dump_mtu;
 		mad_dump_node_type;
 		mad_dump_nodedesc;
--

To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

Signature · 9 lines
Ira Weiny
Math Programmer/Computer Scientist
Lawrence Livermore National Lab
925-423-8008
[email protected]
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html