* [PATCH v3/2] infiniband-diags/smpquery: Add Mellanox extended portinfo query
@ 2011-07-23 11:02 Hal Rosenstock
[not found] ` <4E2AAA5C.4080801-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
0 siblings, 1 reply; 2+ messages in thread
From: Hal Rosenstock @ 2011-07-23 11:02 UTC (permalink / raw)
To: Ira Weiny; +Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Signed-off-by: Hal Rosenstock <hal-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
---
Changes since v2:
Made command MlnxExtPortInfo or MEPI
Other cosmetics to add mlnx to extportinfo
Changes since v1:
Added man page change
diff --git a/man/smpquery.8 b/man/smpquery.8
index 3b69e8a..afd02db 100644
--- a/man/smpquery.8
+++ b/man/smpquery.8
@@ -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>
+ mlnxextportinfo <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/w@public.gmane.org >
+.RI < hal-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org >
diff --git a/src/smpquery.c b/src/smpquery.c
index 65bb65c..6753ba9 100644
--- a/src/smpquery.c
+++ b/src/smpquery.c
@@ -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, mlnx_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},
+ {"MlnxExtPortInfo", "MEPI", mlnx_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 *mlnx_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 "Mellanox ext port info query failed";
+
+ mad_dump_mlnx_ext_port_info(buf, sizeof buf, data, sizeof data);
+
+ printf("# MLNX 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 majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH v3/2] infiniband-diags/smpquery: Add Mellanox extended portinfo query
[not found] ` <4E2AAA5C.4080801-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
@ 2011-08-03 20:14 ` Ira Weiny
0 siblings, 0 replies; 2+ messages in thread
From: Ira Weiny @ 2011-08-03 20:14 UTC (permalink / raw)
To: Hal Rosenstock; +Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
On Sat, 23 Jul 2011 04:02:52 -0700
Hal Rosenstock <hal-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org> wrote:
>
> Signed-off-by: Hal Rosenstock <hal-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
applied, thanks,
Ira
> ---
> Changes since v2:
> Made command MlnxExtPortInfo or MEPI
> Other cosmetics to add mlnx to extportinfo
>
> Changes since v1:
> Added man page change
>
> diff --git a/man/smpquery.8 b/man/smpquery.8
> index 3b69e8a..afd02db 100644
> --- a/man/smpquery.8
> +++ b/man/smpquery.8
> @@ -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>
> + mlnxextportinfo <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/w@public.gmane.org >
> +.RI < hal-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org >
> diff --git a/src/smpquery.c b/src/smpquery.c
> index 65bb65c..6753ba9 100644
> --- a/src/smpquery.c
> +++ b/src/smpquery.c
> @@ -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, mlnx_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},
> + {"MlnxExtPortInfo", "MEPI", mlnx_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 *mlnx_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 "Mellanox ext port info query failed";
> +
> + mad_dump_mlnx_ext_port_info(buf, sizeof buf, data, sizeof data);
> +
> + printf("# MLNX 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];
--
Ira Weiny
Math Programmer/Computer Scientist
Lawrence Livermore National Lab
925-423-8008
weiny2-i2BcT+NCU+M@public.gmane.org
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2011-08-03 20:14 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-07-23 11:02 [PATCH v3/2] infiniband-diags/smpquery: Add Mellanox extended portinfo query Hal Rosenstock
[not found] ` <4E2AAA5C.4080801-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
2011-08-03 20:14 ` Ira Weiny
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox