Skip to contentSkip to conversation

infiniband-diags/smpquery: Add Mellanox extended portinfo query

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

lore
Share & tools
lore
#0 lore raw

PATCH v2 2/2 infiniband-diags/smpquery: Add Mellanox extended portinfo query

---
Changes since v1:
Added man page change

man/smpquery.8 +3 -2
index 3b69e8a..2ba2ef2 100644
@@ -1,4 +1,4 @@
-.TH SMPQUERY 8 "March 14, 2007" "OpenIB" "OpenIB Diagnostics"
+.TH SMPQUERY 8 "March 9, 2011" "OpenIB" "OpenIB Diagnostics"
 
 .SH NAME
 smpquery \- query InfiniBand subnet management attributes
@@ -29,6 +29,7 @@ Current supported operations and their parameters:
         sl2vl <addr> [<portnum>]
         vlarb <addr> [<portnum>]
         guids <addr>
+        extportinfo <addr> [<portnum>]  # default port is zero
 
 .TP
 \fB\-\-node\-name\-map\fR <node-name-map>
@@ -113,4 +114,4 @@ smpquery -c nodeinfo 6 0,12  # nodeinfo by combined route
 .SH AUTHOR
 .TP
 Hal Rosenstock
-.RI < halr-smomgflXvOZWk0Htik3J/[email protected] >
+.RI < hal-VPRAkNaXOzVWk0Htik3J/[email protected] >
src/smpquery.c +20 -1
index 65bb65c..04cd925 100644
@@ -63,7 +63,7 @@ typedef struct match_rec {
 } match_rec_t;
 
 static op_fn_t node_desc, node_info, port_info, switch_info, pkey_table,
-    sl2vl_table, vlarb_table, guid_info;
+    sl2vl_table, vlarb_table, guid_info, ext_port_info;
 
 static const match_rec_t match_tbl[] = {
 	{"NodeInfo", "NI", node_info},
@@ -74,6 +74,7 @@ static const match_rec_t match_tbl[] = {
 	{"SL2VLTable", "SL2VL", sl2vl_table, 1},
 	{"VLArbitration", "VLArb", vlarb_table, 1},
 	{"GUIDInfo", "GI", guid_info},
+	{"ExtPortInfo", "EPI", ext_port_info, 1},
 	{0}
 };
 
@@ -147,6 +148,24 @@ static char *port_info(ib_portid_t * dest, char **argv, int argc)
 	return 0;
 }
 
+static char *ext_port_info(ib_portid_t * dest, char **argv, int argc)
+{
+	char buf[2300];
+	char data[IB_SMP_DATA_SIZE];
+	int portnum = 0;
+
+	if (argc > 0)
+		portnum = strtol(argv[0], 0, 0);
+
+	if (!smp_query_via(data, dest, IB_ATTR_MLNX_EXT_PORT_INFO, portnum, 0, srcport))
+		return "ext port info query failed";
+
+	mad_dump_mlnx_ext_port_info(buf, sizeof buf, data, sizeof data);
+
+	printf("# Ext Port info: %s port %d\n%s", portid2str(dest), portnum, buf);
+	return 0;
+}
+
 static char *switch_info(ib_portid_t * dest, char **argv, int argc)
 {
 	char buf[2048];

--
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

A message that is not in the archive (sent off-list or not yet received): [email protected]

#2 lore raw
Quoted 17 lines · On Fri, 22 Jul 2011 07:05:51 -0700 Hal Rosenstock…

---
Changes since v1:
Added man page change

man/smpquery.8 +1 -1
index 3b69e8a..2ba2ef2 100644
@@ -1,4 +1,4 @@
-.TH SMPQUERY 8 "March 14, 2007" "OpenIB" "OpenIB Diagnostics"
+.TH SMPQUERY 8 "March 9, 2011" "OpenIB" "OpenIB Diagnostics"
 
 .SH NAME
 smpquery \- query InfiniBand subnet management attributes

man/smpquery.8 Current supported operations and their parameters: · line 32

Quoted 4 lines
man/smpquery.8 +1 -0
@@ -29,6 +29,7 @@ Current supported operations and their parameters:
         sl2vl <addr> [<portnum>]
         vlarb <addr> [<portnum>]
         guids <addr>
+        extportinfo <addr> [<portnum>]  # default port is zero

I think this should include something which indicates this is a Mellanox vendor specific query.

Perhaps just mlnxextportinfo and something in the comment.

Quoted 31 lines
man/smpquery.8 +1 -1
 .TP
 \fB\-\-node\-name\-map\fR <node-name-map>
@@ -113,4 +114,4 @@ smpquery -c nodeinfo 6 0,12  # nodeinfo by combined route
 .SH AUTHOR
 .TP
 Hal Rosenstock
-.RI < halr-smomgflXvOZWk0Htik3J/[email protected] >
+.RI < hal-VPRAkNaXOzVWk0Htik3J/[email protected] >
src/smpquery.c +2 -1
index 65bb65c..04cd925 100644
@@ -63,7 +63,7 @@ typedef struct match_rec {
 } match_rec_t;
 
 static op_fn_t node_desc, node_info, port_info, switch_info, pkey_table,
-    sl2vl_table, vlarb_table, guid_info;
+    sl2vl_table, vlarb_table, guid_info, ext_port_info;
 
 static const match_rec_t match_tbl[] = {
 	{"NodeInfo", "NI", node_info},
@@ -74,6 +74,7 @@ static const match_rec_t match_tbl[] = {
 	{"SL2VLTable", "SL2VL", sl2vl_table, 1},
 	{"VLArbitration", "VLArb", vlarb_table, 1},
 	{"GUIDInfo", "GI", guid_info},
+	{"ExtPortInfo", "EPI", ext_port_info, 1},
 	{0}
 };
 

src/smpquery.c static char *port_info(ib_portid_t * dest, char **argv, int argc) · line 151

Quoted 4 lines
src/smpquery.c +1 -0
@@ -147,6 +148,24 @@ static char *port_info(ib_portid_t * dest, char **argv, int argc)
 	return 0;
 }
 
+static char *ext_port_info(ib_portid_t * dest, char **argv, int argc)

Also it might be more clear to future coders if this also included "mlnx" as a prefix.

Thanks,
Ira

Quoted 20 lines
src/smpquery.c +17 -0
+{
+	char buf[2300];
+	char data[IB_SMP_DATA_SIZE];
+	int portnum = 0;
+
+	if (argc > 0)
+		portnum = strtol(argv[0], 0, 0);
+
+	if (!smp_query_via(data, dest, IB_ATTR_MLNX_EXT_PORT_INFO, portnum, 0, srcport))
+		return "ext port info query failed";
+
+	mad_dump_mlnx_ext_port_info(buf, sizeof buf, data, sizeof data);
+
+	printf("# Ext Port info: %s port %d\n%s", portid2str(dest), portnum, buf);
+	return 0;
+}
+
 static char *switch_info(ib_portid_t * dest, char **argv, int argc)
 {
 	char buf[2048];
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

A message that is not in the archive (sent off-list or not yet received): [email protected]

#4 lore raw
Quoted 27 lines · Ira Weiny
Quoted 17 lines · On Fri, 22 Jul 2011 07:05:51 -0700 Hal Rosenstock…

---
Changes since v1:
Added man page change

man/smpquery.8 +1 -1
index 3b69e8a..2ba2ef2 100644
@@ -1,4 +1,4 @@
-.TH SMPQUERY 8 "March 14, 2007" "OpenIB" "OpenIB Diagnostics"
+.TH SMPQUERY 8 "March 9, 2011" "OpenIB" "OpenIB Diagnostics"
 
 .SH NAME
 smpquery \- query InfiniBand subnet management attributes

man/smpquery.8 Current supported operations and their parameters: · line 32

Quoted 4 lines
man/smpquery.8 +1 -0
@@ -29,6 +29,7 @@ Current supported operations and their parameters:
         sl2vl <addr> [<portnum>]
         vlarb <addr> [<portnum>]
         guids <addr>
+        extportinfo <addr> [<portnum>]  # default port is zero

I think this should include something which indicates this is a Mellanox vendor specific query.

Quoted 1 line

Perhaps just mlnxextportinfo and something in the comment.

I was trying to keep the name from getting too long.

Quoted 31 lines
Quoted 31 lines
man/smpquery.8 +1 -1
 .TP
 \fB\-\-node\-name\-map\fR <node-name-map>
@@ -113,4 +114,4 @@ smpquery -c nodeinfo 6 0,12  # nodeinfo by combined route
 .SH AUTHOR
 .TP
 Hal Rosenstock
-.RI < halr-smomgflXvOZWk0Htik3J/[email protected] >
+.RI < hal-VPRAkNaXOzVWk0Htik3J/[email protected] >
src/smpquery.c +2 -1
index 65bb65c..04cd925 100644
@@ -63,7 +63,7 @@ typedef struct match_rec {
 } match_rec_t;
 
 static op_fn_t node_desc, node_info, port_info, switch_info, pkey_table,
-    sl2vl_table, vlarb_table, guid_info;
+    sl2vl_table, vlarb_table, guid_info, ext_port_info;
 
 static const match_rec_t match_tbl[] = {
 	{"NodeInfo", "NI", node_info},
@@ -74,6 +74,7 @@ static const match_rec_t match_tbl[] = {
 	{"SL2VLTable", "SL2VL", sl2vl_table, 1},
 	{"VLArbitration", "VLArb", vlarb_table, 1},
 	{"GUIDInfo", "GI", guid_info},
+	{"ExtPortInfo", "EPI", ext_port_info, 1},
 	{0}
 };
 
Quoted 7 lines

src/smpquery.c static char *port_info(ib_portid_t * dest, char **argv, int argc) · line 151

Quoted 5 lines
src/smpquery.c +1 -0
@@ -147,6 +148,24 @@ static char *port_info(ib_portid_t * dest, char **argv, int argc)
 	return 0;
 }
 
+static char *ext_port_info(ib_portid_t * dest, char **argv, int argc)

Also it might be more clear to future coders if this also included "mlnx" as a prefix.

OK; so should it also be:

{"MlnxExtPortInfo", "MEPI" ?

-- Hal

Quoted 15 lines

Thanks,
Ira

Quoted 12 lines
src/smpquery.c +12 -0
+{
+	char buf[2300];
+	char data[IB_SMP_DATA_SIZE];
+	int portnum = 0;
+
+	if (argc > 0)
+		portnum = strtol(argv[0], 0, 0);
+
+	if (!smp_query_via(data, dest, IB_ATTR_MLNX_EXT_PORT_INFO, portnum, 0, srcport))
+		return "ext port info query failed";
+
+	mad_dump_mlnx_ext_port_info(buf, sizeof buf, data, sizeof data);
Quoted 10 lines

src/smpquery.c static char *port_info(ib_portid_t * dest, char **argv, int argc) · line 171

Quoted 8 lines
src/smpquery.c +5 -0
+
+	printf("# Ext Port info: %s port %d\n%s", portid2str(dest), portnum, buf);
+	return 0;
+}
+
 static char *switch_info(ib_portid_t * dest, char **argv, int argc)
 {
 	char buf[2048];

--
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

A message that is not in the archive (sent off-list or not yet received): 4E2A0E48.6030402-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org

#6 lore raw
Quoted 28 lines · On Fri, 22 Jul 2011 16:56:56 -0700 Hal Rosenstock…
Quoted 27 lines · Ira Weiny
Quoted 17 lines · On Fri, 22 Jul 2011 07:05:51 -0700 Hal Rosenstock…

---
Changes since v1:
Added man page change

man/smpquery.8 +1 -1
index 3b69e8a..2ba2ef2 100644
@@ -1,4 +1,4 @@
-.TH SMPQUERY 8 "March 14, 2007" "OpenIB" "OpenIB Diagnostics"
+.TH SMPQUERY 8 "March 9, 2011" "OpenIB" "OpenIB Diagnostics"
 
 .SH NAME
 smpquery \- query InfiniBand subnet management attributes

man/smpquery.8 Current supported operations and their parameters: · line 32

Quoted 4 lines
man/smpquery.8 +1 -0
@@ -29,6 +29,7 @@ Current supported operations and their parameters:
         sl2vl <addr> [<portnum>]
         vlarb <addr> [<portnum>]
         guids <addr>
+        extportinfo <addr> [<portnum>]  # default port is zero

I think this should include something which indicates this is a Mellanox vendor specific query.

Quoted 3 lines
Quoted 1 line

Perhaps just mlnxextportinfo and something in the comment.

I was trying to keep the name from getting too long.

Well MEPI would also be available as per below. So that is not too bad for the user.

Quoted 36 lines
Quoted 36 lines
Quoted 36 lines
man/smpquery.8 +1 -1
 .TP
 \fB\-\-node\-name\-map\fR <node-name-map>
@@ -113,4 +114,4 @@ smpquery -c nodeinfo 6 0,12  # nodeinfo by combined route
 .SH AUTHOR
 .TP
 Hal Rosenstock
-.RI < halr-smomgflXvOZWk0Htik3J/[email protected] >
+.RI < hal-VPRAkNaXOzVWk0Htik3J/[email protected] >
src/smpquery.c +2 -1
index 65bb65c..04cd925 100644
@@ -63,7 +63,7 @@ typedef struct match_rec {
 } match_rec_t;
 
 static op_fn_t node_desc, node_info, port_info, switch_info, pkey_table,
-    sl2vl_table, vlarb_table, guid_info;
+    sl2vl_table, vlarb_table, guid_info, ext_port_info;
 
 static const match_rec_t match_tbl[] = {
 	{"NodeInfo", "NI", node_info},
@@ -74,6 +74,7 @@ static const match_rec_t match_tbl[] = {
 	{"SL2VLTable", "SL2VL", sl2vl_table, 1},
 	{"VLArbitration", "VLArb", vlarb_table, 1},
 	{"GUIDInfo", "GI", guid_info},
+	{"ExtPortInfo", "EPI", ext_port_info, 1},
 	{0}
 };
 
@@ -147,6 +148,24 @@ static char *port_info(ib_portid_t * dest, char **argv, int argc)
 	return 0;
 }
 
Quoted 7 lines
Quoted 3 lines

src/smpquery.c static char *port_info(ib_portid_t * dest, char **argv, int argc) · line 151

Quoted 1 line
src/smpquery.c +1 -0
+static char *ext_port_info(ib_portid_t * dest, char **argv, int argc)

Also it might be more clear to future coders if this also included "mlnx" as a prefix.

OK; so should it also be:

{"MlnxExtPortInfo", "MEPI" ?

Sounds good,
Ira

Quoted 29 lines

-- Hal

Quoted 25 lines

Thanks,
Ira

Quoted 20 lines
src/smpquery.c +17 -0
+{
+	char buf[2300];
+	char data[IB_SMP_DATA_SIZE];
+	int portnum = 0;
+
+	if (argc > 0)
+		portnum = strtol(argv[0], 0, 0);
+
+	if (!smp_query_via(data, dest, IB_ATTR_MLNX_EXT_PORT_INFO, portnum, 0, srcport))
+		return "ext port info query failed";
+
+	mad_dump_mlnx_ext_port_info(buf, sizeof buf, data, sizeof data);
+
+	printf("# Ext Port info: %s port %d\n%s", portid2str(dest), portnum, buf);
+	return 0;
+}
+
 static char *switch_info(ib_portid_t * dest, char **argv, int argc)
 {
 	char buf[2048];
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