public inbox for linux-rdma@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 0/8] Mkey support in infiniband-diags
@ 2012-05-30 17:20 Jim Foraker
       [not found] ` <1338398414.11948.29.camel-mxTxeWJot8FliZ7u+bvwcg@public.gmane.org>
  0 siblings, 1 reply; 32+ messages in thread
From: Jim Foraker @ 2012-05-30 17:20 UTC (permalink / raw)
  To: linux-rdma

     I am about to send V3 of the patch set.  Changes include:

. There is now a common "-K" option which must be passed in order to
view "sensitive" credentials.  Data is shown as "<not displayed>" rather
than as invalid/all zeros, as an indication to the user that they should
pass -K in order to see it.

. Documentation is migrated to restructured text and cleaned up
significantly.

. The config file now accepts a "sa_smkey" parameter, which sets the
smkey used in SA requests.  The default config file continues to set
this to 0 to discourage bad security practice, but the user can now
configure their own default as they wish.

. The changes to ibportstate to display and modify mkey-related
parameters have been broken out into two separate patches, and the patch
series reordered into a more logical progression.

     Jim

--
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] 32+ messages in thread

* [PATCH V3 1/8] infiniband-diags: Obfuscate sensitive output by default
       [not found] ` <1338398414.11948.29.camel-mxTxeWJot8FliZ7u+bvwcg@public.gmane.org>
@ 2012-05-30 17:21   ` Jim Foraker
       [not found]     ` <1338398497-12444-1-git-send-email-foraker1-i2BcT+NCU+M@public.gmane.org>
  0 siblings, 1 reply; 32+ messages in thread
From: Jim Foraker @ 2012-05-30 17:21 UTC (permalink / raw)
  To: linux-rdma-u79uwXL29TY76Z2rM5mHXA; +Cc: weiny2-i2BcT+NCU+M, Jim Foraker

Cause security credentials to not be displayed by default. Instead,
the "-K" flag is supported, which must be passed to the command
to display valid results.

Signed-off-by: Jim Foraker <foraker1-i2BcT+NCU+M@public.gmane.org>
---
 doc/rst/common/opt_K.rst  |    4 +++
 doc/rst/saquery.8.in.rst  |    2 ++
 doc/rst/smpquery.8.in.rst |    2 ++
 include/ibdiag_common.h   |    9 ++++++
 src/ibaddr.c              |    2 +-
 src/ibcacheedit.c         |    2 +-
 src/ibccconfig.c          |    2 +-
 src/ibccquery.c           |    2 +-
 src/ibdiag_common.c       |   71 +++++++++++++++++++++++++++++++++++++++++++++
 src/iblinkinfo.c          |    2 +-
 src/ibnetdiscover.c       |    2 +-
 src/ibping.c              |    2 +-
 src/ibqueryerrors.c       |    2 +-
 src/ibroute.c             |    2 +-
 src/ibsendtrap.c          |    2 +-
 src/ibstat.c              |    2 +-
 src/ibsysstat.c           |    2 +-
 src/ibtracert.c           |    2 +-
 src/perfquery.c           |    2 +-
 src/saquery.c             |   66 ++++++++++++++++++++---------------------
 src/sminfo.c              |    2 +-
 src/smpdump.c             |    2 +-
 src/smpquery.c            |    6 ++--
 src/vendstat.c            |    2 +-
 24 files changed, 139 insertions(+), 55 deletions(-)
 create mode 100644 doc/rst/common/opt_K.rst

diff --git a/doc/rst/common/opt_K.rst b/doc/rst/common/opt_K.rst
new file mode 100644
index 0000000..2b96bf2
--- /dev/null
+++ b/doc/rst/common/opt_K.rst
@@ -0,0 +1,4 @@
+.. Define the common option -K
+
+**-K, --show_keys**
+  show security keys (mkey, smkey, etc.) associated with the request.
diff --git a/doc/rst/saquery.8.in.rst b/doc/rst/saquery.8.in.rst
index 36696c7..79c8bd3 100644
--- a/doc/rst/saquery.8.in.rst
+++ b/doc/rst/saquery.8.in.rst
@@ -84,6 +84,8 @@ OPTIONS
         queries.  If non-numeric value (like 'x') is specified then saquery
         will prompt for a value.
 
+.. include:: common/opt_K.rst
+
 **--slid <lid>** Source LID (PathRecord)
 
 **--dlid <lid>** Destination LID (PathRecord)
diff --git a/doc/rst/smpquery.8.in.rst b/doc/rst/smpquery.8.in.rst
index 3b249df..b422731 100644
--- a/doc/rst/smpquery.8.in.rst
+++ b/doc/rst/smpquery.8.in.rst
@@ -46,6 +46,8 @@ Current supported operations and their parameters:
         Set SMSupportsExtendedSpeeds bit 31 in AttributeModifier
         (only impacts PortInfo queries).
 
+.. include:: common/opt_K.rst
+
 
 Addressing Flags
 ----------------
diff --git a/include/ibdiag_common.h b/include/ibdiag_common.h
index 6645322..e989088 100644
--- a/include/ibdiag_common.h
+++ b/include/ibdiag_common.h
@@ -39,6 +39,7 @@
 #ifndef _IBDIAG_COMMON_H_
 #define _IBDIAG_COMMON_H_
 
+#include <stdarg.h>
 #include <infiniband/mad.h>
 #include <infiniband/iba/ib_types.h>
 #include <infiniband/ibnetdisc.h>
@@ -50,6 +51,7 @@ extern enum MAD_DEST ibd_dest_type;
 extern ib_portid_t *ibd_sm_id;
 extern int ibd_timeout;
 extern uint32_t ibd_ibnetdisc_flags;
+extern int show_keys;
 
 /*========================================================*/
 /*                External interface                      */
@@ -64,6 +66,8 @@ extern uint32_t ibd_ibnetdisc_flags;
 } while (0)
 #define IBERROR(fmt, ...) iberror(__FUNCTION__, fmt, ## __VA_ARGS__)
 
+#define NOT_DISPLAYED_STR "<not displayed>"
+
 /* not all versions of ib_types.h will have this define */
 #ifndef IB_PM_PC_XMIT_WAIT_SUP
 #define IB_PM_PC_XMIT_WAIT_SUP (CL_HTON16(((uint16_t)1)<<12))
@@ -150,4 +154,9 @@ int resolve_self(char *ca_name, uint8_t ca_port, ib_portid_t *portid,
 int resolve_portid_str(char *ca_name, uint8_t ca_port, ib_portid_t * portid,
 		       char *addr_str, enum MAD_DEST dest_type,
 		       ib_portid_t *sm_id, const struct ibmad_port *srcport);
+int vsnprint_field(char *buf, size_t n, enum MAD_FIELDS f, int spacing,
+		   const char *format, va_list va_args);
+int snprint_field(char *buf, size_t n, enum MAD_FIELDS f, int spacing,
+		  const char *format, ...);
+void dump_portinfo(void *pi, int pisize, int tabs);
 #endif				/* _IBDIAG_COMMON_H_ */
diff --git a/src/ibaddr.c b/src/ibaddr.c
index 455d941..0735837 100644
--- a/src/ibaddr.c
+++ b/src/ibaddr.c
@@ -133,7 +133,7 @@ int main(int argc, char **argv)
 		NULL
 	};
 
-	ibdiag_process_opts(argc, argv, NULL, "L", opts, process_opt,
+	ibdiag_process_opts(argc, argv, NULL, "KL", opts, process_opt,
 			    usage_args, usage_examples);
 
 	argc -= optind;
diff --git a/src/ibcacheedit.c b/src/ibcacheedit.c
index f9e7dc9..2f9a634 100644
--- a/src/ibcacheedit.c
+++ b/src/ibcacheedit.c
@@ -269,7 +269,7 @@ int main(int argc, char **argv)
 	};
 	char *usage_args = "<orig.cache> <new.cache>";
 
-	ibdiag_process_opts(argc, argv, NULL, "CDdeGLPstv",
+	ibdiag_process_opts(argc, argv, NULL, "CDdeGKLPstv",
 			    opts, process_opt, usage_args,
 			    NULL);
 
diff --git a/src/ibccconfig.c b/src/ibccconfig.c
index f84c63c..d796ed8 100644
--- a/src/ibccconfig.c
+++ b/src/ibccconfig.c
@@ -615,7 +615,7 @@ int main(int argc, char **argv)
 			exit(-1);
 	}
 
-	ibdiag_process_opts(argc, argv, NULL, "D", opts, process_opt,
+	ibdiag_process_opts(argc, argv, NULL, "DK", opts, process_opt,
 			    usage_args, usage_examples);
 
 	argc -= optind;
diff --git a/src/ibccquery.c b/src/ibccquery.c
index acdfe46..34a9afd 100644
--- a/src/ibccquery.c
+++ b/src/ibccquery.c
@@ -399,7 +399,7 @@ int main(int argc, char **argv)
 			exit(-1);
 	}
 
-	ibdiag_process_opts(argc, argv, NULL, "D", opts, process_opt,
+	ibdiag_process_opts(argc, argv, NULL, "DK", opts, process_opt,
 			    usage_args, usage_examples);
 
 	argc -= optind;
diff --git a/src/ibdiag_common.c b/src/ibdiag_common.c
index 2f12c46..2662b9b 100644
--- a/src/ibdiag_common.c
+++ b/src/ibdiag_common.c
@@ -53,6 +53,7 @@
 #include <getopt.h>
 #include <limits.h>
 #include <sys/stat.h>
+#include <stdarg.h>
 
 #include <infiniband/umad.h>
 #include <infiniband/mad.h>
@@ -70,6 +71,7 @@ char *ibd_ca = NULL;
 int ibd_ca_port = 0;
 int ibd_timeout = 0;
 uint32_t ibd_ibnetdisc_flags = IBND_CONFIG_MLX_EPI;
+int show_keys = 0;
 
 static const char *prog_name;
 static const char *prog_args;
@@ -260,6 +262,9 @@ static int process_opt(int ch, char *optarg)
 				optarg);
 		ibd_sm_id = &sm_portid;
 		break;
+	case 'K':
+		show_keys = 1;
+		break;
 	default:
 		return -1;
 	}
@@ -276,6 +281,7 @@ static const struct ibdiag_opt common_opts[] = {
 	{"Guid", 'G', 0, NULL, "use GUID address argument"},
 	{"timeout", 't', 1, "<ms>", "timeout in ms"},
 	{"sm_port", 's', 1, "<lid>", "SM port lid"},
+	{"show_keys", 'K', 0, NULL, "display security keys in output"},
 	{"errors", 'e', 0, NULL, "show send and receive errors"},
 	{"verbose", 'v', 0, NULL, "increase verbosity level"},
 	{"debug", 'd', 0, NULL, "raise debug level"},
@@ -913,3 +919,68 @@ check_fdr10_active:
 			   IB_MLNX_EXT_PORT_LINK_SPEED_ACTIVE_F) & FDR10) == 0)
 		snprintf(speed_msg, msg_size, "Could be FDR10");
 }
+
+int vsnprint_field(char *buf, size_t n, enum MAD_FIELDS f, int spacing,
+		   const char *format, va_list va_args)
+{
+	int len, i, ret;
+
+	len = strlen(mad_field_name(f));
+        if (len + 2 > n || spacing + 1 > n)
+		return 0;
+
+	strncpy(buf, mad_field_name(f), n);
+	buf[len] = ':';
+	for (i = len+1; i < spacing+1; i++) {
+		buf[i] = '.';
+	}
+
+	ret = vsnprintf(&buf[spacing+1], n - spacing, format, va_args);
+	if (ret >= n - spacing)
+		buf[n] = '\0';
+
+	return ret + spacing;
+}
+
+int snprint_field(char *buf, size_t n, enum MAD_FIELDS f, int spacing,
+		  const char *format, ...)
+{
+	va_list val;
+	int ret;
+
+	va_start(val, format);
+	ret = vsnprint_field(buf, n, f, spacing, format, val);
+	va_end(val);
+
+	return ret;
+}
+
+void dump_portinfo(void *pi, int pisize, int tabs)
+{
+	int field, i;
+	char val[64];
+	char buf[1024];
+
+	for (field = IB_PORT_FIRST_F; field < IB_PORT_LAST_F; field++) {
+		for (i=0;i<tabs;i++)
+			printf("\t");
+		if (field == IB_PORT_MKEY_F && show_keys == 0) {
+			snprint_field(buf, 1024, field, 32, NOT_DISPLAYED_STR);
+		} else {
+			mad_decode_field(pi, field, val);
+			if (!mad_dump_field(field, buf, 1024, val))
+				return;
+		}
+		printf("%s\n", buf);
+	}
+
+	for (field = IB_PORT_CAPMASK2_F;
+	     field < IB_PORT_LINK_SPEED_EXT_LAST_F; field++) {
+		for (i=0;i<tabs;i++)
+			printf("\t");
+		mad_decode_field(pi, field, val);
+		if (!mad_dump_field(field, buf, 1024, val))
+			return;
+		printf("%s\n", buf);
+	}
+}
diff --git a/src/iblinkinfo.c b/src/iblinkinfo.c
index a817920..e4a8d65 100644
--- a/src/iblinkinfo.c
+++ b/src/iblinkinfo.c
@@ -619,7 +619,7 @@ int main(int argc, char **argv)
 	};
 	char usage_args[] = "";
 
-	ibdiag_process_opts(argc, argv, &config, "aDdGgLlnpRS", opts,
+	ibdiag_process_opts(argc, argv, &config, "aDdGgKLlnpRS", opts,
 			    process_opt, usage_args, NULL);
 
 	argc -= optind;
diff --git a/src/ibnetdiscover.c b/src/ibnetdiscover.c
index 4748be9..6ed0801 100644
--- a/src/ibnetdiscover.c
+++ b/src/ibnetdiscover.c
@@ -1074,7 +1074,7 @@ int main(int argc, char **argv)
 	};
 	char usage_args[] = "[topology-file]";
 
-	ibdiag_process_opts(argc, argv, &config, "DGLs", opts, process_opt,
+	ibdiag_process_opts(argc, argv, &config, "DGKLs", opts, process_opt,
 			    usage_args, NULL);
 
 	f = stdout;
diff --git a/src/ibping.c b/src/ibping.c
index 205aa82..6d3246c 100644
--- a/src/ibping.c
+++ b/src/ibping.c
@@ -202,7 +202,7 @@ int main(int argc, char **argv)
 	};
 	char usage_args[] = "<dest lid|guid>";
 
-	ibdiag_process_opts(argc, argv, NULL, "D", opts, process_opt,
+	ibdiag_process_opts(argc, argv, NULL, "DK", opts, process_opt,
 			    usage_args, NULL);
 
 	argc -= optind;
diff --git a/src/ibqueryerrors.c b/src/ibqueryerrors.c
index eb57418..c4ffcf1 100644
--- a/src/ibqueryerrors.c
+++ b/src/ibqueryerrors.c
@@ -901,7 +901,7 @@ int main(int argc, char **argv)
 	char usage_args[] = "";
 
 	memset(suppressed_fields, 0, sizeof suppressed_fields);
-	ibdiag_process_opts(argc, argv, &config, "cDGLnRrSs", opts, process_opt,
+	ibdiag_process_opts(argc, argv, &config, "cDGKLnRrSs", opts, process_opt,
 			    usage_args, NULL);
 
 	argc -= optind;
diff --git a/src/ibroute.c b/src/ibroute.c
index faff34d..63baf04 100644
--- a/src/ibroute.c
+++ b/src/ibroute.c
@@ -414,7 +414,7 @@ int main(int argc, char **argv)
 		NULL,
 	};
 
-	ibdiag_process_opts(argc, argv, NULL, NULL, opts, process_opt,
+	ibdiag_process_opts(argc, argv, NULL, "K", opts, process_opt,
 			    usage_args, usage_examples);
 
 	argc -= optind;
diff --git a/src/ibsendtrap.c b/src/ibsendtrap.c
index f98d9cf..98bacf1 100644
--- a/src/ibsendtrap.c
+++ b/src/ibsendtrap.c
@@ -192,7 +192,7 @@ int main(int argc, char **argv)
 	snprintf(usage_args + n, sizeof(usage_args) - n,
 		 "\n  default behavior is to send \"%s\"", traps[0].trap_name);
 
-	ibdiag_process_opts(argc, argv, NULL, "DGL", NULL, NULL,
+	ibdiag_process_opts(argc, argv, NULL, "DGKL", NULL, NULL,
 			    usage_args, NULL);
 
 	argc -= optind;
diff --git a/src/ibstat.c b/src/ibstat.c
index 3d971ed..12d3c20 100644
--- a/src/ibstat.c
+++ b/src/ibstat.c
@@ -292,7 +292,7 @@ int main(int argc, char *argv[])
 		NULL
 	};
 
-	ibdiag_process_opts(argc, argv, NULL, "CDeGLPst", opts, process_opt,
+	ibdiag_process_opts(argc, argv, NULL, "CDeGKLPst", opts, process_opt,
 			    usage_args, usage_examples);
 
 	argc -= optind;
diff --git a/src/ibsysstat.c b/src/ibsysstat.c
index 2b11a06..bac4bb1 100644
--- a/src/ibsysstat.c
+++ b/src/ibsysstat.c
@@ -326,7 +326,7 @@ int main(int argc, char **argv)
 	};
 	char usage_args[] = "<dest lid|guid> [<op>]";
 
-	ibdiag_process_opts(argc, argv, NULL, "D", opts, process_opt,
+	ibdiag_process_opts(argc, argv, NULL, "DK", opts, process_opt,
 			    usage_args, NULL);
 
 	argc -= optind;
diff --git a/src/ibtracert.c b/src/ibtracert.c
index e8fedf3..575d9d0 100644
--- a/src/ibtracert.c
+++ b/src/ibtracert.c
@@ -757,7 +757,7 @@ int main(int argc, char **argv)
 		NULL,
 	};
 
-	ibdiag_process_opts(argc, argv, NULL, "D", opts, process_opt,
+	ibdiag_process_opts(argc, argv, NULL, "DK", opts, process_opt,
 			    usage_args, usage_examples);
 
 	f = stdout;
diff --git a/src/perfquery.c b/src/perfquery.c
index b58ad70..9ca2e15 100644
--- a/src/perfquery.c
+++ b/src/perfquery.c
@@ -710,7 +710,7 @@ int main(int argc, char **argv)
 		NULL,
 	};
 
-	ibdiag_process_opts(argc, argv, NULL, "D", opts, process_opt,
+	ibdiag_process_opts(argc, argv, NULL, "DK", opts, process_opt,
 			    usage_args, usage_examples);
 
 	argc -= optind;
diff --git a/src/saquery.c b/src/saquery.c
index 1e730a4..90feb2d 100644
--- a/src/saquery.c
+++ b/src/saquery.c
@@ -116,20 +116,6 @@ static unsigned valid_gid(ib_gid_t * gid)
 	return memcmp(&zero_gid, gid, sizeof(*gid));
 }
 
-static void format_buf(char *in, char *out, unsigned size)
-{
-	unsigned i;
-
-	for (i = 0; i < size - 3 && *in; i++) {
-		*out++ = *in;
-		if (*in++ == '\n' && *in) {
-			*out++ = '\t';
-			*out++ = '\t';
-		}
-	}
-	*out = '\0';
-}
-
 static void print_node_desc(ib_node_record_t * node_record)
 {
 	ib_node_info_t *p_ni = &(node_record->node_info);
@@ -300,19 +286,17 @@ static void dump_portinfo_record(void *data)
 
 static void dump_one_portinfo_record(void *data)
 {
-	char buf[2300], buf2[4096];
 	ib_portinfo_record_t *pir = data;
 	ib_port_info_t *pi = &pir->port_info;
 
-	mad_dump_portinfo(buf, sizeof(buf), pi, sizeof(*pi));
-	format_buf(buf, buf2, sizeof(buf2));
 	printf("PortInfoRecord dump:\n"
 	       "\tRID:\n"
 	       "\t\tEndPortLid..............%u\n"
 	       "\t\tPortNum.................%u\n"
 	       "\t\tOptions.................0x%x\n"
-	       "\tPortInfo dump:\n\t\t%s",
-	       cl_ntoh16(pir->lid), pir->port_num, pir->options, buf2);
+	       "\tPortInfo dump:\n",
+	       cl_ntoh16(pir->lid), pir->port_num, pir->options);
+	dump_portinfo(pi, sizeof(*pi), 2);
 }
 
 static void dump_one_mcmember_record(void *data)
@@ -471,7 +455,8 @@ static void dump_service_record(void *data)
 	       cl_ntoh64(p_sr->service_id),
 	       inet_ntop(AF_INET6, p_sr->service_gid.raw, gid, sizeof gid),
 	       cl_ntoh16(p_sr->service_pkey), cl_ntoh32(p_sr->service_lease),
-	       buf_service_key, buf_service_name,
+	       (show_keys ? buf_service_key : NOT_DISPLAYED_STR),
+               buf_service_name,
 	       p_sr->service_data8[0], p_sr->service_data8[1],
 	       p_sr->service_data8[2], p_sr->service_data8[3],
 	       p_sr->service_data8[4], p_sr->service_data8[5],
@@ -507,7 +492,7 @@ static void dump_inform_info_record(void *data)
 	ib_inform_info_get_qpn_resp_time(p_iir->inform_info.g_or_v.
 					 generic.qpn_resp_time_val, &qpn,
 					 &resp_time_val);
-	if (p_iir->inform_info.is_generic)
+	if (p_iir->inform_info.is_generic) {
 		printf("InformInfoRecord dump:\n"
 		       "\t\tRID\n"
 		       "\t\tSubscriberGID...........%s\n"
@@ -519,10 +504,7 @@ static void dump_inform_info_record(void *data)
 		       "\t\tis_generic..............0x%X\n"
 		       "\t\tsubscribe...............0x%X\n"
 		       "\t\ttrap_type...............0x%X\n"
-		       "\t\ttrap_num................%u\n"
-		       "\t\tqpn.....................0x%06X\n"
-		       "\t\tresp_time_val...........0x%X\n"
-		       "\t\tnode_type...............0x%06X\n",
+		       "\t\ttrap_num................%u\n",
 		       inet_ntop(AF_INET6, p_iir->subscriber_gid.raw, gid_str,
 				 sizeof gid_str),
 		       cl_ntoh16(p_iir->subscriber_enum),
@@ -533,11 +515,20 @@ static void dump_inform_info_record(void *data)
 		       p_iir->inform_info.is_generic,
 		       p_iir->inform_info.subscribe,
 		       cl_ntoh16(p_iir->inform_info.trap_type),
-		       cl_ntoh16(p_iir->inform_info.g_or_v.generic.trap_num),
-		       cl_ntoh32(qpn), resp_time_val,
+		       cl_ntoh16(p_iir->inform_info.g_or_v.generic.trap_num));
+		if (show_keys) {
+			printf("\t\tqpn.....................0x%06X\n",
+			       cl_ntoh32(qpn));
+		} else {
+			printf("\t\tqpn....................."
+			       NOT_DISPLAYED_STR "\n");
+		}
+		printf("\t\tresp_time_val...........0x%X\n"
+		       "\t\tnode_type...............0x%06X\n",
+		       resp_time_val,
 		       cl_ntoh32(ib_inform_info_get_prod_type
 				 (&p_iir->inform_info)));
-	else
+	} else {
 		printf("InformInfoRecord dump:\n"
 		       "\t\tRID\n"
 		       "\t\tSubscriberGID...........%s\n"
@@ -549,10 +540,7 @@ static void dump_inform_info_record(void *data)
 		       "\t\tis_generic..............0x%X\n"
 		       "\t\tsubscribe...............0x%X\n"
 		       "\t\ttrap_type...............0x%X\n"
-		       "\t\tdev_id..................0x%X\n"
-		       "\t\tqpn.....................0x%06X\n"
-		       "\t\tresp_time_val...........0x%X\n"
-		       "\t\tvendor_id...............0x%06X\n",
+		       "\t\tdev_id..................0x%X\n",
 		       inet_ntop(AF_INET6, p_iir->subscriber_gid.raw, gid_str,
 				 sizeof gid_str),
 		       cl_ntoh16(p_iir->subscriber_enum),
@@ -563,10 +551,20 @@ static void dump_inform_info_record(void *data)
 		       p_iir->inform_info.is_generic,
 		       p_iir->inform_info.subscribe,
 		       cl_ntoh16(p_iir->inform_info.trap_type),
-		       cl_ntoh16(p_iir->inform_info.g_or_v.vend.dev_id),
-		       cl_ntoh32(qpn), resp_time_val,
+		       cl_ntoh16(p_iir->inform_info.g_or_v.vend.dev_id));
+		if (show_keys) {
+			printf("\t\tqpn.....................0x%06X\n",
+			       cl_ntoh32(qpn));
+		} else {
+			printf("\t\tqpn....................."
+			       NOT_DISPLAYED_STR "\n");
+		}
+		printf("\t\tresp_time_val...........0x%X\n"
+		       "\t\tvendor_id...............0x%06X\n",
+		       resp_time_val,
 		       cl_ntoh32(ib_inform_info_get_prod_type
 				 (&p_iir->inform_info)));
+	}
 }
 
 static void dump_one_link_record(void *data)
diff --git a/src/sminfo.c b/src/sminfo.c
index f1abc6a..1c12204 100644
--- a/src/sminfo.c
+++ b/src/sminfo.c
@@ -109,7 +109,7 @@ int main(int argc, char **argv)
 	};
 	char usage_args[] = "<sm_lid|sm_dr_path> [modifier]";
 
-	ibdiag_process_opts(argc, argv, NULL, "s", opts, process_opt,
+	ibdiag_process_opts(argc, argv, NULL, "sK", opts, process_opt,
 			    usage_args, NULL);
 
 	argc -= optind;
diff --git a/src/smpdump.c b/src/smpdump.c
index 1e79c52..4d67be7 100644
--- a/src/smpdump.c
+++ b/src/smpdump.c
@@ -231,7 +231,7 @@ int main(int argc, char *argv[])
 
 	ibd_timeout = 1000;
 
-	ibdiag_process_opts(argc, argv, NULL, "Gs", opts, process_opt,
+	ibdiag_process_opts(argc, argv, NULL, "GKs", opts, process_opt,
 			    usage_args, usage_examples);
 
 	argc -= optind;
diff --git a/src/smpquery.c b/src/smpquery.c
index 533b2c3..2909dc5 100644
--- a/src/smpquery.c
+++ b/src/smpquery.c
@@ -133,7 +133,6 @@ static char *node_info(ib_portid_t * dest, char **argv, int argc)
 
 static char *port_info(ib_portid_t * dest, char **argv, int argc)
 {
-	char buf[2300];
 	char data[IB_SMP_DATA_SIZE] = { 0 };
 	int portnum = 0, orig_portnum;
 
@@ -146,9 +145,8 @@ static char *port_info(ib_portid_t * dest, char **argv, int argc)
 	if (!smp_query_via(data, dest, IB_ATTR_PORT_INFO, portnum, 0, srcport))
 		return "port info query failed";
 
-	mad_dump_portinfo(buf, sizeof buf, data, sizeof data);
-
-	printf("# Port info: %s port %d\n%s", portid2str(dest), orig_portnum, buf);
+	printf("# Port info: %s port %d\n", portid2str(dest), orig_portnum);
+	dump_portinfo(data, sizeof data, 0);
 	return 0;
 }
 
diff --git a/src/vendstat.c b/src/vendstat.c
index 78f6d7d..dd89da7 100644
--- a/src/vendstat.c
+++ b/src/vendstat.c
@@ -332,7 +332,7 @@ int main(int argc, char **argv)
 		NULL
 	};
 
-	ibdiag_process_opts(argc, argv, NULL, "D", opts, process_opt,
+	ibdiag_process_opts(argc, argv, NULL, "DK", opts, process_opt,
 			    usage_args, usage_examples);
 
 	argc -= optind;
-- 
1.7.9.2

--
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] 32+ messages in thread

* [PATCH V3 2/8] infiniband-diags: install config file mode 400
       [not found]     ` <1338398497-12444-1-git-send-email-foraker1-i2BcT+NCU+M@public.gmane.org>
@ 2012-05-30 17:21       ` Jim Foraker
       [not found]         ` <1338398497-12444-2-git-send-email-foraker1-i2BcT+NCU+M@public.gmane.org>
  2012-05-30 17:21       ` [PATCH V3 3/8] infiniband-diags/ibportstate.c: Display MKey, lease, and protect bits Jim Foraker
                         ` (7 subsequent siblings)
  8 siblings, 1 reply; 32+ messages in thread
From: Jim Foraker @ 2012-05-30 17:21 UTC (permalink / raw)
  To: linux-rdma-u79uwXL29TY76Z2rM5mHXA; +Cc: weiny2-i2BcT+NCU+M, Jim Foraker

Necessary so that we may add credentials (ie, mkey) to it

Signed-off-by: Jim Foraker <foraker1-i2BcT+NCU+M@public.gmane.org>
---
 Makefile.am |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Makefile.am b/Makefile.am
index f861000..33b5f90 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -148,4 +148,4 @@ install-data-hook:
 	fi
 	$(top_srcdir)/config/install-sh -c -m 444 $(top_srcdir)/scripts/IBswcountlimits.pm $(DESTDIR)/$(PERL_INSTALLDIR)/IBswcountlimits.pm
 	$(top_srcdir)/config/install-sh -c -m 444 $(top_srcdir)/etc/error_thresholds $(DESTDIR)/$(sysconfdir)/infiniband-diags
-	$(top_srcdir)/config/install-sh -c -m 444 $(top_srcdir)/etc/ibdiag.conf $(DESTDIR)/$(sysconfdir)/infiniband-diags
+	$(top_srcdir)/config/install-sh -c -m 400 $(top_srcdir)/etc/ibdiag.conf $(DESTDIR)/$(sysconfdir)/infiniband-diags
-- 
1.7.9.2

--
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] 32+ messages in thread

* [PATCH V3 3/8] infiniband-diags/ibportstate.c: Display MKey, lease, and protect bits
       [not found]     ` <1338398497-12444-1-git-send-email-foraker1-i2BcT+NCU+M@public.gmane.org>
  2012-05-30 17:21       ` [PATCH V3 2/8] infiniband-diags: install config file mode 400 Jim Foraker
@ 2012-05-30 17:21       ` Jim Foraker
       [not found]         ` <1338398497-12444-3-git-send-email-foraker1-i2BcT+NCU+M@public.gmane.org>
  2012-05-30 17:21       ` [PATCH V3 4/8] infiniband-diags: Allow specification of an mkey to use on the command line Jim Foraker
                         ` (6 subsequent siblings)
  8 siblings, 1 reply; 32+ messages in thread
From: Jim Foraker @ 2012-05-30 17:21 UTC (permalink / raw)
  To: linux-rdma-u79uwXL29TY76Z2rM5mHXA; +Cc: weiny2-i2BcT+NCU+M, Jim Foraker

By default, display mkey lease and protection bits.
With a flag, also display mkey itself

Signed-off-by: Jim Foraker <foraker1-i2BcT+NCU+M@public.gmane.org>
---
 doc/rst/ibportstate.8.in.rst |    1 +
 src/ibportstate.c            |   30 ++++++++++++++++++++++++------
 2 files changed, 25 insertions(+), 6 deletions(-)

diff --git a/doc/rst/ibportstate.8.in.rst b/doc/rst/ibportstate.8.in.rst
index 3af2aaa..1fc9bb2 100644
--- a/doc/rst/ibportstate.8.in.rst
+++ b/doc/rst/ibportstate.8.in.rst
@@ -89,6 +89,7 @@ Debugging flags
 .. include:: common/opt_h.rst
 .. include:: common/opt_d.rst
 .. include:: common/opt_e.rst
+.. include:: common/opt_K.rst
 .. include:: common/opt_v.rst
 .. include:: common/opt_V.rst
 
diff --git a/src/ibportstate.c b/src/ibportstate.c
index 5559d18..b2df212 100644
--- a/src/ibportstate.c
+++ b/src/ibportstate.c
@@ -142,7 +142,7 @@ static int get_port_info(ib_portid_t * dest, uint8_t * data, int portnum,
 }
 
 static void show_port_info(ib_portid_t * dest, uint8_t * data, int portnum,
-			   int espeed_cap)
+			   int espeed_cap, int is_switch)
 {
 	char buf[2300];
 	char val[64];
@@ -201,18 +201,36 @@ static void show_port_info(ib_portid_t * dest, uint8_t * data, int portnum,
 			       val);
 		sprintf(buf + strlen(buf), "%s", "\n");
 	}
+	if (!is_switch || portnum == 0) {
+		if (show_keys) {
+			mad_decode_field(data, IB_PORT_MKEY_F, val);
+			mad_dump_field(IB_PORT_MKEY_F, buf + strlen(buf),
+			    	       sizeof buf - strlen(buf), val);
+		} else 
+			snprint_field(buf+strlen(buf), sizeof(buf)-strlen(buf),
+				      IB_PORT_MKEY_F, 32, NOT_DISPLAYED_STR);
+		sprintf(buf+strlen(buf), "%s", "\n");
+		mad_decode_field(data, IB_PORT_MKEY_LEASE_F, val);
+		mad_dump_field(IB_PORT_MKEY_LEASE_F, buf + strlen(buf),
+			       sizeof buf - strlen(buf), val);
+		sprintf(buf+strlen(buf), "%s", "\n");
+		mad_decode_field(data, IB_PORT_MKEY_PROT_BITS_F, val);
+		mad_dump_field(IB_PORT_MKEY_PROT_BITS_F, buf + strlen(buf),
+			       sizeof buf - strlen(buf), val);
+		sprintf(buf+strlen(buf), "%s", "\n");
+	}
 
 	printf("# Port info: %s port %d\n%s", portid2str(dest), portnum, buf);
 }
 
 static void set_port_info(ib_portid_t * dest, uint8_t * data, int portnum,
-			  int espeed_cap)
+			  int espeed_cap, int is_switch)
 {
 	if (!smp_set_via(data, dest, IB_ATTR_PORT_INFO, portnum, 0, srcport))
 		IBERROR("smp set portinfo failed");
 
 	printf("\nAfter PortInfo set:\n");
-	show_port_info(dest, data, portnum, espeed_cap);
+	show_port_info(dest, data, portnum, espeed_cap, is_switch);
 }
 
 static void get_ext_port_info(ib_portid_t * dest, uint8_t * data, int portnum)
@@ -460,7 +478,7 @@ int main(int argc, char **argv)
 	else
 		printf("%s PortInfo:\n", is_switch ? "Switch" : "CA");
 	espeed_cap = get_port_info(&portid, data, portnum, is_switch);
-	show_port_info(&portid, data, portnum, espeed_cap);
+	show_port_info(&portid, data, portnum, espeed_cap, is_switch);
 	if (is_mlnx_ext_port_info_supported(devid)) {
 		get_ext_port_info(&portid, data2, portnum);
 		show_ext_port_info(&portid, data2, portnum);
@@ -527,7 +545,7 @@ int main(int argc, char **argv)
 				      fdr10);
 			set_ext_port_info(&portid, data2, portnum);
 		}
-		set_port_info(&portid, data, portnum, is_switch);
+		set_port_info(&portid, data, portnum, espeed_cap, is_switch);
 
 	} else if (is_switch && portnum) {
 		/* Now, make sure PortState is Active */
@@ -596,7 +614,7 @@ int main(int argc, char **argv)
 				get_ext_port_info(&peerportid, data2,
 						  peerlocalportnum);
 			show_port_info(&peerportid, data, peerlocalportnum,
-				       peer_espeed_cap);
+				       peer_espeed_cap, is_peer_switch);
 			if (is_mlnx_ext_port_info_supported(rem_devid))
 				show_ext_port_info(&peerportid, data2,
 						   peerlocalportnum);
-- 
1.7.9.2

--
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] 32+ messages in thread

* [PATCH V3 4/8] infiniband-diags: Allow specification of an mkey to use on the command line
       [not found]     ` <1338398497-12444-1-git-send-email-foraker1-i2BcT+NCU+M@public.gmane.org>
  2012-05-30 17:21       ` [PATCH V3 2/8] infiniband-diags: install config file mode 400 Jim Foraker
  2012-05-30 17:21       ` [PATCH V3 3/8] infiniband-diags/ibportstate.c: Display MKey, lease, and protect bits Jim Foraker
@ 2012-05-30 17:21       ` Jim Foraker
       [not found]         ` <1338398497-12444-4-git-send-email-foraker1-i2BcT+NCU+M@public.gmane.org>
  2012-05-30 17:21       ` [PATCH V3 5/8] infiniband-diags/ibportstate.c: Support changing MKey, lease, and protect bits Jim Foraker
                         ` (5 subsequent siblings)
  8 siblings, 1 reply; 32+ messages in thread
From: Jim Foraker @ 2012-05-30 17:21 UTC (permalink / raw)
  To: linux-rdma-u79uwXL29TY76Z2rM5mHXA; +Cc: weiny2-i2BcT+NCU+M, Jim Foraker


Signed-off-by: Jim Foraker <foraker1-i2BcT+NCU+M@public.gmane.org>
---
 doc/rst/common/opt_m.rst                    |    6 ++++++
 doc/rst/ibaddr.8.in.rst                     |    1 +
 doc/rst/ibccconfig.8.in.rst                 |    1 +
 doc/rst/ibccquery.8.in.rst                  |    1 +
 doc/rst/iblinkinfo.8.in.rst                 |    1 +
 doc/rst/ibnetdiscover.8.in.rst              |    1 +
 doc/rst/ibportstate.8.in.rst                |    1 +
 doc/rst/ibqueryerrors.8.in.rst              |    1 +
 doc/rst/ibroute.8.in.rst                    |    1 +
 doc/rst/ibtracert.8.in.rst                  |    6 ++++++
 doc/rst/perfquery.8.in.rst                  |    1 +
 doc/rst/sminfo.8.in.rst                     |    1 +
 doc/rst/smpquery.8.in.rst                   |    1 +
 include/ibdiag_common.h                     |    1 +
 libibnetdisc/include/infiniband/ibnetdisc.h |    3 ++-
 libibnetdisc/src/ibnetdisc.c                |    1 +
 src/ibaddr.c                                |    2 ++
 src/ibcacheedit.c                           |    2 +-
 src/ibccconfig.c                            |    2 ++
 src/ibccquery.c                             |    2 ++
 src/ibdiag_common.c                         |   13 +++++++++++++
 src/iblinkinfo.c                            |    3 +++
 src/ibnetdiscover.c                         |    2 +-
 src/ibping.c                                |    2 +-
 src/ibportstate.c                           |    2 ++
 src/ibqueryerrors.c                         |    3 +++
 src/ibroute.c                               |    2 ++
 src/ibsendtrap.c                            |    2 ++
 src/ibstat.c                                |    2 +-
 src/ibsysstat.c                             |    2 +-
 src/ibtracert.c                             |    4 +++-
 src/perfquery.c                             |    2 ++
 src/saquery.c                               |    2 +-
 src/sminfo.c                                |    2 ++
 src/smpquery.c                              |    2 ++
 src/vendstat.c                              |    2 +-
 36 files changed, 74 insertions(+), 9 deletions(-)
 create mode 100644 doc/rst/common/opt_m.rst

diff --git a/doc/rst/common/opt_m.rst b/doc/rst/common/opt_m.rst
new file mode 100644
index 0000000..13082e8
--- /dev/null
+++ b/doc/rst/common/opt_m.rst
@@ -0,0 +1,6 @@
+.. Define the common option -m
+
+**-m, --m_key <key>**
+        use the specified M_key for requests. If non-numeric value (like 'x')
+        is specified then a value will be prompted for.
+
diff --git a/doc/rst/ibaddr.8.in.rst b/doc/rst/ibaddr.8.in.rst
index 93de897..a1fc42b 100644
--- a/doc/rst/ibaddr.8.in.rst
+++ b/doc/rst/ibaddr.8.in.rst
@@ -68,6 +68,7 @@ Port Selection flags
 Configuration flags
 -------------------
 
+.. include:: common/opt_m.rst
 .. include:: common/opt_z-config.rst
 
 FILES
diff --git a/doc/rst/ibccconfig.8.in.rst b/doc/rst/ibccconfig.8.in.rst
index 3ab31b6..44d8c72 100644
--- a/doc/rst/ibccconfig.8.in.rst
+++ b/doc/rst/ibccconfig.8.in.rst
@@ -67,6 +67,7 @@ Port Selection flags
 Configuration flags
 -------------------
 
+.. include:: common/opt_m.rst
 .. include:: common/opt_z-config.rst
 
 
diff --git a/doc/rst/ibccquery.8.in.rst b/doc/rst/ibccquery.8.in.rst
index 89b741c..183f2e3 100644
--- a/doc/rst/ibccquery.8.in.rst
+++ b/doc/rst/ibccquery.8.in.rst
@@ -66,6 +66,7 @@ Port Selection flags
 Configuration flags
 -------------------
 
+.. include:: common/opt_m.rst
 .. include:: common/opt_z-config.rst
 
 FILES
diff --git a/doc/rst/iblinkinfo.8.in.rst b/doc/rst/iblinkinfo.8.in.rst
index 1496bfc..de23de2 100644
--- a/doc/rst/iblinkinfo.8.in.rst
+++ b/doc/rst/iblinkinfo.8.in.rst
@@ -99,6 +99,7 @@ Configuration flags
 .. include:: common/opt_o-outstanding_smps.rst
 .. include:: common/opt_node_name_map.rst
 .. include:: common/opt_t.rst
+.. include:: common/opt_m.rst
 
 Debugging flags
 ---------------
diff --git a/doc/rst/ibnetdiscover.8.in.rst b/doc/rst/ibnetdiscover.8.in.rst
index fb7c4c9..c858200 100644
--- a/doc/rst/ibnetdiscover.8.in.rst
+++ b/doc/rst/ibnetdiscover.8.in.rst
@@ -83,6 +83,7 @@ Configuration flags
 .. include:: common/opt_o-outstanding_smps.rst
 .. include:: common/opt_node_name_map.rst
 .. include:: common/opt_t.rst
+.. include:: common/opt_m.rst
 
 Debugging flags
 ---------------
diff --git a/doc/rst/ibportstate.8.in.rst b/doc/rst/ibportstate.8.in.rst
index 1fc9bb2..fca3f7a 100644
--- a/doc/rst/ibportstate.8.in.rst
+++ b/doc/rst/ibportstate.8.in.rst
@@ -82,6 +82,7 @@ Configuration flags
 
 .. include:: common/opt_z-config.rst
 .. include:: common/opt_t.rst
+.. include:: common/opt_m.rst
 
 Debugging flags
 ---------------
diff --git a/doc/rst/ibqueryerrors.8.in.rst b/doc/rst/ibqueryerrors.8.in.rst
index 15d488d..d0e9bc9 100644
--- a/doc/rst/ibqueryerrors.8.in.rst
+++ b/doc/rst/ibqueryerrors.8.in.rst
@@ -102,6 +102,7 @@ Configuration flags
 .. include:: common/opt_o-outstanding_smps.rst
 .. include:: common/opt_node_name_map.rst
 .. include:: common/opt_t.rst
+.. include:: common/opt_m.rst
 
 Debugging flags
 ---------------
diff --git a/doc/rst/ibroute.8.in.rst b/doc/rst/ibroute.8.in.rst
index 0070dd6..1cde5ea 100644
--- a/doc/rst/ibroute.8.in.rst
+++ b/doc/rst/ibroute.8.in.rst
@@ -66,6 +66,7 @@ Debugging flags
 Configuration flags
 -------------------
 
+.. include:: common/opt_m.rst
 .. include:: common/opt_t.rst
 .. include:: common/opt_z-config.rst
 
diff --git a/doc/rst/ibtracert.8.in.rst b/doc/rst/ibtracert.8.in.rst
index b002fa8..fecdcdd 100644
--- a/doc/rst/ibtracert.8.in.rst
+++ b/doc/rst/ibtracert.8.in.rst
@@ -65,6 +65,12 @@ Debugging flags
 Configuration flags
 -------------------
 
+
+**--m_key <key>**
+        use the specified M_key for requests. If non-numeric value (like 'x')
+        is specified then a value will be prompted for. Note that unlike other
+        utilities, the '-m' short option is unavailable in ibtracert.
+
 .. include:: common/opt_t.rst
 .. include:: common/opt_node_name_map.rst
 .. include:: common/opt_z-config.rst
diff --git a/doc/rst/perfquery.8.in.rst b/doc/rst/perfquery.8.in.rst
index f5d0e61..caf197c 100644
--- a/doc/rst/perfquery.8.in.rst
+++ b/doc/rst/perfquery.8.in.rst
@@ -144,6 +144,7 @@ Debugging flags
 Configuration flags
 -------------------
 
+.. include:: common/opt_m.rst
 .. include:: common/opt_t.rst
 .. include:: common/opt_z-config.rst
 
diff --git a/doc/rst/sminfo.8.in.rst b/doc/rst/sminfo.8.in.rst
index 1d7e69f..e4ba39a 100644
--- a/doc/rst/sminfo.8.in.rst
+++ b/doc/rst/sminfo.8.in.rst
@@ -70,6 +70,7 @@ Debugging flags
 Configuration flags
 -------------------
 
+.. include:: common/opt_m.rst
 .. include:: common/opt_t.rst
 .. include:: common/opt_z-config.rst
 
diff --git a/doc/rst/smpquery.8.in.rst b/doc/rst/smpquery.8.in.rst
index b422731..4182b32 100644
--- a/doc/rst/smpquery.8.in.rst
+++ b/doc/rst/smpquery.8.in.rst
@@ -79,6 +79,7 @@ Debugging flags
 Configuration flags
 -------------------
 
+.. include:: common/opt_m.rst
 .. include:: common/opt_t.rst
 .. include:: common/opt_node_name_map.rst
 .. include:: common/opt_z-config.rst
diff --git a/include/ibdiag_common.h b/include/ibdiag_common.h
index e989088..0120203 100644
--- a/include/ibdiag_common.h
+++ b/include/ibdiag_common.h
@@ -51,6 +51,7 @@ extern enum MAD_DEST ibd_dest_type;
 extern ib_portid_t *ibd_sm_id;
 extern int ibd_timeout;
 extern uint32_t ibd_ibnetdisc_flags;
+extern uint64_t ibd_mkey;
 extern int show_keys;
 
 /*========================================================*/
diff --git a/libibnetdisc/include/infiniband/ibnetdisc.h b/libibnetdisc/include/infiniband/ibnetdisc.h
index 2ae2b06..335ad83 100644
--- a/libibnetdisc/include/infiniband/ibnetdisc.h
+++ b/libibnetdisc/include/infiniband/ibnetdisc.h
@@ -151,7 +151,8 @@ typedef struct ibnd_config {
 	unsigned timeout_ms;
 	unsigned retries;
 	uint32_t flags;
-	uint8_t pad[52];
+	uint64_t mkey;
+	uint8_t pad[44];
 } ibnd_config_t;
 
 /** =========================================================================
diff --git a/libibnetdisc/src/ibnetdisc.c b/libibnetdisc/src/ibnetdisc.c
index 8d38ab7..a0cbe3e 100644
--- a/libibnetdisc/src/ibnetdisc.c
+++ b/libibnetdisc/src/ibnetdisc.c
@@ -711,6 +711,7 @@ ibnd_fabric_t *ibnd_discover_fabric(char * ca_name, int ca_port,
 	}
 	mad_rpc_set_timeout(scan.ibmad_port, cfg->timeout_ms);
 	mad_rpc_set_retries(scan.ibmad_port, cfg->retries);
+	smp_mkey_set(scan.ibmad_port, cfg->mkey);
 
 	IBND_DEBUG("from %s\n", portid2str(from));
 
diff --git a/src/ibaddr.c b/src/ibaddr.c
index 0735837..9d208f5 100644
--- a/src/ibaddr.c
+++ b/src/ibaddr.c
@@ -149,6 +149,8 @@ int main(int argc, char **argv)
 	if (!srcport)
 		IBERROR("Failed to open '%s' port '%d'", ibd_ca, ibd_ca_port);
 
+	smp_mkey_set(srcport, ibd_mkey);
+
 	if (argc) {
 		if (resolve_portid_str(ibd_ca, ibd_ca_port, &portid, argv[0],
 				       ibd_dest_type, ibd_sm_id, srcport) < 0)
diff --git a/src/ibcacheedit.c b/src/ibcacheedit.c
index 2f9a634..5a656c9 100644
--- a/src/ibcacheedit.c
+++ b/src/ibcacheedit.c
@@ -269,7 +269,7 @@ int main(int argc, char **argv)
 	};
 	char *usage_args = "<orig.cache> <new.cache>";
 
-	ibdiag_process_opts(argc, argv, NULL, "CDdeGKLPstv",
+	ibdiag_process_opts(argc, argv, NULL, "CDdeGKLmPstv",
 			    opts, process_opt, usage_args,
 			    NULL);
 
diff --git a/src/ibccconfig.c b/src/ibccconfig.c
index d796ed8..207c821 100644
--- a/src/ibccconfig.c
+++ b/src/ibccconfig.c
@@ -631,6 +631,8 @@ int main(int argc, char **argv)
 	if (!srcport)
 		IBERROR("Failed to open '%s' port '%d'", ibd_ca, ibd_ca_port);
 
+	smp_mkey_set(srcport, ibd_mkey);
+
 	if (resolve_portid_str(ibd_ca, ibd_ca_port, &portid, argv[1],
 			       ibd_dest_type, ibd_sm_id, srcport) < 0)
 		IBERROR("can't resolve destination %s", argv[1]);
diff --git a/src/ibccquery.c b/src/ibccquery.c
index 34a9afd..f9d7b2f 100644
--- a/src/ibccquery.c
+++ b/src/ibccquery.c
@@ -415,6 +415,8 @@ int main(int argc, char **argv)
 	if (!srcport)
 		IBERROR("Failed to open '%s' port '%d'", ibd_ca, ibd_ca_port);
 
+	smp_mkey_set(srcport, ibd_mkey);
+
 	if (resolve_portid_str(ibd_ca, ibd_ca_port, &portid, argv[1],
 			       ibd_dest_type, ibd_sm_id, srcport) < 0)
 		IBERROR("can't resolve destination %s", argv[1]);
diff --git a/src/ibdiag_common.c b/src/ibdiag_common.c
index 2662b9b..069f6e5 100644
--- a/src/ibdiag_common.c
+++ b/src/ibdiag_common.c
@@ -71,6 +71,7 @@ char *ibd_ca = NULL;
 int ibd_ca_port = 0;
 int ibd_timeout = 0;
 uint32_t ibd_ibnetdisc_flags = IBND_CONFIG_MLX_EPI;
+uint64_t ibd_mkey;
 int show_keys = 0;
 
 static const char *prog_name;
@@ -265,6 +266,17 @@ static int process_opt(int ch, char *optarg)
 	case 'K':
 		show_keys = 1;
 		break;
+	case 'm':
+		errno = 0;
+		ibd_mkey = strtoull(optarg, &endp, 0);
+		if (errno || *endp != '\0') {
+			errno = 0;
+			ibd_mkey = strtoull(getpass("M_Key: "), &endp, 0);
+			if (errno || *endp != '\0') {
+				IBERROR("Bad M_Key");
+			}
+                }
+                break;
 	default:
 		return -1;
 	}
@@ -282,6 +294,7 @@ static const struct ibdiag_opt common_opts[] = {
 	{"timeout", 't', 1, "<ms>", "timeout in ms"},
 	{"sm_port", 's', 1, "<lid>", "SM port lid"},
 	{"show_keys", 'K', 0, NULL, "display security keys in output"},
+	{"m_key", 'm', 1, "<key>", "M_Key to use in request"},
 	{"errors", 'e', 0, NULL, "show send and receive errors"},
 	{"verbose", 'v', 0, NULL, "increase verbosity level"},
 	{"debug", 'd', 0, NULL, "raise debug level"},
diff --git a/src/iblinkinfo.c b/src/iblinkinfo.c
index e4a8d65..2a55cf5 100644
--- a/src/iblinkinfo.c
+++ b/src/iblinkinfo.c
@@ -632,12 +632,15 @@ int main(int argc, char **argv)
 		exit(1);
 	}
 
+	smp_mkey_set(ibmad_port, ibd_mkey);
+
 	if (ibd_timeout) {
 		mad_rpc_set_timeout(ibmad_port, ibd_timeout);
 		config.timeout_ms = ibd_timeout;
 	}
 
 	config.flags = ibd_ibnetdisc_flags;
+	config.mkey = ibd_mkey;
 
 	node_name_map = open_node_name_map(node_name_map_file);
 
diff --git a/src/ibnetdiscover.c b/src/ibnetdiscover.c
index 6ed0801..eca88a4 100644
--- a/src/ibnetdiscover.c
+++ b/src/ibnetdiscover.c
@@ -1074,7 +1074,7 @@ int main(int argc, char **argv)
 	};
 	char usage_args[] = "[topology-file]";
 
-	ibdiag_process_opts(argc, argv, &config, "DGKLs", opts, process_opt,
+	ibdiag_process_opts(argc, argv, &config, "DGKLms", opts, process_opt,
 			    usage_args, NULL);
 
 	f = stdout;
diff --git a/src/ibping.c b/src/ibping.c
index 6d3246c..0243dd1 100644
--- a/src/ibping.c
+++ b/src/ibping.c
@@ -202,7 +202,7 @@ int main(int argc, char **argv)
 	};
 	char usage_args[] = "<dest lid|guid>";
 
-	ibdiag_process_opts(argc, argv, NULL, "DK", opts, process_opt,
+	ibdiag_process_opts(argc, argv, NULL, "DKm", opts, process_opt,
 			    usage_args, NULL);
 
 	argc -= optind;
diff --git a/src/ibportstate.c b/src/ibportstate.c
index b2df212..02cf333 100644
--- a/src/ibportstate.c
+++ b/src/ibportstate.c
@@ -394,6 +394,8 @@ int main(int argc, char **argv)
 	if (!srcport)
 		IBERROR("Failed to open '%s' port '%d'", ibd_ca, ibd_ca_port);
 
+	smp_mkey_set(srcport, ibd_mkey);
+
 	if (resolve_portid_str(ibd_ca, ibd_ca_port, &portid, argv[0],
 			       ibd_dest_type, ibd_sm_id, srcport) < 0)
 		IBERROR("can't resolve destination port %s", argv[0]);
diff --git a/src/ibqueryerrors.c b/src/ibqueryerrors.c
index c4ffcf1..076327c 100644
--- a/src/ibqueryerrors.c
+++ b/src/ibqueryerrors.c
@@ -914,12 +914,15 @@ int main(int argc, char **argv)
 	if (!ibmad_port)
 		IBERROR("Failed to open port; %s:%d\n", ibd_ca, ibd_ca_port);
 
+	smp_mkey_set(ibmad_port, ibd_mkey);
+
 	if (ibd_timeout) {
 		mad_rpc_set_timeout(ibmad_port, ibd_timeout);
 		config.timeout_ms = ibd_timeout;
 	}
 
 	config.flags = ibd_ibnetdisc_flags;
+	config.mkey = ibd_mkey;
 
 	node_name_map = open_node_name_map(node_name_map_file);
 
diff --git a/src/ibroute.c b/src/ibroute.c
index 63baf04..06549f5 100644
--- a/src/ibroute.c
+++ b/src/ibroute.c
@@ -432,6 +432,8 @@ int main(int argc, char **argv)
 	if (!srcport)
 		IBERROR("Failed to open '%s' port '%d'", ibd_ca, ibd_ca_port);
 
+	smp_mkey_set(srcport, ibd_mkey);
+
 	if (resolve_portid_str(ibd_ca, ibd_ca_port, &portid, argv[0],
 			       ibd_dest_type, ibd_sm_id, srcport) < 0)
 		IBERROR("can't resolve destination port %s", argv[1]);
diff --git a/src/ibsendtrap.c b/src/ibsendtrap.c
index 98bacf1..39b75c2 100644
--- a/src/ibsendtrap.c
+++ b/src/ibsendtrap.c
@@ -209,6 +209,8 @@ int main(int argc, char **argv)
 	if (!srcport)
 		IBERROR("Failed to open '%s' port '%d'", ibd_ca, ibd_ca_port);
 
+	smp_mkey_set(srcport, ibd_mkey);
+
 	rc = process_send_trap(trap_name);
 	mad_rpc_close_port(srcport);
 	return rc;
diff --git a/src/ibstat.c b/src/ibstat.c
index 12d3c20..87fd9dd 100644
--- a/src/ibstat.c
+++ b/src/ibstat.c
@@ -292,7 +292,7 @@ int main(int argc, char *argv[])
 		NULL
 	};
 
-	ibdiag_process_opts(argc, argv, NULL, "CDeGKLPst", opts, process_opt,
+	ibdiag_process_opts(argc, argv, NULL, "CDeGKLmPst", opts, process_opt,
 			    usage_args, usage_examples);
 
 	argc -= optind;
diff --git a/src/ibsysstat.c b/src/ibsysstat.c
index bac4bb1..ac967c4 100644
--- a/src/ibsysstat.c
+++ b/src/ibsysstat.c
@@ -326,7 +326,7 @@ int main(int argc, char **argv)
 	};
 	char usage_args[] = "<dest lid|guid> [<op>]";
 
-	ibdiag_process_opts(argc, argv, NULL, "DK", opts, process_opt,
+	ibdiag_process_opts(argc, argv, NULL, "DKm", opts, process_opt,
 			    usage_args, NULL);
 
 	argc -= optind;
diff --git a/src/ibtracert.c b/src/ibtracert.c
index 575d9d0..6932f34 100644
--- a/src/ibtracert.c
+++ b/src/ibtracert.c
@@ -757,7 +757,7 @@ int main(int argc, char **argv)
 		NULL,
 	};
 
-	ibdiag_process_opts(argc, argv, NULL, "DK", opts, process_opt,
+	ibdiag_process_opts(argc, argv, NULL, "DKm", opts, process_opt,
 			    usage_args, usage_examples);
 
 	f = stdout;
@@ -774,6 +774,8 @@ int main(int argc, char **argv)
 	if (!srcport)
 		IBERROR("Failed to open '%s' port '%d'", ibd_ca, ibd_ca_port);
 
+	smp_mkey_set(srcport, ibd_mkey);
+
 	node_name_map = open_node_name_map(node_name_map_file);
 
 	if (resolve_portid_str(ibd_ca, ibd_ca_port, &src_portid, argv[0],
diff --git a/src/perfquery.c b/src/perfquery.c
index 9ca2e15..e85b14e 100644
--- a/src/perfquery.c
+++ b/src/perfquery.c
@@ -727,6 +727,8 @@ int main(int argc, char **argv)
 	if (!srcport)
 		IBERROR("Failed to open '%s' port '%d'", ibd_ca, ibd_ca_port);
 
+	smp_mkey_set(srcport, ibd_mkey);
+
 	if (argc) {
 		if (resolve_portid_str(ibd_ca, ibd_ca_port, &portid, argv[0],
 				       ibd_dest_type, ibd_sm_id, srcport) < 0)
diff --git a/src/saquery.c b/src/saquery.c
index 90feb2d..dec990a 100644
--- a/src/saquery.c
+++ b/src/saquery.c
@@ -1636,7 +1636,7 @@ int main(int argc, char **argv)
 	q = NULL;
 	ibd_timeout = DEFAULT_SA_TIMEOUT_MS;
 
-	ibdiag_process_opts(argc, argv, &params, "DGLs", opts, process_opt,
+	ibdiag_process_opts(argc, argv, &params, "DGLms", opts, process_opt,
 			    usage_args, NULL);
 
 	argc -= optind;
diff --git a/src/sminfo.c b/src/sminfo.c
index 1c12204..2471a08 100644
--- a/src/sminfo.c
+++ b/src/sminfo.c
@@ -122,6 +122,8 @@ int main(int argc, char **argv)
 	if (!srcport)
 		IBERROR("Failed to open '%s' port '%d'", ibd_ca, ibd_ca_port);
 
+	smp_mkey_set(srcport, ibd_mkey);
+
 	if (argc) {
 		if (resolve_portid_str(ibd_ca, ibd_ca_port, &portid, argv[0],
 				       ibd_dest_type, 0, srcport) < 0)
diff --git a/src/smpquery.c b/src/smpquery.c
index 2909dc5..7b7036b 100644
--- a/src/smpquery.c
+++ b/src/smpquery.c
@@ -478,6 +478,8 @@ int main(int argc, char **argv)
 	if (!srcport)
 		IBERROR("Failed to open '%s' port '%d'", ibd_ca, ibd_ca_port);
 
+	smp_mkey_set(srcport, ibd_mkey);
+
 	node_name_map = open_node_name_map(node_name_map_file);
 
 	if (ibd_dest_type != IB_DEST_DRSLID) {
diff --git a/src/vendstat.c b/src/vendstat.c
index dd89da7..4750cdd 100644
--- a/src/vendstat.c
+++ b/src/vendstat.c
@@ -332,7 +332,7 @@ int main(int argc, char **argv)
 		NULL
 	};
 
-	ibdiag_process_opts(argc, argv, NULL, "DK", opts, process_opt,
+	ibdiag_process_opts(argc, argv, NULL, "DKm", opts, process_opt,
 			    usage_args, usage_examples);
 
 	argc -= optind;
-- 
1.7.9.2

--
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] 32+ messages in thread

* [PATCH V3 5/8] infiniband-diags/ibportstate.c: Support changing MKey, lease, and protect bits
       [not found]     ` <1338398497-12444-1-git-send-email-foraker1-i2BcT+NCU+M@public.gmane.org>
                         ` (2 preceding siblings ...)
  2012-05-30 17:21       ` [PATCH V3 4/8] infiniband-diags: Allow specification of an mkey to use on the command line Jim Foraker
@ 2012-05-30 17:21       ` Jim Foraker
       [not found]         ` <1338398497-12444-5-git-send-email-foraker1-i2BcT+NCU+M@public.gmane.org>
  2012-05-30 17:21       ` [PATCH V3 6/8] infiniband-diags: Add m_key option to config file Jim Foraker
                         ` (4 subsequent siblings)
  8 siblings, 1 reply; 32+ messages in thread
From: Jim Foraker @ 2012-05-30 17:21 UTC (permalink / raw)
  To: linux-rdma-u79uwXL29TY76Z2rM5mHXA; +Cc: weiny2-i2BcT+NCU+M, Jim Foraker


Signed-off-by: Jim Foraker <foraker1-i2BcT+NCU+M@public.gmane.org>
---
 doc/rst/ibportstate.8.in.rst |    6 ++++
 src/ibportstate.c            |   72 ++++++++++++++++++++++++++++++++++--------
 2 files changed, 65 insertions(+), 13 deletions(-)

diff --git a/doc/rst/ibportstate.8.in.rst b/doc/rst/ibportstate.8.in.rst
index fca3f7a..052e86a 100644
--- a/doc/rst/ibportstate.8.in.rst
+++ b/doc/rst/ibportstate.8.in.rst
@@ -61,6 +61,12 @@ OPTIONS
         done on a switch. This peer port validation feature of query op
         requires LID routing to be functioning in the subnet.
 
+        **mkey, mkeylease, and mkeyprot** are only allowed on CAs, routers, or
+        switch port 0 (An error is generated if attempted on external switch
+        ports).  Hexadecimal and octal mkeys may be specified by prepending the
+        key with '0x' or '0', respectively.  If a non-numeric value (like 'x')
+        is specified for the mkey, then ibportstate will prompt for a value.
+
 
 Addressing Flags
 ----------------
diff --git a/src/ibportstate.c b/src/ibportstate.c
index 02cf333..743a276 100644
--- a/src/ibportstate.c
+++ b/src/ibportstate.c
@@ -41,6 +41,7 @@
 #include <unistd.h>
 #include <string.h>
 #include <getopt.h>
+#include <errno.h>
 
 #include <infiniband/umad.h>
 #include <infiniband/mad.h>
@@ -64,22 +65,28 @@ enum port_ops {
 	LID,
 	SMLID,
 	LMC,
+	MKEY,
+	MKEYLEASE,
+	MKEYPROT,
 };
 
 struct ibmad_port *srcport;
-int speed = 0; /* no state change */
-int espeed = 0; /* no state change */
-int fdr10 = 0; /* no state change */
-int width = 0; /* no state change */
-int lid;
-int smlid;
-int lmc;
-int mtu;
-int vls = 0; /* no state change */
+uint64_t speed = 0; /* no state change */
+uint64_t espeed = 0; /* no state change */
+uint64_t fdr10 = 0; /* no state change */
+uint64_t width = 0; /* no state change */
+uint64_t lid;
+uint64_t smlid;
+uint64_t lmc;
+uint64_t mtu;
+uint64_t vls = 0; /* no state change */
+uint64_t mkey;
+uint64_t mkeylease;
+uint64_t mkeyprot;
 
 struct {
 	const char *name;
-	int *val;
+	uint64_t *val;
 	int set;
 } port_args[] = {
 	{"query", NULL, 0},	/* QUERY */
@@ -98,6 +105,9 @@ struct {
 	{"lid", &lid, 0},	/* LID */
 	{"smlid", &smlid, 0},	/* SMLID */
 	{"lmc", &lmc, 0},	/* LMC */
+	{"mkey", &mkey, 0},	/* MKEY */
+	{"mkeylease", &mkeylease, 0},	/* MKEY LEASE */
+	{"mkeyprot", &mkeyprot, 0},	/* MKEY PROTECT BITS */
 };
 
 #define NPORT_ARGS (sizeof(port_args) / sizeof(port_args[0]))
@@ -367,9 +377,10 @@ int main(int argc, char **argv)
 	int i;
 	uint16_t devid, rem_devid;
 	long val;
+	char *endp;
 	char usage_args[] = "<dest dr_path|lid|guid> <portnum> [<op>]\n"
 	    "\nSupported ops: enable, disable, reset, speed, width, query,\n"
-	    "\tdown, arm, active, vls, mtu, lid, smlid, lmc\n";
+	    "\tdown, arm, active, vls, mtu, lid, smlid, lmc, mkey, mkeylease, mkeyprot\n";
 	const char *usage_examples[] = {
 		"3 1 disable\t\t\t# by lid",
 		"-G 0x2C9000100D051 1 enable\t# by guid",
@@ -423,7 +434,7 @@ int main(int argc, char **argv)
 			if (++i >= argc)
 				IBERROR("%s requires an additional parameter",
 					port_args[j].name);
-			val = strtol(argv[i], 0, 0);
+			val = strtoull(argv[i], 0, 0);
 			switch (j) {
 			case SPEED:
 				if (val < 0 || val > 15)
@@ -461,8 +472,29 @@ int main(int argc, char **argv)
 			case LMC:
 				if (val < 0 || val > 7)
 					IBERROR("invalid lmc value %ld", val);
+				break;
+			case MKEY:
+				errno = 0;
+				val = strtoull(argv[i], &endp, 0);
+				if (errno || *endp != '\0') {
+					errno = 0;
+					val = strtoull(getpass("New M_Key: "),
+						       &endp, 0);
+					if (errno || *endp != '\0') {
+						IBERROR("Bad new M_Key\n");
+					}
+				}
+				/* All 64-bit values are legal */
+				break;
+			case MKEYLEASE:
+				if (val < 0 || val > 0xFFFF)
+					IBERROR("invalid mkey lease time %ld", val);
+				break;
+			case MKEYPROT:
+				if (val < 0 || val > 3)
+					IBERROR("invalid mkey protection bit setting %ld", val);
 			}
-			*port_args[j].val = (int)val;
+			*port_args[j].val = val;
 			changed = 1;
 			break;
 		}
@@ -475,6 +507,10 @@ int main(int argc, char **argv)
 	is_switch = get_node_info(&portid, data);
 	devid = (uint16_t) mad_get_field(data, 0, IB_NODE_DEVID_F);
 
+	if ((port_args[MKEY].set || port_args[MKEYLEASE].set ||
+	     port_args[MKEYPROT].set) && is_switch && portnum != 0)
+		IBERROR("Can't set M_Key fields on switch port != 0");
+
 	if (port_op != QUERY || changed)
 		printf("Initial %s PortInfo:\n", is_switch ? "Switch" : "CA");
 	else
@@ -547,6 +583,16 @@ int main(int argc, char **argv)
 				      fdr10);
 			set_ext_port_info(&portid, data2, portnum);
 		}
+
+		if (port_args[MKEY].set)
+			mad_set_field64(data, 0, IB_PORT_MKEY_F, mkey);
+		if (port_args[MKEYLEASE].set)
+			mad_set_field(data, 0, IB_PORT_MKEY_LEASE_F,
+				      mkeylease);
+		if (port_args[MKEYPROT].set)
+			mad_set_field(data, 0, IB_PORT_MKEY_PROT_BITS_F,
+				      mkeyprot);
+
 		set_port_info(&portid, data, portnum, espeed_cap, is_switch);
 
 	} else if (is_switch && portnum) {
-- 
1.7.9.2

--
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] 32+ messages in thread

* [PATCH V3 6/8] infiniband-diags: Add m_key option to config file
       [not found]     ` <1338398497-12444-1-git-send-email-foraker1-i2BcT+NCU+M@public.gmane.org>
                         ` (3 preceding siblings ...)
  2012-05-30 17:21       ` [PATCH V3 5/8] infiniband-diags/ibportstate.c: Support changing MKey, lease, and protect bits Jim Foraker
@ 2012-05-30 17:21       ` Jim Foraker
       [not found]         ` <1338398497-12444-6-git-send-email-foraker1-i2BcT+NCU+M@public.gmane.org>
  2012-05-30 17:21       ` [PATCH V3 7/8] ib-diags/saquery: Fix smkey handling Jim Foraker
                         ` (3 subsequent siblings)
  8 siblings, 1 reply; 32+ messages in thread
From: Jim Foraker @ 2012-05-30 17:21 UTC (permalink / raw)
  To: linux-rdma-u79uwXL29TY76Z2rM5mHXA; +Cc: weiny2-i2BcT+NCU+M, Jim Foraker


Signed-off-by: Jim Foraker <foraker1-i2BcT+NCU+M@public.gmane.org>
---
 etc/ibdiag.conf     |    2 ++
 src/ibdiag_common.c |    2 ++
 2 files changed, 4 insertions(+)

diff --git a/etc/ibdiag.conf b/etc/ibdiag.conf
index 77f3ce9..2a2334f 100644
--- a/etc/ibdiag.conf
+++ b/etc/ibdiag.conf
@@ -15,3 +15,5 @@
 # Default = true
 #MLX_EPI=false
 
+# define a default m_key
+#m_key=0x00
diff --git a/src/ibdiag_common.c b/src/ibdiag_common.c
index 069f6e5..d7d784f 100644
--- a/src/ibdiag_common.c
+++ b/src/ibdiag_common.c
@@ -157,6 +157,8 @@ void read_ibdiag_config(const char *file)
 			} else {
 				ibd_ibnetdisc_flags &= ~IBND_CONFIG_MLX_EPI;
 			}
+		} else if (strncmp(name, "m_key", strlen("m_key")) == 0) {
+			ibd_mkey = strtoull(val_str, 0, 0);
 		}
 	}
 
-- 
1.7.9.2

--
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] 32+ messages in thread

* [PATCH V3 7/8] ib-diags/saquery: Fix smkey handling
       [not found]     ` <1338398497-12444-1-git-send-email-foraker1-i2BcT+NCU+M@public.gmane.org>
                         ` (4 preceding siblings ...)
  2012-05-30 17:21       ` [PATCH V3 6/8] infiniband-diags: Add m_key option to config file Jim Foraker
@ 2012-05-30 17:21       ` Jim Foraker
       [not found]         ` <1338398497-12444-7-git-send-email-foraker1-i2BcT+NCU+M@public.gmane.org>
  2012-05-30 17:21       ` [PATCH V3 8/8] infiniband-diags: Add sa_smkey option to config file Jim Foraker
                         ` (2 subsequent siblings)
  8 siblings, 1 reply; 32+ messages in thread
From: Jim Foraker @ 2012-05-30 17:21 UTC (permalink / raw)
  To: linux-rdma-u79uwXL29TY76Z2rM5mHXA; +Cc: weiny2-i2BcT+NCU+M, Jim Foraker

smkey is already defined as a global inside saquery.c, so remove
broken support for passing it around as a function parameter

Signed-off-by: Jim Foraker <foraker1-i2BcT+NCU+M@public.gmane.org>
---
 include/ibdiag_common.h |    1 +
 src/ibdiag_common.c     |    1 +
 src/saquery.c           |   60 +++++++++++++++++++++++------------------------
 3 files changed, 31 insertions(+), 31 deletions(-)

diff --git a/include/ibdiag_common.h b/include/ibdiag_common.h
index 0120203..63b8ab0 100644
--- a/include/ibdiag_common.h
+++ b/include/ibdiag_common.h
@@ -52,6 +52,7 @@ extern ib_portid_t *ibd_sm_id;
 extern int ibd_timeout;
 extern uint32_t ibd_ibnetdisc_flags;
 extern uint64_t ibd_mkey;
+extern uint64_t ibd_sa_smkey;
 extern int show_keys;
 
 /*========================================================*/
diff --git a/src/ibdiag_common.c b/src/ibdiag_common.c
index d7d784f..c40490a 100644
--- a/src/ibdiag_common.c
+++ b/src/ibdiag_common.c
@@ -72,6 +72,7 @@ int ibd_ca_port = 0;
 int ibd_timeout = 0;
 uint32_t ibd_ibnetdisc_flags = IBND_CONFIG_MLX_EPI;
 uint64_t ibd_mkey;
+uint64_t ibd_sa_smkey;
 int show_keys = 0;
 
 static const char *prog_name;
diff --git a/src/saquery.c b/src/saquery.c
index dec990a..9ca7375 100644
--- a/src/saquery.c
+++ b/src/saquery.c
@@ -85,7 +85,6 @@ struct query_cmd {
 
 static char *node_name_map_file = NULL;
 static nn_map_t *node_name_map = NULL;
-static uint64_t smkey = 1;
 
 /**
  * Declare some globals because I don't want this to be too complex.
@@ -724,11 +723,11 @@ static void dump_results(struct sa_query_result *r, void (*dump_func) (void *))
  */
 static int get_any_records(bind_handle_t h,
 			   uint16_t attr_id, uint32_t attr_mod,
-			   ib_net64_t comp_mask, void *attr, uint64_t sm_key,
+			   ib_net64_t comp_mask, void *attr,
 			   struct sa_query_result *result)
 {
 	int ret = sa_query(h, IB_MAD_METHOD_GET_TABLE, attr_id, attr_mod,
-			   cl_ntoh64(comp_mask), sm_key, attr, result);
+			   cl_ntoh64(comp_mask), ibd_sa_smkey, attr, result);
 	if (ret) {
 		fprintf(stderr, "Query SA failed: %s\n", strerror(ret));
 		return ret;
@@ -744,12 +743,12 @@ static int get_any_records(bind_handle_t h,
 
 static int get_and_dump_any_records(bind_handle_t h, uint16_t attr_id,
 				    uint32_t attr_mod, ib_net64_t comp_mask,
-				    void *attr, uint64_t sm_key,
+				    void *attr,
 				    void (*dump_func) (void *))
 {
 	struct sa_query_result result;
 	int ret = get_any_records(h, attr_id, attr_mod, comp_mask, attr,
-				  sm_key, &result);
+				  &result);
 	if (ret)
 		return ret;
 
@@ -761,18 +760,17 @@ static int get_and_dump_any_records(bind_handle_t h, uint16_t attr_id,
 /**
  * Get all the records available for requested query type.
  */
-static int get_all_records(bind_handle_t h, uint16_t attr_id, int trusted,
+static int get_all_records(bind_handle_t h, uint16_t attr_id,
 			   struct sa_query_result *result)
 {
-	return get_any_records(h, attr_id, 0, 0, NULL, trusted ? smkey : 0,
-			       result);
+	return get_any_records(h, attr_id, 0, 0, NULL, result);
 }
 
 static int get_and_dump_all_records(bind_handle_t h, uint16_t attr_id,
-				    int trusted, void (*dump_func) (void *))
+				    void (*dump_func) (void *))
 {
 	struct sa_query_result result;
-	int ret = get_all_records(h, attr_id, 0, &result);
+	int ret = get_all_records(h, attr_id, &result);
 	if (ret)
 		return ret;
 
@@ -792,7 +790,7 @@ static int get_lid_from_name(bind_handle_t h, const char *name, uint16_t * lid)
 	int ret;
 	struct sa_query_result result;
 
-	ret = get_all_records(h, IB_SA_ATTR_NODERECORD, 0, &result);
+	ret = get_all_records(h, IB_SA_ATTR_NODERECORD, &result);
 	if (ret)
 		return ret;
 
@@ -892,7 +890,7 @@ static int get_issm_records(bind_handle_t h, ib_net32_t capability_mask,
 	attr.port_info.capability_mask = capability_mask;
 
 	return get_any_records(h, IB_SA_ATTR_PORTINFORECORD, 1 << 31,
-			       IB_PIR_COMPMASK_CAPMASK, &attr, 0, result);
+			       IB_PIR_COMPMASK_CAPMASK, &attr, result);
 }
 
 static int print_node_records(bind_handle_t h)
@@ -901,7 +899,7 @@ static int print_node_records(bind_handle_t h)
 	int ret;
 	struct sa_query_result result;
 
-	ret = get_all_records(h, IB_SA_ATTR_NODERECORD, 0, &result);
+	ret = get_all_records(h, IB_SA_ATTR_NODERECORD, &result);
 	if (ret)
 		return ret;
 
@@ -944,7 +942,7 @@ static int get_print_class_port_info(bind_handle_t h)
 {
 	struct sa_query_result result;
 	int ret = sa_query(h, IB_MAD_METHOD_GET, CLASS_PORT_INFO, 0, 0,
-			   0, NULL, &result);
+			   ibd_sa_smkey, NULL, &result);
 	if (ret) {
 		fprintf(stderr, "ERROR: Query SA failed: %s\n", strerror(ret));
 		return ret;
@@ -991,7 +989,7 @@ static int query_path_records(const struct query_cmd *q, bind_handle_t h,
 				  SELEC);
 
 	return get_and_dump_any_records(h, IB_SA_ATTR_PATHRECORD, 0, comp_mask,
-					&pr, 0, dump_path_record);
+					&pr, dump_path_record);
 }
 
 static int print_issm_records(bind_handle_t h)
@@ -1027,11 +1025,11 @@ static int print_multicast_member_records(bind_handle_t h)
 	int ret;
 	unsigned i;
 
-	ret = get_all_records(h, IB_SA_ATTR_MCRECORD, 1, &mc_group_result);
+	ret = get_all_records(h, IB_SA_ATTR_MCRECORD, &mc_group_result);
 	if (ret)
 		return ret;
 
-	ret = get_all_records(h, IB_SA_ATTR_NODERECORD, 0, &nr_result);
+	ret = get_all_records(h, IB_SA_ATTR_NODERECORD, &nr_result);
 	if (ret)
 		goto return_mc;
 
@@ -1052,7 +1050,7 @@ return_mc:
 
 static int print_multicast_group_records(bind_handle_t h)
 {
-	return get_and_dump_all_records(h, IB_SA_ATTR_MCRECORD, 0,
+	return get_and_dump_all_records(h, IB_SA_ATTR_MCRECORD,
 					dump_multicast_group_record);
 }
 
@@ -1076,7 +1074,7 @@ static int query_node_records(const struct query_cmd *q, bind_handle_t h,
 	CHECK_AND_SET_VAL(lid, 16, 0, nr.lid, NR, LID);
 
 	return get_and_dump_any_records(h, IB_SA_ATTR_NODERECORD, 0, comp_mask,
-					&nr, 0, dump_node_record);
+					&nr, dump_node_record);
 }
 
 static int query_portinfo_records(const struct query_cmd *q,
@@ -1096,7 +1094,7 @@ static int query_portinfo_records(const struct query_cmd *q,
 	CHECK_AND_SET_VAL(options, 8, -1, pir.options, PIR, OPTIONS);
 
 	return get_and_dump_any_records(h, IB_SA_ATTR_PORTINFORECORD, 0,
-					comp_mask, &pir, 0,
+					comp_mask, &pir,
 					dump_one_portinfo_record);
 }
 
@@ -1129,13 +1127,13 @@ static int query_mcmember_records(const struct query_cmd *q,
 	CHECK_AND_SET_VAL(p->proxy_join, 8, -1, mr.proxy_join, MCR, PROXY);
 
 	return get_and_dump_any_records(h, IB_SA_ATTR_MCRECORD, 0, comp_mask,
-					&mr, smkey, dump_one_mcmember_record);
+					&mr, dump_one_mcmember_record);
 }
 
 static int query_service_records(const struct query_cmd *q, bind_handle_t h,
 				 struct query_params *p, int argc, char *argv[])
 {
-	return get_and_dump_all_records(h, IB_SA_ATTR_SERVICERECORD, 0,
+	return get_and_dump_all_records(h, IB_SA_ATTR_SERVICERECORD,
 					dump_service_record);
 }
 
@@ -1143,7 +1141,7 @@ static int query_informinfo_records(const struct query_cmd *q,
 				    bind_handle_t h, struct query_params *p,
 				    int argc, char *argv[])
 {
-	return get_and_dump_all_records(h, IB_SA_ATTR_INFORMINFORECORD, 0,
+	return get_and_dump_all_records(h, IB_SA_ATTR_INFORMINFORECORD,
 					dump_inform_info_record);
 }
 
@@ -1167,7 +1165,7 @@ static int query_link_records(const struct query_cmd *q, bind_handle_t h,
 	CHECK_AND_SET_VAL(to_port, 8, -1, lr.to_port_num, LR, TO_PORT);
 
 	return get_and_dump_any_records(h, IB_SA_ATTR_LINKRECORD, 0, comp_mask,
-					&lr, 0, dump_one_link_record);
+					&lr, dump_one_link_record);
 }
 
 static int query_sl2vl_records(const struct query_cmd *q, bind_handle_t h,
@@ -1186,7 +1184,7 @@ static int query_sl2vl_records(const struct query_cmd *q, bind_handle_t h,
 	CHECK_AND_SET_VAL(out_port, 8, -1, slvl.out_port_num, SLVL, OUT_PORT);
 
 	return get_and_dump_any_records(h, IB_SA_ATTR_SL2VLTABLERECORD, 0,
-					comp_mask, &slvl, 0,
+					comp_mask, &slvl,
 					dump_one_slvl_record);
 }
 
@@ -1206,7 +1204,7 @@ static int query_vlarb_records(const struct query_cmd *q, bind_handle_t h,
 	CHECK_AND_SET_VAL(block, 8, -1, vlarb.block_num, VLA, BLOCK);
 
 	return get_and_dump_any_records(h, IB_SA_ATTR_VLARBTABLERECORD, 0,
-					comp_mask, &vlarb, 0,
+					comp_mask, &vlarb,
 					dump_one_vlarb_record);
 }
 
@@ -1227,7 +1225,7 @@ static int query_pkey_tbl_records(const struct query_cmd *q,
 	CHECK_AND_SET_VAL(block, 16, -1, pktr.block_num, PKEY, BLOCK);
 
 	return get_and_dump_any_records(h, IB_SA_ATTR_PKEYTABLERECORD, 0,
-					comp_mask, &pktr, smkey,
+					comp_mask, &pktr,
 					dump_one_pkey_tbl_record);
 }
 
@@ -1246,7 +1244,7 @@ static int query_lft_records(const struct query_cmd *q, bind_handle_t h,
 	CHECK_AND_SET_VAL(block, 16, -1, lftr.block_num, LFTR, BLOCK);
 
 	return get_and_dump_any_records(h, IB_SA_ATTR_LFTRECORD, 0, comp_mask,
-					&lftr, 0, dump_one_lft_record);
+					&lftr, dump_one_lft_record);
 }
 
 static int query_guidinfo_records(const struct query_cmd *q, bind_handle_t h,
@@ -1264,7 +1262,7 @@ static int query_guidinfo_records(const struct query_cmd *q, bind_handle_t h,
 	CHECK_AND_SET_VAL(block, 8, -1, gir.block_num, GIR, BLOCKNUM);
 
 	return get_and_dump_any_records(h, IB_SA_ATTR_GUIDINFORECORD, 0,
-					comp_mask, &gir, 0,
+					comp_mask, &gir,
 					dump_one_guidinfo_record);
 }
 
@@ -1287,7 +1285,7 @@ static int query_mft_records(const struct query_cmd *q, bind_handle_t h,
 	mftr.position_block_num |= cl_hton16(pos << 12);
 
 	return get_and_dump_any_records(h, IB_SA_ATTR_MFTRECORD, 0, comp_mask,
-					&mftr, 0, dump_one_mft_record);
+					&mftr, dump_one_mft_record);
 }
 
 static const struct query_cmd query_cmds[] = {
@@ -1399,7 +1397,7 @@ static int process_opt(void *context, int ch, char *optarg)
 			fprintf(stderr, "cannot get SM_Key\n");
 			ibdiag_show_usage();
 		}
-		smkey = strtoull(optarg, NULL, 0);
+		ibd_sa_smkey = strtoull(optarg, NULL, 0);
 		break;
 	case 'p':
 		query_type = IB_SA_ATTR_PATHRECORD;
-- 
1.7.9.2

--
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] 32+ messages in thread

* [PATCH V3 8/8] infiniband-diags: Add sa_smkey option to config file
       [not found]     ` <1338398497-12444-1-git-send-email-foraker1-i2BcT+NCU+M@public.gmane.org>
                         ` (5 preceding siblings ...)
  2012-05-30 17:21       ` [PATCH V3 7/8] ib-diags/saquery: Fix smkey handling Jim Foraker
@ 2012-05-30 17:21       ` Jim Foraker
       [not found]         ` <1338398497-12444-8-git-send-email-foraker1-i2BcT+NCU+M@public.gmane.org>
  2012-05-31 11:48       ` [PATCH V3 1/8] infiniband-diags: Obfuscate sensitive output by default Hal Rosenstock
  2012-05-31 22:15       ` Ira Weiny
  8 siblings, 1 reply; 32+ messages in thread
From: Jim Foraker @ 2012-05-30 17:21 UTC (permalink / raw)
  To: linux-rdma-u79uwXL29TY76Z2rM5mHXA; +Cc: weiny2-i2BcT+NCU+M, Jim Foraker

Defines a default for the smkey used in SA requests

Signed-off-by: Jim Foraker <foraker1-i2BcT+NCU+M@public.gmane.org>
---
 etc/ibdiag.conf     |    3 +++
 src/ibdiag_common.c |    3 +++
 2 files changed, 6 insertions(+)

diff --git a/etc/ibdiag.conf b/etc/ibdiag.conf
index 2a2334f..1e6149d 100644
--- a/etc/ibdiag.conf
+++ b/etc/ibdiag.conf
@@ -17,3 +17,6 @@
 
 # define a default m_key
 #m_key=0x00
+
+# default smkey to be used for SA requests
+#sa_smkey=0x00
diff --git a/src/ibdiag_common.c b/src/ibdiag_common.c
index c40490a..1301810 100644
--- a/src/ibdiag_common.c
+++ b/src/ibdiag_common.c
@@ -160,6 +160,9 @@ void read_ibdiag_config(const char *file)
 			}
 		} else if (strncmp(name, "m_key", strlen("m_key")) == 0) {
 			ibd_mkey = strtoull(val_str, 0, 0);
+		} else if (strncmp(name, "sa_smkey",
+				   strlen("sa_smkey")) == 0) {
+			ibd_sa_smkey = strtoull(val_str, 0, 0);
 		}
 	}
 
-- 
1.7.9.2

--
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] 32+ messages in thread

* Re: [PATCH V3 8/8] infiniband-diags: Add sa_smkey option to config file
       [not found]         ` <1338398497-12444-8-git-send-email-foraker1-i2BcT+NCU+M@public.gmane.org>
@ 2012-05-30 18:06           ` Hal Rosenstock
       [not found]             ` <4FC66196.5030704-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
  2012-05-30 22:15           ` [PATCH V3.1 " Jim Foraker
  1 sibling, 1 reply; 32+ messages in thread
From: Hal Rosenstock @ 2012-05-30 18:06 UTC (permalink / raw)
  To: Jim Foraker; +Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA, weiny2-i2BcT+NCU+M

On 5/30/2012 1:21 PM, Jim Foraker wrote:
> Defines a default for the smkey used in SA requests
> 
> Signed-off-by: Jim Foraker <foraker1-i2BcT+NCU+M@public.gmane.org>
> ---
>  etc/ibdiag.conf     |    3 +++
>  src/ibdiag_common.c |    3 +++
>  2 files changed, 6 insertions(+)
> 
> diff --git a/etc/ibdiag.conf b/etc/ibdiag.conf
> index 2a2334f..1e6149d 100644
> --- a/etc/ibdiag.conf
> +++ b/etc/ibdiag.conf
> @@ -17,3 +17,6 @@
>  
>  # define a default m_key
>  #m_key=0x00
> +
> +# default smkey to be used for SA requests
> +#sa_smkey=0x00
> diff --git a/src/ibdiag_common.c b/src/ibdiag_common.c
> index c40490a..1301810 100644
> --- a/src/ibdiag_common.c
> +++ b/src/ibdiag_common.c
> @@ -160,6 +160,9 @@ void read_ibdiag_config(const char *file)
>  			}
>  		} else if (strncmp(name, "m_key", strlen("m_key")) == 0) {
>  			ibd_mkey = strtoull(val_str, 0, 0);
> +		} else if (strncmp(name, "sa_smkey",
> +				   strlen("sa_smkey")) == 0) {

For consistency with OpenSM naming, how about sa_key for this ?

-- Hal

> +			ibd_sa_smkey = strtoull(val_str, 0, 0);
>  		}
>  	}
>  

--
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] 32+ messages in thread

* Re: [PATCH V3 8/8] infiniband-diags: Add sa_smkey option to config file
       [not found]             ` <4FC66196.5030704-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
@ 2012-05-30 18:43               ` Jim Foraker
       [not found]                 ` <1338403407.17237.860.camel-mxTxeWJot8FliZ7u+bvwcg@public.gmane.org>
  0 siblings, 1 reply; 32+ messages in thread
From: Jim Foraker @ 2012-05-30 18:43 UTC (permalink / raw)
  To: Hal Rosenstock
  Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Weiny, Ira K.


On Wed, 2012-05-30 at 11:06 -0700, Hal Rosenstock wrote:
> On 5/30/2012 1:21 PM, Jim Foraker wrote:
> > Defines a default for the smkey used in SA requests
> > 
> > Signed-off-by: Jim Foraker <foraker1-i2BcT+NCU+M@public.gmane.org>
> > ---
> >  etc/ibdiag.conf     |    3 +++
> >  src/ibdiag_common.c |    3 +++
> >  2 files changed, 6 insertions(+)
> > 
> > diff --git a/etc/ibdiag.conf b/etc/ibdiag.conf
> > index 2a2334f..1e6149d 100644
> > --- a/etc/ibdiag.conf
> > +++ b/etc/ibdiag.conf
> > @@ -17,3 +17,6 @@
> >  
> >  # define a default m_key
> >  #m_key=0x00
> > +
> > +# default smkey to be used for SA requests
> > +#sa_smkey=0x00
> > diff --git a/src/ibdiag_common.c b/src/ibdiag_common.c
> > index c40490a..1301810 100644
> > --- a/src/ibdiag_common.c
> > +++ b/src/ibdiag_common.c
> > @@ -160,6 +160,9 @@ void read_ibdiag_config(const char *file)
> >  			}
> >  		} else if (strncmp(name, "m_key", strlen("m_key")) == 0) {
> >  			ibd_mkey = strtoull(val_str, 0, 0);
> > +		} else if (strncmp(name, "sa_smkey",
> > +				   strlen("sa_smkey")) == 0) {
> 
> For consistency with OpenSM naming, how about sa_key for this ?
     That's fine by me.  IIRC, that was actually my first choice, but I
thought there might be some objections, since it's called smkey in the
spec.

     Jim

> 
> -- Hal
> 
> > +			ibd_sa_smkey = strtoull(val_str, 0, 0);
> >  		}
> >  	}
> >  
> 
> --
> 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

--
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] 32+ messages in thread

* [PATCH V3.1 7/8] ib-diags/saquery: Fix smkey handling
       [not found]         ` <1338398497-12444-7-git-send-email-foraker1-i2BcT+NCU+M@public.gmane.org>
@ 2012-05-30 22:14           ` Jim Foraker
       [not found]             ` <1338416060-14025-1-git-send-email-foraker1-i2BcT+NCU+M@public.gmane.org>
  0 siblings, 1 reply; 32+ messages in thread
From: Jim Foraker @ 2012-05-30 22:14 UTC (permalink / raw)
  To: linux-rdma-u79uwXL29TY76Z2rM5mHXA; +Cc: weiny2-i2BcT+NCU+M, Jim Foraker

smkey is already defined as a global inside saquery.c, so remove
broken support for passing it around as a function parameter

Signed-off-by: Jim Foraker <foraker1-i2BcT+NCU+M@public.gmane.org>
---
 include/ibdiag_common.h |    1 +
 src/ibdiag_common.c     |    1 +
 src/saquery.c           |   60 +++++++++++++++++++++++------------------------
 3 files changed, 31 insertions(+), 31 deletions(-)

diff --git a/include/ibdiag_common.h b/include/ibdiag_common.h
index 0120203..6dade10 100644
--- a/include/ibdiag_common.h
+++ b/include/ibdiag_common.h
@@ -52,6 +52,7 @@ extern ib_portid_t *ibd_sm_id;
 extern int ibd_timeout;
 extern uint32_t ibd_ibnetdisc_flags;
 extern uint64_t ibd_mkey;
+extern uint64_t ibd_sakey;
 extern int show_keys;
 
 /*========================================================*/
diff --git a/src/ibdiag_common.c b/src/ibdiag_common.c
index d7d784f..eaf504f 100644
--- a/src/ibdiag_common.c
+++ b/src/ibdiag_common.c
@@ -72,6 +72,7 @@ int ibd_ca_port = 0;
 int ibd_timeout = 0;
 uint32_t ibd_ibnetdisc_flags = IBND_CONFIG_MLX_EPI;
 uint64_t ibd_mkey;
+uint64_t ibd_sakey;
 int show_keys = 0;
 
 static const char *prog_name;
diff --git a/src/saquery.c b/src/saquery.c
index dec990a..7a7878b 100644
--- a/src/saquery.c
+++ b/src/saquery.c
@@ -85,7 +85,6 @@ struct query_cmd {
 
 static char *node_name_map_file = NULL;
 static nn_map_t *node_name_map = NULL;
-static uint64_t smkey = 1;
 
 /**
  * Declare some globals because I don't want this to be too complex.
@@ -724,11 +723,11 @@ static void dump_results(struct sa_query_result *r, void (*dump_func) (void *))
  */
 static int get_any_records(bind_handle_t h,
 			   uint16_t attr_id, uint32_t attr_mod,
-			   ib_net64_t comp_mask, void *attr, uint64_t sm_key,
+			   ib_net64_t comp_mask, void *attr,
 			   struct sa_query_result *result)
 {
 	int ret = sa_query(h, IB_MAD_METHOD_GET_TABLE, attr_id, attr_mod,
-			   cl_ntoh64(comp_mask), sm_key, attr, result);
+			   cl_ntoh64(comp_mask), ibd_sakey, attr, result);
 	if (ret) {
 		fprintf(stderr, "Query SA failed: %s\n", strerror(ret));
 		return ret;
@@ -744,12 +743,12 @@ static int get_any_records(bind_handle_t h,
 
 static int get_and_dump_any_records(bind_handle_t h, uint16_t attr_id,
 				    uint32_t attr_mod, ib_net64_t comp_mask,
-				    void *attr, uint64_t sm_key,
+				    void *attr,
 				    void (*dump_func) (void *))
 {
 	struct sa_query_result result;
 	int ret = get_any_records(h, attr_id, attr_mod, comp_mask, attr,
-				  sm_key, &result);
+				  &result);
 	if (ret)
 		return ret;
 
@@ -761,18 +760,17 @@ static int get_and_dump_any_records(bind_handle_t h, uint16_t attr_id,
 /**
  * Get all the records available for requested query type.
  */
-static int get_all_records(bind_handle_t h, uint16_t attr_id, int trusted,
+static int get_all_records(bind_handle_t h, uint16_t attr_id,
 			   struct sa_query_result *result)
 {
-	return get_any_records(h, attr_id, 0, 0, NULL, trusted ? smkey : 0,
-			       result);
+	return get_any_records(h, attr_id, 0, 0, NULL, result);
 }
 
 static int get_and_dump_all_records(bind_handle_t h, uint16_t attr_id,
-				    int trusted, void (*dump_func) (void *))
+				    void (*dump_func) (void *))
 {
 	struct sa_query_result result;
-	int ret = get_all_records(h, attr_id, 0, &result);
+	int ret = get_all_records(h, attr_id, &result);
 	if (ret)
 		return ret;
 
@@ -792,7 +790,7 @@ static int get_lid_from_name(bind_handle_t h, const char *name, uint16_t * lid)
 	int ret;
 	struct sa_query_result result;
 
-	ret = get_all_records(h, IB_SA_ATTR_NODERECORD, 0, &result);
+	ret = get_all_records(h, IB_SA_ATTR_NODERECORD, &result);
 	if (ret)
 		return ret;
 
@@ -892,7 +890,7 @@ static int get_issm_records(bind_handle_t h, ib_net32_t capability_mask,
 	attr.port_info.capability_mask = capability_mask;
 
 	return get_any_records(h, IB_SA_ATTR_PORTINFORECORD, 1 << 31,
-			       IB_PIR_COMPMASK_CAPMASK, &attr, 0, result);
+			       IB_PIR_COMPMASK_CAPMASK, &attr, result);
 }
 
 static int print_node_records(bind_handle_t h)
@@ -901,7 +899,7 @@ static int print_node_records(bind_handle_t h)
 	int ret;
 	struct sa_query_result result;
 
-	ret = get_all_records(h, IB_SA_ATTR_NODERECORD, 0, &result);
+	ret = get_all_records(h, IB_SA_ATTR_NODERECORD, &result);
 	if (ret)
 		return ret;
 
@@ -944,7 +942,7 @@ static int get_print_class_port_info(bind_handle_t h)
 {
 	struct sa_query_result result;
 	int ret = sa_query(h, IB_MAD_METHOD_GET, CLASS_PORT_INFO, 0, 0,
-			   0, NULL, &result);
+			   ibd_sakey, NULL, &result);
 	if (ret) {
 		fprintf(stderr, "ERROR: Query SA failed: %s\n", strerror(ret));
 		return ret;
@@ -991,7 +989,7 @@ static int query_path_records(const struct query_cmd *q, bind_handle_t h,
 				  SELEC);
 
 	return get_and_dump_any_records(h, IB_SA_ATTR_PATHRECORD, 0, comp_mask,
-					&pr, 0, dump_path_record);
+					&pr, dump_path_record);
 }
 
 static int print_issm_records(bind_handle_t h)
@@ -1027,11 +1025,11 @@ static int print_multicast_member_records(bind_handle_t h)
 	int ret;
 	unsigned i;
 
-	ret = get_all_records(h, IB_SA_ATTR_MCRECORD, 1, &mc_group_result);
+	ret = get_all_records(h, IB_SA_ATTR_MCRECORD, &mc_group_result);
 	if (ret)
 		return ret;
 
-	ret = get_all_records(h, IB_SA_ATTR_NODERECORD, 0, &nr_result);
+	ret = get_all_records(h, IB_SA_ATTR_NODERECORD, &nr_result);
 	if (ret)
 		goto return_mc;
 
@@ -1052,7 +1050,7 @@ return_mc:
 
 static int print_multicast_group_records(bind_handle_t h)
 {
-	return get_and_dump_all_records(h, IB_SA_ATTR_MCRECORD, 0,
+	return get_and_dump_all_records(h, IB_SA_ATTR_MCRECORD,
 					dump_multicast_group_record);
 }
 
@@ -1076,7 +1074,7 @@ static int query_node_records(const struct query_cmd *q, bind_handle_t h,
 	CHECK_AND_SET_VAL(lid, 16, 0, nr.lid, NR, LID);
 
 	return get_and_dump_any_records(h, IB_SA_ATTR_NODERECORD, 0, comp_mask,
-					&nr, 0, dump_node_record);
+					&nr, dump_node_record);
 }
 
 static int query_portinfo_records(const struct query_cmd *q,
@@ -1096,7 +1094,7 @@ static int query_portinfo_records(const struct query_cmd *q,
 	CHECK_AND_SET_VAL(options, 8, -1, pir.options, PIR, OPTIONS);
 
 	return get_and_dump_any_records(h, IB_SA_ATTR_PORTINFORECORD, 0,
-					comp_mask, &pir, 0,
+					comp_mask, &pir,
 					dump_one_portinfo_record);
 }
 
@@ -1129,13 +1127,13 @@ static int query_mcmember_records(const struct query_cmd *q,
 	CHECK_AND_SET_VAL(p->proxy_join, 8, -1, mr.proxy_join, MCR, PROXY);
 
 	return get_and_dump_any_records(h, IB_SA_ATTR_MCRECORD, 0, comp_mask,
-					&mr, smkey, dump_one_mcmember_record);
+					&mr, dump_one_mcmember_record);
 }
 
 static int query_service_records(const struct query_cmd *q, bind_handle_t h,
 				 struct query_params *p, int argc, char *argv[])
 {
-	return get_and_dump_all_records(h, IB_SA_ATTR_SERVICERECORD, 0,
+	return get_and_dump_all_records(h, IB_SA_ATTR_SERVICERECORD,
 					dump_service_record);
 }
 
@@ -1143,7 +1141,7 @@ static int query_informinfo_records(const struct query_cmd *q,
 				    bind_handle_t h, struct query_params *p,
 				    int argc, char *argv[])
 {
-	return get_and_dump_all_records(h, IB_SA_ATTR_INFORMINFORECORD, 0,
+	return get_and_dump_all_records(h, IB_SA_ATTR_INFORMINFORECORD,
 					dump_inform_info_record);
 }
 
@@ -1167,7 +1165,7 @@ static int query_link_records(const struct query_cmd *q, bind_handle_t h,
 	CHECK_AND_SET_VAL(to_port, 8, -1, lr.to_port_num, LR, TO_PORT);
 
 	return get_and_dump_any_records(h, IB_SA_ATTR_LINKRECORD, 0, comp_mask,
-					&lr, 0, dump_one_link_record);
+					&lr, dump_one_link_record);
 }
 
 static int query_sl2vl_records(const struct query_cmd *q, bind_handle_t h,
@@ -1186,7 +1184,7 @@ static int query_sl2vl_records(const struct query_cmd *q, bind_handle_t h,
 	CHECK_AND_SET_VAL(out_port, 8, -1, slvl.out_port_num, SLVL, OUT_PORT);
 
 	return get_and_dump_any_records(h, IB_SA_ATTR_SL2VLTABLERECORD, 0,
-					comp_mask, &slvl, 0,
+					comp_mask, &slvl,
 					dump_one_slvl_record);
 }
 
@@ -1206,7 +1204,7 @@ static int query_vlarb_records(const struct query_cmd *q, bind_handle_t h,
 	CHECK_AND_SET_VAL(block, 8, -1, vlarb.block_num, VLA, BLOCK);
 
 	return get_and_dump_any_records(h, IB_SA_ATTR_VLARBTABLERECORD, 0,
-					comp_mask, &vlarb, 0,
+					comp_mask, &vlarb,
 					dump_one_vlarb_record);
 }
 
@@ -1227,7 +1225,7 @@ static int query_pkey_tbl_records(const struct query_cmd *q,
 	CHECK_AND_SET_VAL(block, 16, -1, pktr.block_num, PKEY, BLOCK);
 
 	return get_and_dump_any_records(h, IB_SA_ATTR_PKEYTABLERECORD, 0,
-					comp_mask, &pktr, smkey,
+					comp_mask, &pktr,
 					dump_one_pkey_tbl_record);
 }
 
@@ -1246,7 +1244,7 @@ static int query_lft_records(const struct query_cmd *q, bind_handle_t h,
 	CHECK_AND_SET_VAL(block, 16, -1, lftr.block_num, LFTR, BLOCK);
 
 	return get_and_dump_any_records(h, IB_SA_ATTR_LFTRECORD, 0, comp_mask,
-					&lftr, 0, dump_one_lft_record);
+					&lftr, dump_one_lft_record);
 }
 
 static int query_guidinfo_records(const struct query_cmd *q, bind_handle_t h,
@@ -1264,7 +1262,7 @@ static int query_guidinfo_records(const struct query_cmd *q, bind_handle_t h,
 	CHECK_AND_SET_VAL(block, 8, -1, gir.block_num, GIR, BLOCKNUM);
 
 	return get_and_dump_any_records(h, IB_SA_ATTR_GUIDINFORECORD, 0,
-					comp_mask, &gir, 0,
+					comp_mask, &gir,
 					dump_one_guidinfo_record);
 }
 
@@ -1287,7 +1285,7 @@ static int query_mft_records(const struct query_cmd *q, bind_handle_t h,
 	mftr.position_block_num |= cl_hton16(pos << 12);
 
 	return get_and_dump_any_records(h, IB_SA_ATTR_MFTRECORD, 0, comp_mask,
-					&mftr, 0, dump_one_mft_record);
+					&mftr, dump_one_mft_record);
 }
 
 static const struct query_cmd query_cmds[] = {
@@ -1399,7 +1397,7 @@ static int process_opt(void *context, int ch, char *optarg)
 			fprintf(stderr, "cannot get SM_Key\n");
 			ibdiag_show_usage();
 		}
-		smkey = strtoull(optarg, NULL, 0);
+		ibd_sakey = strtoull(optarg, NULL, 0);
 		break;
 	case 'p':
 		query_type = IB_SA_ATTR_PATHRECORD;
-- 
1.7.9.2

--
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] 32+ messages in thread

* [PATCH V3.1 8/8] infiniband-diags: Add sa_smkey option to config file
       [not found]         ` <1338398497-12444-8-git-send-email-foraker1-i2BcT+NCU+M@public.gmane.org>
  2012-05-30 18:06           ` Hal Rosenstock
@ 2012-05-30 22:15           ` Jim Foraker
       [not found]             ` <1338416114-14068-1-git-send-email-foraker1-i2BcT+NCU+M@public.gmane.org>
  1 sibling, 1 reply; 32+ messages in thread
From: Jim Foraker @ 2012-05-30 22:15 UTC (permalink / raw)
  To: linux-rdma-u79uwXL29TY76Z2rM5mHXA; +Cc: weiny2-i2BcT+NCU+M, Jim Foraker

Defines a default for the smkey used in SA requests

Signed-off-by: Jim Foraker <foraker1-i2BcT+NCU+M@public.gmane.org>
---
 etc/ibdiag.conf     |    3 +++
 src/ibdiag_common.c |    3 +++
 2 files changed, 6 insertions(+)

diff --git a/etc/ibdiag.conf b/etc/ibdiag.conf
index 2a2334f..9686d14 100644
--- a/etc/ibdiag.conf
+++ b/etc/ibdiag.conf
@@ -17,3 +17,6 @@
 
 # define a default m_key
 #m_key=0x00
+
+# default smkey to be used for SA requests
+#sa_key=0x00
diff --git a/src/ibdiag_common.c b/src/ibdiag_common.c
index eaf504f..ba0ce0b 100644
--- a/src/ibdiag_common.c
+++ b/src/ibdiag_common.c
@@ -160,6 +160,9 @@ void read_ibdiag_config(const char *file)
 			}
 		} else if (strncmp(name, "m_key", strlen("m_key")) == 0) {
 			ibd_mkey = strtoull(val_str, 0, 0);
+		} else if (strncmp(name, "sa_key",
+				   strlen("sa_key")) == 0) {
+			ibd_sakey = strtoull(val_str, 0, 0);
 		}
 	}
 
-- 
1.7.9.2

--
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] 32+ messages in thread

* Re: [PATCH V3 8/8] infiniband-diags: Add sa_smkey option to config file
       [not found]                 ` <1338403407.17237.860.camel-mxTxeWJot8FliZ7u+bvwcg@public.gmane.org>
@ 2012-05-30 22:17                   ` Jim Foraker
  0 siblings, 0 replies; 32+ messages in thread
From: Jim Foraker @ 2012-05-30 22:17 UTC (permalink / raw)
  To: Hal Rosenstock
  Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Weiny, Ira K.

     I just posted a "V3.1" for patches 7 and 8, which converts variable
ibd_sa_smkey to ibd_sakey and config parameter sa_smkey to sa_key.

     Jim

On Wed, 2012-05-30 at 11:43 -0700, Jim Foraker wrote:
> On Wed, 2012-05-30 at 11:06 -0700, Hal Rosenstock wrote:
> > On 5/30/2012 1:21 PM, Jim Foraker wrote:
> > > Defines a default for the smkey used in SA requests
> > > 
> > > Signed-off-by: Jim Foraker <foraker1-i2BcT+NCU+M@public.gmane.org>
> > > ---
> > >  etc/ibdiag.conf     |    3 +++
> > >  src/ibdiag_common.c |    3 +++
> > >  2 files changed, 6 insertions(+)
> > > 
> > > diff --git a/etc/ibdiag.conf b/etc/ibdiag.conf
> > > index 2a2334f..1e6149d 100644
> > > --- a/etc/ibdiag.conf
> > > +++ b/etc/ibdiag.conf
> > > @@ -17,3 +17,6 @@
> > >  
> > >  # define a default m_key
> > >  #m_key=0x00
> > > +
> > > +# default smkey to be used for SA requests
> > > +#sa_smkey=0x00
> > > diff --git a/src/ibdiag_common.c b/src/ibdiag_common.c
> > > index c40490a..1301810 100644
> > > --- a/src/ibdiag_common.c
> > > +++ b/src/ibdiag_common.c
> > > @@ -160,6 +160,9 @@ void read_ibdiag_config(const char *file)
> > >  			}
> > >  		} else if (strncmp(name, "m_key", strlen("m_key")) == 0) {
> > >  			ibd_mkey = strtoull(val_str, 0, 0);
> > > +		} else if (strncmp(name, "sa_smkey",
> > > +				   strlen("sa_smkey")) == 0) {
> > 
> > For consistency with OpenSM naming, how about sa_key for this ?
>      That's fine by me.  IIRC, that was actually my first choice, but I
> thought there might be some objections, since it's called smkey in the
> spec.
> 
>      Jim
> 
> > 
> > -- Hal
> > 
> > > +			ibd_sa_smkey = strtoull(val_str, 0, 0);
> > >  		}
> > >  	}
> > >  
> > 
> > --
> > 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

--
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] 32+ messages in thread

* Re: [PATCH V3 1/8] infiniband-diags: Obfuscate sensitive output by default
       [not found]     ` <1338398497-12444-1-git-send-email-foraker1-i2BcT+NCU+M@public.gmane.org>
                         ` (6 preceding siblings ...)
  2012-05-30 17:21       ` [PATCH V3 8/8] infiniband-diags: Add sa_smkey option to config file Jim Foraker
@ 2012-05-31 11:48       ` Hal Rosenstock
       [not found]         ` <4FC75A8D.4080305-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
  2012-05-31 22:15       ` Ira Weiny
  8 siblings, 1 reply; 32+ messages in thread
From: Hal Rosenstock @ 2012-05-31 11:48 UTC (permalink / raw)
  To: Jim Foraker; +Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA, weiny2-i2BcT+NCU+M

On 5/30/2012 1:21 PM, Jim Foraker wrote:
> Cause security credentials to not be displayed by default. Instead,
> the "-K" flag is supported, which must be passed to the command
> to display valid results.
> 
> Signed-off-by: Jim Foraker <foraker1-i2BcT+NCU+M@public.gmane.org>
> ---
>  doc/rst/common/opt_K.rst  |    4 +++
>  doc/rst/saquery.8.in.rst  |    2 ++
>  doc/rst/smpquery.8.in.rst |    2 ++
>  include/ibdiag_common.h   |    9 ++++++
>  src/ibaddr.c              |    2 +-
>  src/ibcacheedit.c         |    2 +-
>  src/ibccconfig.c          |    2 +-
>  src/ibccquery.c           |    2 +-
>  src/ibdiag_common.c       |   71 +++++++++++++++++++++++++++++++++++++++++++++
>  src/iblinkinfo.c          |    2 +-
>  src/ibnetdiscover.c       |    2 +-
>  src/ibping.c              |    2 +-
>  src/ibqueryerrors.c       |    2 +-
>  src/ibroute.c             |    2 +-
>  src/ibsendtrap.c          |    2 +-
>  src/ibstat.c              |    2 +-
>  src/ibsysstat.c           |    2 +-
>  src/ibtracert.c           |    2 +-
>  src/perfquery.c           |    2 +-
>  src/saquery.c             |   66 ++++++++++++++++++++---------------------
>  src/sminfo.c              |    2 +-
>  src/smpdump.c             |    2 +-
>  src/smpquery.c            |    6 ++--
>  src/vendstat.c            |    2 +-
>  24 files changed, 139 insertions(+), 55 deletions(-)
>  create mode 100644 doc/rst/common/opt_K.rst

Do all these tools display keys ? AFAIK ibping, ibstat, ibsysstat,
perfquery, and vendstat don't.

-- Hal

--
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] 32+ messages in thread

* Re: [PATCH V3 4/8] infiniband-diags: Allow specification of an mkey to use on the command line
       [not found]         ` <1338398497-12444-4-git-send-email-foraker1-i2BcT+NCU+M@public.gmane.org>
@ 2012-05-31 11:48           ` Hal Rosenstock
       [not found]             ` <4FC75A97.7080106-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
  0 siblings, 1 reply; 32+ messages in thread
From: Hal Rosenstock @ 2012-05-31 11:48 UTC (permalink / raw)
  To: Jim Foraker; +Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA, weiny2-i2BcT+NCU+M

On 5/30/2012 1:21 PM, Jim Foraker wrote:
> Signed-off-by: Jim Foraker <foraker1-i2BcT+NCU+M@public.gmane.org>
> ---
>  doc/rst/common/opt_m.rst                    |    6 ++++++
>  doc/rst/ibaddr.8.in.rst                     |    1 +
>  doc/rst/ibccconfig.8.in.rst                 |    1 +
>  doc/rst/ibccquery.8.in.rst                  |    1 +
>  doc/rst/iblinkinfo.8.in.rst                 |    1 +
>  doc/rst/ibnetdiscover.8.in.rst              |    1 +
>  doc/rst/ibportstate.8.in.rst                |    1 +
>  doc/rst/ibqueryerrors.8.in.rst              |    1 +
>  doc/rst/ibroute.8.in.rst                    |    1 +
>  doc/rst/ibtracert.8.in.rst                  |    6 ++++++
>  doc/rst/perfquery.8.in.rst                  |    1 +
>  doc/rst/sminfo.8.in.rst                     |    1 +
>  doc/rst/smpquery.8.in.rst                   |    1 +
>  include/ibdiag_common.h                     |    1 +
>  libibnetdisc/include/infiniband/ibnetdisc.h |    3 ++-
>  libibnetdisc/src/ibnetdisc.c                |    1 +
>  src/ibaddr.c                                |    2 ++
>  src/ibcacheedit.c                           |    2 +-
>  src/ibccconfig.c                            |    2 ++
>  src/ibccquery.c                             |    2 ++
>  src/ibdiag_common.c                         |   13 +++++++++++++
>  src/iblinkinfo.c                            |    3 +++
>  src/ibnetdiscover.c                         |    2 +-
>  src/ibping.c                                |    2 +-
>  src/ibportstate.c                           |    2 ++
>  src/ibqueryerrors.c                         |    3 +++
>  src/ibroute.c                               |    2 ++
>  src/ibsendtrap.c                            |    2 ++
>  src/ibstat.c                                |    2 +-
>  src/ibsysstat.c                             |    2 +-
>  src/ibtracert.c                             |    4 +++-
>  src/perfquery.c                             |    2 ++
>  src/saquery.c                               |    2 +-
>  src/sminfo.c                                |    2 ++
>  src/smpquery.c                              |    2 ++
>  src/vendstat.c                              |    2 +-
>  36 files changed, 74 insertions(+), 9 deletions(-)
>  create mode 100644 doc/rst/common/opt_m.rst

Do all these tools require mkeys ? AFAIK ibping, ibstat, ibsysstat,
perfquery, and vendstat don't.

Also, for ibccquery/config why is mkey needed ? What about cckey ?

-- Hal
--
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] 32+ messages in thread

* Re: [PATCH V3.1 8/8] infiniband-diags: Add sa_smkey option to config file
       [not found]             ` <1338416114-14068-1-git-send-email-foraker1-i2BcT+NCU+M@public.gmane.org>
@ 2012-05-31 11:56               ` Hal Rosenstock
       [not found]                 ` <4FC75C61.7060408-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
  2012-05-31 22:23               ` Ira Weiny
  1 sibling, 1 reply; 32+ messages in thread
From: Hal Rosenstock @ 2012-05-31 11:56 UTC (permalink / raw)
  To: Jim Foraker; +Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA, weiny2-i2BcT+NCU+M

On 5/30/2012 6:15 PM, Jim Foraker wrote:
> Defines a default for the smkey used in SA requests
> 
> Signed-off-by: Jim Foraker <foraker1-i2BcT+NCU+M@public.gmane.org>
> ---
>  etc/ibdiag.conf     |    3 +++
>  src/ibdiag_common.c |    3 +++
>  2 files changed, 6 insertions(+)
> 
> diff --git a/etc/ibdiag.conf b/etc/ibdiag.conf
> index 2a2334f..9686d14 100644
> --- a/etc/ibdiag.conf
> +++ b/etc/ibdiag.conf
> @@ -17,3 +17,6 @@
>  
>  # define a default m_key
>  #m_key=0x00
> +
> +# default smkey to be used for SA requests
> +#sa_key=0x00

I think we're in for support questions here mostly around MCMemberRecord :-(

If this is to be done, at a minimum, the change in admin expectation
needs to be clearly documented in the infiniband-diags release notes.
I'm not sure that's sufficient to have it noticed.

-- Hal

> diff --git a/src/ibdiag_common.c b/src/ibdiag_common.c
> index eaf504f..ba0ce0b 100644
> --- a/src/ibdiag_common.c
> +++ b/src/ibdiag_common.c
> @@ -160,6 +160,9 @@ void read_ibdiag_config(const char *file)
>  			}
>  		} else if (strncmp(name, "m_key", strlen("m_key")) == 0) {
>  			ibd_mkey = strtoull(val_str, 0, 0);
> +		} else if (strncmp(name, "sa_key",
> +				   strlen("sa_key")) == 0) {
> +			ibd_sakey = strtoull(val_str, 0, 0);
>  		}
>  	}
>  

--
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] 32+ messages in thread

* Re: [PATCH V3 1/8] infiniband-diags: Obfuscate sensitive output by default
       [not found]         ` <4FC75A8D.4080305-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
@ 2012-05-31 15:10           ` Ira Weiny
  0 siblings, 0 replies; 32+ messages in thread
From: Ira Weiny @ 2012-05-31 15:10 UTC (permalink / raw)
  To: Hal Rosenstock; +Cc: Jim Foraker, linux-rdma-u79uwXL29TY76Z2rM5mHXA

On Thu, 31 May 2012 07:48:29 -0400
Hal Rosenstock <hal-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org> wrote:

> On 5/30/2012 1:21 PM, Jim Foraker wrote:
> > Cause security credentials to not be displayed by default. Instead,
> > the "-K" flag is supported, which must be passed to the command
> > to display valid results.
> > 
> > Signed-off-by: Jim Foraker <foraker1-i2BcT+NCU+M@public.gmane.org>
> > ---
> >  doc/rst/common/opt_K.rst  |    4 +++
> >  doc/rst/saquery.8.in.rst  |    2 ++
> >  doc/rst/smpquery.8.in.rst |    2 ++
> >  include/ibdiag_common.h   |    9 ++++++
> >  src/ibaddr.c              |    2 +-
> >  src/ibcacheedit.c         |    2 +-
> >  src/ibccconfig.c          |    2 +-
> >  src/ibccquery.c           |    2 +-
> >  src/ibdiag_common.c       |   71 +++++++++++++++++++++++++++++++++++++++++++++
> >  src/iblinkinfo.c          |    2 +-
> >  src/ibnetdiscover.c       |    2 +-
> >  src/ibping.c              |    2 +-
> >  src/ibqueryerrors.c       |    2 +-
> >  src/ibroute.c             |    2 +-
> >  src/ibsendtrap.c          |    2 +-
> >  src/ibstat.c              |    2 +-
> >  src/ibsysstat.c           |    2 +-
> >  src/ibtracert.c           |    2 +-
> >  src/perfquery.c           |    2 +-
> >  src/saquery.c             |   66 ++++++++++++++++++++---------------------
> >  src/sminfo.c              |    2 +-
> >  src/smpdump.c             |    2 +-
> >  src/smpquery.c            |    6 ++--
> >  src/vendstat.c            |    2 +-
> >  24 files changed, 139 insertions(+), 55 deletions(-)
> >  create mode 100644 doc/rst/common/opt_K.rst
> 
> Do all these tools display keys ? AFAIK ibping, ibstat, ibsysstat,
> perfquery, and vendstat don't.

No they don't which is why the patch excludes the common option "-K" in ibdiag_process_opts.

Ira

> 
> -- Hal
> 


-- 
Ira Weiny
Member of Technical Staff
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] 32+ messages in thread

* Re: [PATCH V3 4/8] infiniband-diags: Allow specification of an mkey to use on the command line
       [not found]             ` <4FC75A97.7080106-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
@ 2012-05-31 15:18               ` Ira Weiny
  2012-05-31 19:08               ` Jim Foraker
  1 sibling, 0 replies; 32+ messages in thread
From: Ira Weiny @ 2012-05-31 15:18 UTC (permalink / raw)
  To: Hal Rosenstock; +Cc: Jim Foraker, linux-rdma-u79uwXL29TY76Z2rM5mHXA

On Thu, 31 May 2012 07:48:39 -0400
Hal Rosenstock <hal-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org> wrote:

> On 5/30/2012 1:21 PM, Jim Foraker wrote:
> > Signed-off-by: Jim Foraker <foraker1-i2BcT+NCU+M@public.gmane.org>
> > ---
> >  doc/rst/common/opt_m.rst                    |    6 ++++++
> >  doc/rst/ibaddr.8.in.rst                     |    1 +
> >  doc/rst/ibccconfig.8.in.rst                 |    1 +
> >  doc/rst/ibccquery.8.in.rst                  |    1 +
> >  doc/rst/iblinkinfo.8.in.rst                 |    1 +
> >  doc/rst/ibnetdiscover.8.in.rst              |    1 +
> >  doc/rst/ibportstate.8.in.rst                |    1 +
> >  doc/rst/ibqueryerrors.8.in.rst              |    1 +
> >  doc/rst/ibroute.8.in.rst                    |    1 +
> >  doc/rst/ibtracert.8.in.rst                  |    6 ++++++
> >  doc/rst/perfquery.8.in.rst                  |    1 +
> >  doc/rst/sminfo.8.in.rst                     |    1 +
> >  doc/rst/smpquery.8.in.rst                   |    1 +
> >  include/ibdiag_common.h                     |    1 +
> >  libibnetdisc/include/infiniband/ibnetdisc.h |    3 ++-
> >  libibnetdisc/src/ibnetdisc.c                |    1 +
> >  src/ibaddr.c                                |    2 ++
> >  src/ibcacheedit.c                           |    2 +-
> >  src/ibccconfig.c                            |    2 ++
> >  src/ibccquery.c                             |    2 ++
> >  src/ibdiag_common.c                         |   13 +++++++++++++
> >  src/iblinkinfo.c                            |    3 +++
> >  src/ibnetdiscover.c                         |    2 +-
> >  src/ibping.c                                |    2 +-
> >  src/ibportstate.c                           |    2 ++
> >  src/ibqueryerrors.c                         |    3 +++
> >  src/ibroute.c                               |    2 ++
> >  src/ibsendtrap.c                            |    2 ++
> >  src/ibstat.c                                |    2 +-
> >  src/ibsysstat.c                             |    2 +-
> >  src/ibtracert.c                             |    4 +++-
> >  src/perfquery.c                             |    2 ++
> >  src/saquery.c                               |    2 +-
> >  src/sminfo.c                                |    2 ++
> >  src/smpquery.c                              |    2 ++
> >  src/vendstat.c                              |    2 +-
> >  36 files changed, 74 insertions(+), 9 deletions(-)
> >  create mode 100644 doc/rst/common/opt_m.rst
> 
> Do all these tools require mkeys ? AFAIK ibping, ibstat, ibsysstat,
> perfquery, and vendstat don't.

Same issue here as with the "-K" common option.

> 
> Also, for ibccquery/config why is mkey needed ? What about cckey ?

Because ibccquery still does SMP NodeInfo queries for some information about nodes.

I think cckey will be a separate patch.  Indeed it will probably use "-K" for obfuscation.

One thing at a time...  ;-)
Ira

> 
> -- Hal


-- 
Ira Weiny
Member of Technical Staff
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] 32+ messages in thread

* Re: [PATCH V3 4/8] infiniband-diags: Allow specification of an mkey to use on the command line
       [not found]             ` <4FC75A97.7080106-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
  2012-05-31 15:18               ` Ira Weiny
@ 2012-05-31 19:08               ` Jim Foraker
       [not found]                 ` <1338491297.19133.30.camel-mxTxeWJot8FliZ7u+bvwcg@public.gmane.org>
  1 sibling, 1 reply; 32+ messages in thread
From: Jim Foraker @ 2012-05-31 19:08 UTC (permalink / raw)
  To: Hal Rosenstock
  Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Weiny, Ira K.


On Thu, 2012-05-31 at 04:48 -0700, Hal Rosenstock wrote:
> On 5/30/2012 1:21 PM, Jim Foraker wrote:
> > Signed-off-by: Jim Foraker <foraker1-i2BcT+NCU+M@public.gmane.org>
> > ---
> >  doc/rst/common/opt_m.rst                    |    6 ++++++
> >  doc/rst/ibaddr.8.in.rst                     |    1 +
> >  doc/rst/ibccconfig.8.in.rst                 |    1 +
> >  doc/rst/ibccquery.8.in.rst                  |    1 +
> >  doc/rst/iblinkinfo.8.in.rst                 |    1 +
> >  doc/rst/ibnetdiscover.8.in.rst              |    1 +
> >  doc/rst/ibportstate.8.in.rst                |    1 +
> >  doc/rst/ibqueryerrors.8.in.rst              |    1 +
> >  doc/rst/ibroute.8.in.rst                    |    1 +
> >  doc/rst/ibtracert.8.in.rst                  |    6 ++++++
> >  doc/rst/perfquery.8.in.rst                  |    1 +
> >  doc/rst/sminfo.8.in.rst                     |    1 +
> >  doc/rst/smpquery.8.in.rst                   |    1 +
> >  include/ibdiag_common.h                     |    1 +
> >  libibnetdisc/include/infiniband/ibnetdisc.h |    3 ++-
> >  libibnetdisc/src/ibnetdisc.c                |    1 +
> >  src/ibaddr.c                                |    2 ++
> >  src/ibcacheedit.c                           |    2 +-
> >  src/ibccconfig.c                            |    2 ++
> >  src/ibccquery.c                             |    2 ++
> >  src/ibdiag_common.c                         |   13 +++++++++++++
> >  src/iblinkinfo.c                            |    3 +++
> >  src/ibnetdiscover.c                         |    2 +-
> >  src/ibping.c                                |    2 +-
> >  src/ibportstate.c                           |    2 ++
> >  src/ibqueryerrors.c                         |    3 +++
> >  src/ibroute.c                               |    2 ++
> >  src/ibsendtrap.c                            |    2 ++
> >  src/ibstat.c                                |    2 +-
> >  src/ibsysstat.c                             |    2 +-
> >  src/ibtracert.c                             |    4 +++-
> >  src/perfquery.c                             |    2 ++
> >  src/saquery.c                               |    2 +-
> >  src/sminfo.c                                |    2 ++
> >  src/smpquery.c                              |    2 ++
> >  src/vendstat.c                              |    2 +-
> >  36 files changed, 74 insertions(+), 9 deletions(-)
> >  create mode 100644 doc/rst/common/opt_m.rst
> 
> Do all these tools require mkeys ? AFAIK ibping, ibstat, ibsysstat,
> perfquery, and vendstat don't.
     As Ira alluded to, for many of the tools, the only change in this
patch is to exclude the mkey flag from their options processing.
     That said, I'm about to post a new version of this patch with two
changes.  The small one is a fix to mkey handling in libibnetdiscover.
The big one is a change from using '-m' for the mkey short flag to '-y'.
It was pointed out that ibnetdiscover has a conflict with -m (display
max hops).  ibnetdiscover being a popular tool, we didn't want to
require users to use the long form '--m_key', so we decided to change
the short flag to one that had no conflicts -- unfortunately, no more
obvious letters were available, so '-y' it is.

     Jim
> 
> Also, for ibccquery/config why is mkey needed ? What about cckey ?
> 
> -- Hal

--
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] 32+ messages in thread

* [PATCH V3.1 4/8] infiniband-diags: Allow specification of an mkey to use on the command line
       [not found]                 ` <1338491297.19133.30.camel-mxTxeWJot8FliZ7u+bvwcg@public.gmane.org>
@ 2012-05-31 19:11                   ` Jim Foraker
       [not found]                     ` <1338491493-19714-1-git-send-email-foraker1-i2BcT+NCU+M@public.gmane.org>
  0 siblings, 1 reply; 32+ messages in thread
From: Jim Foraker @ 2012-05-31 19:11 UTC (permalink / raw)
  To: linux-rdma-u79uwXL29TY76Z2rM5mHXA; +Cc: weiny2-i2BcT+NCU+M, Jim Foraker


Signed-off-by: Jim Foraker <foraker1-i2BcT+NCU+M@public.gmane.org>
---
 doc/rst/common/opt_y.rst                    |    6 ++++++
 doc/rst/ibaddr.8.in.rst                     |    1 +
 doc/rst/ibccconfig.8.in.rst                 |    1 +
 doc/rst/ibccquery.8.in.rst                  |    1 +
 doc/rst/iblinkinfo.8.in.rst                 |    1 +
 doc/rst/ibnetdiscover.8.in.rst              |    1 +
 doc/rst/ibportstate.8.in.rst                |    1 +
 doc/rst/ibqueryerrors.8.in.rst              |    1 +
 doc/rst/ibroute.8.in.rst                    |    1 +
 doc/rst/ibtracert.8.in.rst                  |    2 ++
 doc/rst/perfquery.8.in.rst                  |    1 +
 doc/rst/sminfo.8.in.rst                     |    1 +
 doc/rst/smpquery.8.in.rst                   |    1 +
 include/ibdiag_common.h                     |    1 +
 libibnetdisc/include/infiniband/ibnetdisc.h |    3 ++-
 libibnetdisc/src/ibnetdisc.c                |    1 +
 libibnetdisc/src/query_smp.c                |    1 +
 src/ibaddr.c                                |    2 ++
 src/ibcacheedit.c                           |    2 +-
 src/ibccconfig.c                            |    2 ++
 src/ibccquery.c                             |    2 ++
 src/ibdiag_common.c                         |   13 +++++++++++++
 src/iblinkinfo.c                            |    3 +++
 src/ibnetdiscover.c                         |    2 ++
 src/ibping.c                                |    2 +-
 src/ibportstate.c                           |    2 ++
 src/ibqueryerrors.c                         |    3 +++
 src/ibroute.c                               |    2 ++
 src/ibsendtrap.c                            |    2 ++
 src/ibstat.c                                |    2 +-
 src/ibsysstat.c                             |    2 +-
 src/ibtracert.c                             |    4 +++-
 src/perfquery.c                             |    2 ++
 src/saquery.c                               |    2 +-
 src/sminfo.c                                |    2 ++
 src/smpquery.c                              |    2 ++
 src/vendstat.c                              |    2 +-
 37 files changed, 72 insertions(+), 8 deletions(-)
 create mode 100644 doc/rst/common/opt_y.rst

diff --git a/doc/rst/common/opt_y.rst b/doc/rst/common/opt_y.rst
new file mode 100644
index 0000000..c49bd77
--- /dev/null
+++ b/doc/rst/common/opt_y.rst
@@ -0,0 +1,6 @@
+.. Define the common option -m
+
+**-y, --m_key <key>**
+        use the specified M_key for requests. If non-numeric value (like 'x')
+        is specified then a value will be prompted for.
+
diff --git a/doc/rst/ibaddr.8.in.rst b/doc/rst/ibaddr.8.in.rst
index 93de897..6713fcf 100644
--- a/doc/rst/ibaddr.8.in.rst
+++ b/doc/rst/ibaddr.8.in.rst
@@ -68,6 +68,7 @@ Port Selection flags
 Configuration flags
 -------------------
 
+.. include:: common/opt_y.rst
 .. include:: common/opt_z-config.rst
 
 FILES
diff --git a/doc/rst/ibccconfig.8.in.rst b/doc/rst/ibccconfig.8.in.rst
index 3ab31b6..e88d8ac 100644
--- a/doc/rst/ibccconfig.8.in.rst
+++ b/doc/rst/ibccconfig.8.in.rst
@@ -67,6 +67,7 @@ Port Selection flags
 Configuration flags
 -------------------
 
+.. include:: common/opt_y.rst
 .. include:: common/opt_z-config.rst
 
 
diff --git a/doc/rst/ibccquery.8.in.rst b/doc/rst/ibccquery.8.in.rst
index 89b741c..773d2f8 100644
--- a/doc/rst/ibccquery.8.in.rst
+++ b/doc/rst/ibccquery.8.in.rst
@@ -66,6 +66,7 @@ Port Selection flags
 Configuration flags
 -------------------
 
+.. include:: common/opt_y.rst
 .. include:: common/opt_z-config.rst
 
 FILES
diff --git a/doc/rst/iblinkinfo.8.in.rst b/doc/rst/iblinkinfo.8.in.rst
index 1496bfc..9e13d57 100644
--- a/doc/rst/iblinkinfo.8.in.rst
+++ b/doc/rst/iblinkinfo.8.in.rst
@@ -99,6 +99,7 @@ Configuration flags
 .. include:: common/opt_o-outstanding_smps.rst
 .. include:: common/opt_node_name_map.rst
 .. include:: common/opt_t.rst
+.. include:: common/opt_y.rst
 
 Debugging flags
 ---------------
diff --git a/doc/rst/ibnetdiscover.8.in.rst b/doc/rst/ibnetdiscover.8.in.rst
index fb7c4c9..a5b92ca 100644
--- a/doc/rst/ibnetdiscover.8.in.rst
+++ b/doc/rst/ibnetdiscover.8.in.rst
@@ -83,6 +83,7 @@ Configuration flags
 .. include:: common/opt_o-outstanding_smps.rst
 .. include:: common/opt_node_name_map.rst
 .. include:: common/opt_t.rst
+.. include:: common/opt_y.rst
 
 Debugging flags
 ---------------
diff --git a/doc/rst/ibportstate.8.in.rst b/doc/rst/ibportstate.8.in.rst
index 1fc9bb2..d2223c8 100644
--- a/doc/rst/ibportstate.8.in.rst
+++ b/doc/rst/ibportstate.8.in.rst
@@ -82,6 +82,7 @@ Configuration flags
 
 .. include:: common/opt_z-config.rst
 .. include:: common/opt_t.rst
+.. include:: common/opt_y.rst
 
 Debugging flags
 ---------------
diff --git a/doc/rst/ibqueryerrors.8.in.rst b/doc/rst/ibqueryerrors.8.in.rst
index 15d488d..9a05e7b 100644
--- a/doc/rst/ibqueryerrors.8.in.rst
+++ b/doc/rst/ibqueryerrors.8.in.rst
@@ -102,6 +102,7 @@ Configuration flags
 .. include:: common/opt_o-outstanding_smps.rst
 .. include:: common/opt_node_name_map.rst
 .. include:: common/opt_t.rst
+.. include:: common/opt_y.rst
 
 Debugging flags
 ---------------
diff --git a/doc/rst/ibroute.8.in.rst b/doc/rst/ibroute.8.in.rst
index 0070dd6..c20136f 100644
--- a/doc/rst/ibroute.8.in.rst
+++ b/doc/rst/ibroute.8.in.rst
@@ -67,6 +67,7 @@ Configuration flags
 -------------------
 
 .. include:: common/opt_t.rst
+.. include:: common/opt_y.rst
 .. include:: common/opt_z-config.rst
 
 FILES
diff --git a/doc/rst/ibtracert.8.in.rst b/doc/rst/ibtracert.8.in.rst
index b002fa8..ab43af0 100644
--- a/doc/rst/ibtracert.8.in.rst
+++ b/doc/rst/ibtracert.8.in.rst
@@ -65,8 +65,10 @@ Debugging flags
 Configuration flags
 -------------------
 
+
 .. include:: common/opt_t.rst
 .. include:: common/opt_node_name_map.rst
+.. include:: common/opt_y.rst
 .. include:: common/opt_z-config.rst
 
 FILES
diff --git a/doc/rst/perfquery.8.in.rst b/doc/rst/perfquery.8.in.rst
index f5d0e61..359c94e 100644
--- a/doc/rst/perfquery.8.in.rst
+++ b/doc/rst/perfquery.8.in.rst
@@ -145,6 +145,7 @@ Configuration flags
 -------------------
 
 .. include:: common/opt_t.rst
+.. include:: common/opt_y.rst
 .. include:: common/opt_z-config.rst
 
 
diff --git a/doc/rst/sminfo.8.in.rst b/doc/rst/sminfo.8.in.rst
index 1d7e69f..500d1d0 100644
--- a/doc/rst/sminfo.8.in.rst
+++ b/doc/rst/sminfo.8.in.rst
@@ -71,6 +71,7 @@ Configuration flags
 -------------------
 
 .. include:: common/opt_t.rst
+.. include:: common/opt_y.rst
 .. include:: common/opt_z-config.rst
 
 
diff --git a/doc/rst/smpquery.8.in.rst b/doc/rst/smpquery.8.in.rst
index b422731..989cb08 100644
--- a/doc/rst/smpquery.8.in.rst
+++ b/doc/rst/smpquery.8.in.rst
@@ -81,6 +81,7 @@ Configuration flags
 
 .. include:: common/opt_t.rst
 .. include:: common/opt_node_name_map.rst
+.. include:: common/opt_y.rst
 .. include:: common/opt_z-config.rst
 
 
diff --git a/include/ibdiag_common.h b/include/ibdiag_common.h
index e989088..0120203 100644
--- a/include/ibdiag_common.h
+++ b/include/ibdiag_common.h
@@ -51,6 +51,7 @@ extern enum MAD_DEST ibd_dest_type;
 extern ib_portid_t *ibd_sm_id;
 extern int ibd_timeout;
 extern uint32_t ibd_ibnetdisc_flags;
+extern uint64_t ibd_mkey;
 extern int show_keys;
 
 /*========================================================*/
diff --git a/libibnetdisc/include/infiniband/ibnetdisc.h b/libibnetdisc/include/infiniband/ibnetdisc.h
index 2ae2b06..335ad83 100644
--- a/libibnetdisc/include/infiniband/ibnetdisc.h
+++ b/libibnetdisc/include/infiniband/ibnetdisc.h
@@ -151,7 +151,8 @@ typedef struct ibnd_config {
 	unsigned timeout_ms;
 	unsigned retries;
 	uint32_t flags;
-	uint8_t pad[52];
+	uint64_t mkey;
+	uint8_t pad[44];
 } ibnd_config_t;
 
 /** =========================================================================
diff --git a/libibnetdisc/src/ibnetdisc.c b/libibnetdisc/src/ibnetdisc.c
index 8d38ab7..a0cbe3e 100644
--- a/libibnetdisc/src/ibnetdisc.c
+++ b/libibnetdisc/src/ibnetdisc.c
@@ -711,6 +711,7 @@ ibnd_fabric_t *ibnd_discover_fabric(char * ca_name, int ca_port,
 	}
 	mad_rpc_set_timeout(scan.ibmad_port, cfg->timeout_ms);
 	mad_rpc_set_retries(scan.ibmad_port, cfg->retries);
+	smp_mkey_set(scan.ibmad_port, cfg->mkey);
 
 	IBND_DEBUG("from %s\n", portid2str(from));
 
diff --git a/libibnetdisc/src/query_smp.c b/libibnetdisc/src/query_smp.c
index f4beb39..28620b4 100644
--- a/libibnetdisc/src/query_smp.c
+++ b/libibnetdisc/src/query_smp.c
@@ -142,6 +142,7 @@ int issue_smp(smp_engine_t * engine, ib_portid_t * portid,
 	smp->rpc.datasz = IB_SMP_DATA_SIZE;
 	smp->rpc.dataoffs = IB_SMP_DATA_OFFS;
 	smp->rpc.trid = mad_trid();
+	smp->rpc.mkey = engine->cfg->mkey;
 
 	if (portid->lid <= 0 || portid->drpath.drslid == 0xffff ||
 	    portid->drpath.drdlid == 0xffff)
diff --git a/src/ibaddr.c b/src/ibaddr.c
index 0735837..9d208f5 100644
--- a/src/ibaddr.c
+++ b/src/ibaddr.c
@@ -149,6 +149,8 @@ int main(int argc, char **argv)
 	if (!srcport)
 		IBERROR("Failed to open '%s' port '%d'", ibd_ca, ibd_ca_port);
 
+	smp_mkey_set(srcport, ibd_mkey);
+
 	if (argc) {
 		if (resolve_portid_str(ibd_ca, ibd_ca_port, &portid, argv[0],
 				       ibd_dest_type, ibd_sm_id, srcport) < 0)
diff --git a/src/ibcacheedit.c b/src/ibcacheedit.c
index 2f9a634..f302813 100644
--- a/src/ibcacheedit.c
+++ b/src/ibcacheedit.c
@@ -269,7 +269,7 @@ int main(int argc, char **argv)
 	};
 	char *usage_args = "<orig.cache> <new.cache>";
 
-	ibdiag_process_opts(argc, argv, NULL, "CDdeGKLPstv",
+	ibdiag_process_opts(argc, argv, NULL, "CDdeGKLPstvy",
 			    opts, process_opt, usage_args,
 			    NULL);
 
diff --git a/src/ibccconfig.c b/src/ibccconfig.c
index d796ed8..207c821 100644
--- a/src/ibccconfig.c
+++ b/src/ibccconfig.c
@@ -631,6 +631,8 @@ int main(int argc, char **argv)
 	if (!srcport)
 		IBERROR("Failed to open '%s' port '%d'", ibd_ca, ibd_ca_port);
 
+	smp_mkey_set(srcport, ibd_mkey);
+
 	if (resolve_portid_str(ibd_ca, ibd_ca_port, &portid, argv[1],
 			       ibd_dest_type, ibd_sm_id, srcport) < 0)
 		IBERROR("can't resolve destination %s", argv[1]);
diff --git a/src/ibccquery.c b/src/ibccquery.c
index 34a9afd..f9d7b2f 100644
--- a/src/ibccquery.c
+++ b/src/ibccquery.c
@@ -415,6 +415,8 @@ int main(int argc, char **argv)
 	if (!srcport)
 		IBERROR("Failed to open '%s' port '%d'", ibd_ca, ibd_ca_port);
 
+	smp_mkey_set(srcport, ibd_mkey);
+
 	if (resolve_portid_str(ibd_ca, ibd_ca_port, &portid, argv[1],
 			       ibd_dest_type, ibd_sm_id, srcport) < 0)
 		IBERROR("can't resolve destination %s", argv[1]);
diff --git a/src/ibdiag_common.c b/src/ibdiag_common.c
index 2662b9b..178ffe8 100644
--- a/src/ibdiag_common.c
+++ b/src/ibdiag_common.c
@@ -71,6 +71,7 @@ char *ibd_ca = NULL;
 int ibd_ca_port = 0;
 int ibd_timeout = 0;
 uint32_t ibd_ibnetdisc_flags = IBND_CONFIG_MLX_EPI;
+uint64_t ibd_mkey;
 int show_keys = 0;
 
 static const char *prog_name;
@@ -265,6 +266,17 @@ static int process_opt(int ch, char *optarg)
 	case 'K':
 		show_keys = 1;
 		break;
+	case 'y':
+		errno = 0;
+		ibd_mkey = strtoull(optarg, &endp, 0);
+		if (errno || *endp != '\0') {
+			errno = 0;
+			ibd_mkey = strtoull(getpass("M_Key: "), &endp, 0);
+			if (errno || *endp != '\0') {
+				IBERROR("Bad M_Key");
+			}
+                }
+                break;
 	default:
 		return -1;
 	}
@@ -282,6 +294,7 @@ static const struct ibdiag_opt common_opts[] = {
 	{"timeout", 't', 1, "<ms>", "timeout in ms"},
 	{"sm_port", 's', 1, "<lid>", "SM port lid"},
 	{"show_keys", 'K', 0, NULL, "display security keys in output"},
+	{"m_key", 'y', 1, "<key>", "M_Key to use in request"},
 	{"errors", 'e', 0, NULL, "show send and receive errors"},
 	{"verbose", 'v', 0, NULL, "increase verbosity level"},
 	{"debug", 'd', 0, NULL, "raise debug level"},
diff --git a/src/iblinkinfo.c b/src/iblinkinfo.c
index e4a8d65..2a55cf5 100644
--- a/src/iblinkinfo.c
+++ b/src/iblinkinfo.c
@@ -632,12 +632,15 @@ int main(int argc, char **argv)
 		exit(1);
 	}
 
+	smp_mkey_set(ibmad_port, ibd_mkey);
+
 	if (ibd_timeout) {
 		mad_rpc_set_timeout(ibmad_port, ibd_timeout);
 		config.timeout_ms = ibd_timeout;
 	}
 
 	config.flags = ibd_ibnetdisc_flags;
+	config.mkey = ibd_mkey;
 
 	node_name_map = open_node_name_map(node_name_map_file);
 
diff --git a/src/ibnetdiscover.c b/src/ibnetdiscover.c
index 6ed0801..d27b784 100644
--- a/src/ibnetdiscover.c
+++ b/src/ibnetdiscover.c
@@ -1088,6 +1088,8 @@ int main(int argc, char **argv)
 	if (argc && !(f = fopen(argv[0], "w")))
 		IBERROR("can't open file %s for writing", argv[0]);
 
+	config.mkey = ibd_mkey;
+
 	node_name_map = open_node_name_map(node_name_map_file);
 
 	if (diff_cache_file &&
diff --git a/src/ibping.c b/src/ibping.c
index 6d3246c..beea26d 100644
--- a/src/ibping.c
+++ b/src/ibping.c
@@ -202,7 +202,7 @@ int main(int argc, char **argv)
 	};
 	char usage_args[] = "<dest lid|guid>";
 
-	ibdiag_process_opts(argc, argv, NULL, "DK", opts, process_opt,
+	ibdiag_process_opts(argc, argv, NULL, "DKy", opts, process_opt,
 			    usage_args, NULL);
 
 	argc -= optind;
diff --git a/src/ibportstate.c b/src/ibportstate.c
index a8ba8d1..c7ee817 100644
--- a/src/ibportstate.c
+++ b/src/ibportstate.c
@@ -394,6 +394,8 @@ int main(int argc, char **argv)
 	if (!srcport)
 		IBERROR("Failed to open '%s' port '%d'", ibd_ca, ibd_ca_port);
 
+	smp_mkey_set(srcport, ibd_mkey);
+
 	if (resolve_portid_str(ibd_ca, ibd_ca_port, &portid, argv[0],
 			       ibd_dest_type, ibd_sm_id, srcport) < 0)
 		IBERROR("can't resolve destination port %s", argv[0]);
diff --git a/src/ibqueryerrors.c b/src/ibqueryerrors.c
index c4ffcf1..076327c 100644
--- a/src/ibqueryerrors.c
+++ b/src/ibqueryerrors.c
@@ -914,12 +914,15 @@ int main(int argc, char **argv)
 	if (!ibmad_port)
 		IBERROR("Failed to open port; %s:%d\n", ibd_ca, ibd_ca_port);
 
+	smp_mkey_set(ibmad_port, ibd_mkey);
+
 	if (ibd_timeout) {
 		mad_rpc_set_timeout(ibmad_port, ibd_timeout);
 		config.timeout_ms = ibd_timeout;
 	}
 
 	config.flags = ibd_ibnetdisc_flags;
+	config.mkey = ibd_mkey;
 
 	node_name_map = open_node_name_map(node_name_map_file);
 
diff --git a/src/ibroute.c b/src/ibroute.c
index 63baf04..06549f5 100644
--- a/src/ibroute.c
+++ b/src/ibroute.c
@@ -432,6 +432,8 @@ int main(int argc, char **argv)
 	if (!srcport)
 		IBERROR("Failed to open '%s' port '%d'", ibd_ca, ibd_ca_port);
 
+	smp_mkey_set(srcport, ibd_mkey);
+
 	if (resolve_portid_str(ibd_ca, ibd_ca_port, &portid, argv[0],
 			       ibd_dest_type, ibd_sm_id, srcport) < 0)
 		IBERROR("can't resolve destination port %s", argv[1]);
diff --git a/src/ibsendtrap.c b/src/ibsendtrap.c
index 98bacf1..39b75c2 100644
--- a/src/ibsendtrap.c
+++ b/src/ibsendtrap.c
@@ -209,6 +209,8 @@ int main(int argc, char **argv)
 	if (!srcport)
 		IBERROR("Failed to open '%s' port '%d'", ibd_ca, ibd_ca_port);
 
+	smp_mkey_set(srcport, ibd_mkey);
+
 	rc = process_send_trap(trap_name);
 	mad_rpc_close_port(srcport);
 	return rc;
diff --git a/src/ibstat.c b/src/ibstat.c
index 12d3c20..665bb0a 100644
--- a/src/ibstat.c
+++ b/src/ibstat.c
@@ -292,7 +292,7 @@ int main(int argc, char *argv[])
 		NULL
 	};
 
-	ibdiag_process_opts(argc, argv, NULL, "CDeGKLPst", opts, process_opt,
+	ibdiag_process_opts(argc, argv, NULL, "CDeGKLPsty", opts, process_opt,
 			    usage_args, usage_examples);
 
 	argc -= optind;
diff --git a/src/ibsysstat.c b/src/ibsysstat.c
index bac4bb1..d798fe2 100644
--- a/src/ibsysstat.c
+++ b/src/ibsysstat.c
@@ -326,7 +326,7 @@ int main(int argc, char **argv)
 	};
 	char usage_args[] = "<dest lid|guid> [<op>]";
 
-	ibdiag_process_opts(argc, argv, NULL, "DK", opts, process_opt,
+	ibdiag_process_opts(argc, argv, NULL, "DKy", opts, process_opt,
 			    usage_args, NULL);
 
 	argc -= optind;
diff --git a/src/ibtracert.c b/src/ibtracert.c
index 575d9d0..5800e40 100644
--- a/src/ibtracert.c
+++ b/src/ibtracert.c
@@ -757,7 +757,7 @@ int main(int argc, char **argv)
 		NULL,
 	};
 
-	ibdiag_process_opts(argc, argv, NULL, "DK", opts, process_opt,
+	ibdiag_process_opts(argc, argv, NULL, "DKy", opts, process_opt,
 			    usage_args, usage_examples);
 
 	f = stdout;
@@ -774,6 +774,8 @@ int main(int argc, char **argv)
 	if (!srcport)
 		IBERROR("Failed to open '%s' port '%d'", ibd_ca, ibd_ca_port);
 
+	smp_mkey_set(srcport, ibd_mkey);
+
 	node_name_map = open_node_name_map(node_name_map_file);
 
 	if (resolve_portid_str(ibd_ca, ibd_ca_port, &src_portid, argv[0],
diff --git a/src/perfquery.c b/src/perfquery.c
index 9ca2e15..e85b14e 100644
--- a/src/perfquery.c
+++ b/src/perfquery.c
@@ -727,6 +727,8 @@ int main(int argc, char **argv)
 	if (!srcport)
 		IBERROR("Failed to open '%s' port '%d'", ibd_ca, ibd_ca_port);
 
+	smp_mkey_set(srcport, ibd_mkey);
+
 	if (argc) {
 		if (resolve_portid_str(ibd_ca, ibd_ca_port, &portid, argv[0],
 				       ibd_dest_type, ibd_sm_id, srcport) < 0)
diff --git a/src/saquery.c b/src/saquery.c
index 90feb2d..8dbfb82 100644
--- a/src/saquery.c
+++ b/src/saquery.c
@@ -1636,7 +1636,7 @@ int main(int argc, char **argv)
 	q = NULL;
 	ibd_timeout = DEFAULT_SA_TIMEOUT_MS;
 
-	ibdiag_process_opts(argc, argv, &params, "DGLs", opts, process_opt,
+	ibdiag_process_opts(argc, argv, &params, "DGLsy", opts, process_opt,
 			    usage_args, NULL);
 
 	argc -= optind;
diff --git a/src/sminfo.c b/src/sminfo.c
index 1c12204..2471a08 100644
--- a/src/sminfo.c
+++ b/src/sminfo.c
@@ -122,6 +122,8 @@ int main(int argc, char **argv)
 	if (!srcport)
 		IBERROR("Failed to open '%s' port '%d'", ibd_ca, ibd_ca_port);
 
+	smp_mkey_set(srcport, ibd_mkey);
+
 	if (argc) {
 		if (resolve_portid_str(ibd_ca, ibd_ca_port, &portid, argv[0],
 				       ibd_dest_type, 0, srcport) < 0)
diff --git a/src/smpquery.c b/src/smpquery.c
index 2909dc5..7b7036b 100644
--- a/src/smpquery.c
+++ b/src/smpquery.c
@@ -478,6 +478,8 @@ int main(int argc, char **argv)
 	if (!srcport)
 		IBERROR("Failed to open '%s' port '%d'", ibd_ca, ibd_ca_port);
 
+	smp_mkey_set(srcport, ibd_mkey);
+
 	node_name_map = open_node_name_map(node_name_map_file);
 
 	if (ibd_dest_type != IB_DEST_DRSLID) {
diff --git a/src/vendstat.c b/src/vendstat.c
index dd89da7..c1a34b8 100644
--- a/src/vendstat.c
+++ b/src/vendstat.c
@@ -332,7 +332,7 @@ int main(int argc, char **argv)
 		NULL
 	};
 
-	ibdiag_process_opts(argc, argv, NULL, "DK", opts, process_opt,
+	ibdiag_process_opts(argc, argv, NULL, "DKy", opts, process_opt,
 			    usage_args, usage_examples);
 
 	argc -= optind;
-- 
1.7.9.2

--
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] 32+ messages in thread

* Re: [PATCH V3 1/8] infiniband-diags: Obfuscate sensitive output by default
       [not found]     ` <1338398497-12444-1-git-send-email-foraker1-i2BcT+NCU+M@public.gmane.org>
                         ` (7 preceding siblings ...)
  2012-05-31 11:48       ` [PATCH V3 1/8] infiniband-diags: Obfuscate sensitive output by default Hal Rosenstock
@ 2012-05-31 22:15       ` Ira Weiny
  8 siblings, 0 replies; 32+ messages in thread
From: Ira Weiny @ 2012-05-31 22:15 UTC (permalink / raw)
  To: Jim Foraker; +Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA

On Wed, 30 May 2012 10:21:30 -0700
Jim Foraker <foraker1-i2BcT+NCU+M@public.gmane.org> wrote:

> Cause security credentials to not be displayed by default. Instead,
> the "-K" flag is supported, which must be passed to the command
> to display valid results.
> 
> Signed-off-by: Jim Foraker <foraker1-i2BcT+NCU+M@public.gmane.org>

Thanks, applied,
Ira

> ---
>  doc/rst/common/opt_K.rst  |    4 +++
>  doc/rst/saquery.8.in.rst  |    2 ++
>  doc/rst/smpquery.8.in.rst |    2 ++
>  include/ibdiag_common.h   |    9 ++++++
>  src/ibaddr.c              |    2 +-
>  src/ibcacheedit.c         |    2 +-
>  src/ibccconfig.c          |    2 +-
>  src/ibccquery.c           |    2 +-
>  src/ibdiag_common.c       |   71 +++++++++++++++++++++++++++++++++++++++++++++
>  src/iblinkinfo.c          |    2 +-
>  src/ibnetdiscover.c       |    2 +-
>  src/ibping.c              |    2 +-
>  src/ibqueryerrors.c       |    2 +-
>  src/ibroute.c             |    2 +-
>  src/ibsendtrap.c          |    2 +-
>  src/ibstat.c              |    2 +-
>  src/ibsysstat.c           |    2 +-
>  src/ibtracert.c           |    2 +-
>  src/perfquery.c           |    2 +-
>  src/saquery.c             |   66 ++++++++++++++++++++---------------------
>  src/sminfo.c              |    2 +-
>  src/smpdump.c             |    2 +-
>  src/smpquery.c            |    6 ++--
>  src/vendstat.c            |    2 +-
>  24 files changed, 139 insertions(+), 55 deletions(-)
>  create mode 100644 doc/rst/common/opt_K.rst
> 
> diff --git a/doc/rst/common/opt_K.rst b/doc/rst/common/opt_K.rst
> new file mode 100644
> index 0000000..2b96bf2
> --- /dev/null
> +++ b/doc/rst/common/opt_K.rst
> @@ -0,0 +1,4 @@
> +.. Define the common option -K
> +
> +**-K, --show_keys**
> +  show security keys (mkey, smkey, etc.) associated with the request.
> diff --git a/doc/rst/saquery.8.in.rst b/doc/rst/saquery.8.in.rst
> index 36696c7..79c8bd3 100644
> --- a/doc/rst/saquery.8.in.rst
> +++ b/doc/rst/saquery.8.in.rst
> @@ -84,6 +84,8 @@ OPTIONS
>          queries.  If non-numeric value (like 'x') is specified then saquery
>          will prompt for a value.
>  
> +.. include:: common/opt_K.rst
> +
>  **--slid <lid>** Source LID (PathRecord)
>  
>  **--dlid <lid>** Destination LID (PathRecord)
> diff --git a/doc/rst/smpquery.8.in.rst b/doc/rst/smpquery.8.in.rst
> index 3b249df..b422731 100644
> --- a/doc/rst/smpquery.8.in.rst
> +++ b/doc/rst/smpquery.8.in.rst
> @@ -46,6 +46,8 @@ Current supported operations and their parameters:
>          Set SMSupportsExtendedSpeeds bit 31 in AttributeModifier
>          (only impacts PortInfo queries).
>  
> +.. include:: common/opt_K.rst
> +
>  
>  Addressing Flags
>  ----------------
> diff --git a/include/ibdiag_common.h b/include/ibdiag_common.h
> index 6645322..e989088 100644
> --- a/include/ibdiag_common.h
> +++ b/include/ibdiag_common.h
> @@ -39,6 +39,7 @@
>  #ifndef _IBDIAG_COMMON_H_
>  #define _IBDIAG_COMMON_H_
>  
> +#include <stdarg.h>
>  #include <infiniband/mad.h>
>  #include <infiniband/iba/ib_types.h>
>  #include <infiniband/ibnetdisc.h>
> @@ -50,6 +51,7 @@ extern enum MAD_DEST ibd_dest_type;
>  extern ib_portid_t *ibd_sm_id;
>  extern int ibd_timeout;
>  extern uint32_t ibd_ibnetdisc_flags;
> +extern int show_keys;
>  
>  /*========================================================*/
>  /*                External interface                      */
> @@ -64,6 +66,8 @@ extern uint32_t ibd_ibnetdisc_flags;
>  } while (0)
>  #define IBERROR(fmt, ...) iberror(__FUNCTION__, fmt, ## __VA_ARGS__)
>  
> +#define NOT_DISPLAYED_STR "<not displayed>"
> +
>  /* not all versions of ib_types.h will have this define */
>  #ifndef IB_PM_PC_XMIT_WAIT_SUP
>  #define IB_PM_PC_XMIT_WAIT_SUP (CL_HTON16(((uint16_t)1)<<12))
> @@ -150,4 +154,9 @@ int resolve_self(char *ca_name, uint8_t ca_port, ib_portid_t *portid,
>  int resolve_portid_str(char *ca_name, uint8_t ca_port, ib_portid_t * portid,
>  		       char *addr_str, enum MAD_DEST dest_type,
>  		       ib_portid_t *sm_id, const struct ibmad_port *srcport);
> +int vsnprint_field(char *buf, size_t n, enum MAD_FIELDS f, int spacing,
> +		   const char *format, va_list va_args);
> +int snprint_field(char *buf, size_t n, enum MAD_FIELDS f, int spacing,
> +		  const char *format, ...);
> +void dump_portinfo(void *pi, int pisize, int tabs);
>  #endif				/* _IBDIAG_COMMON_H_ */
> diff --git a/src/ibaddr.c b/src/ibaddr.c
> index 455d941..0735837 100644
> --- a/src/ibaddr.c
> +++ b/src/ibaddr.c
> @@ -133,7 +133,7 @@ int main(int argc, char **argv)
>  		NULL
>  	};
>  
> -	ibdiag_process_opts(argc, argv, NULL, "L", opts, process_opt,
> +	ibdiag_process_opts(argc, argv, NULL, "KL", opts, process_opt,
>  			    usage_args, usage_examples);
>  
>  	argc -= optind;
> diff --git a/src/ibcacheedit.c b/src/ibcacheedit.c
> index f9e7dc9..2f9a634 100644
> --- a/src/ibcacheedit.c
> +++ b/src/ibcacheedit.c
> @@ -269,7 +269,7 @@ int main(int argc, char **argv)
>  	};
>  	char *usage_args = "<orig.cache> <new.cache>";
>  
> -	ibdiag_process_opts(argc, argv, NULL, "CDdeGLPstv",
> +	ibdiag_process_opts(argc, argv, NULL, "CDdeGKLPstv",
>  			    opts, process_opt, usage_args,
>  			    NULL);
>  
> diff --git a/src/ibccconfig.c b/src/ibccconfig.c
> index f84c63c..d796ed8 100644
> --- a/src/ibccconfig.c
> +++ b/src/ibccconfig.c
> @@ -615,7 +615,7 @@ int main(int argc, char **argv)
>  			exit(-1);
>  	}
>  
> -	ibdiag_process_opts(argc, argv, NULL, "D", opts, process_opt,
> +	ibdiag_process_opts(argc, argv, NULL, "DK", opts, process_opt,
>  			    usage_args, usage_examples);
>  
>  	argc -= optind;
> diff --git a/src/ibccquery.c b/src/ibccquery.c
> index acdfe46..34a9afd 100644
> --- a/src/ibccquery.c
> +++ b/src/ibccquery.c
> @@ -399,7 +399,7 @@ int main(int argc, char **argv)
>  			exit(-1);
>  	}
>  
> -	ibdiag_process_opts(argc, argv, NULL, "D", opts, process_opt,
> +	ibdiag_process_opts(argc, argv, NULL, "DK", opts, process_opt,
>  			    usage_args, usage_examples);
>  
>  	argc -= optind;
> diff --git a/src/ibdiag_common.c b/src/ibdiag_common.c
> index 2f12c46..2662b9b 100644
> --- a/src/ibdiag_common.c
> +++ b/src/ibdiag_common.c
> @@ -53,6 +53,7 @@
>  #include <getopt.h>
>  #include <limits.h>
>  #include <sys/stat.h>
> +#include <stdarg.h>
>  
>  #include <infiniband/umad.h>
>  #include <infiniband/mad.h>
> @@ -70,6 +71,7 @@ char *ibd_ca = NULL;
>  int ibd_ca_port = 0;
>  int ibd_timeout = 0;
>  uint32_t ibd_ibnetdisc_flags = IBND_CONFIG_MLX_EPI;
> +int show_keys = 0;
>  
>  static const char *prog_name;
>  static const char *prog_args;
> @@ -260,6 +262,9 @@ static int process_opt(int ch, char *optarg)
>  				optarg);
>  		ibd_sm_id = &sm_portid;
>  		break;
> +	case 'K':
> +		show_keys = 1;
> +		break;
>  	default:
>  		return -1;
>  	}
> @@ -276,6 +281,7 @@ static const struct ibdiag_opt common_opts[] = {
>  	{"Guid", 'G', 0, NULL, "use GUID address argument"},
>  	{"timeout", 't', 1, "<ms>", "timeout in ms"},
>  	{"sm_port", 's', 1, "<lid>", "SM port lid"},
> +	{"show_keys", 'K', 0, NULL, "display security keys in output"},
>  	{"errors", 'e', 0, NULL, "show send and receive errors"},
>  	{"verbose", 'v', 0, NULL, "increase verbosity level"},
>  	{"debug", 'd', 0, NULL, "raise debug level"},
> @@ -913,3 +919,68 @@ check_fdr10_active:
>  			   IB_MLNX_EXT_PORT_LINK_SPEED_ACTIVE_F) & FDR10) == 0)
>  		snprintf(speed_msg, msg_size, "Could be FDR10");
>  }
> +
> +int vsnprint_field(char *buf, size_t n, enum MAD_FIELDS f, int spacing,
> +		   const char *format, va_list va_args)
> +{
> +	int len, i, ret;
> +
> +	len = strlen(mad_field_name(f));
> +        if (len + 2 > n || spacing + 1 > n)
> +		return 0;
> +
> +	strncpy(buf, mad_field_name(f), n);
> +	buf[len] = ':';
> +	for (i = len+1; i < spacing+1; i++) {
> +		buf[i] = '.';
> +	}
> +
> +	ret = vsnprintf(&buf[spacing+1], n - spacing, format, va_args);
> +	if (ret >= n - spacing)
> +		buf[n] = '\0';
> +
> +	return ret + spacing;
> +}
> +
> +int snprint_field(char *buf, size_t n, enum MAD_FIELDS f, int spacing,
> +		  const char *format, ...)
> +{
> +	va_list val;
> +	int ret;
> +
> +	va_start(val, format);
> +	ret = vsnprint_field(buf, n, f, spacing, format, val);
> +	va_end(val);
> +
> +	return ret;
> +}
> +
> +void dump_portinfo(void *pi, int pisize, int tabs)
> +{
> +	int field, i;
> +	char val[64];
> +	char buf[1024];
> +
> +	for (field = IB_PORT_FIRST_F; field < IB_PORT_LAST_F; field++) {
> +		for (i=0;i<tabs;i++)
> +			printf("\t");
> +		if (field == IB_PORT_MKEY_F && show_keys == 0) {
> +			snprint_field(buf, 1024, field, 32, NOT_DISPLAYED_STR);
> +		} else {
> +			mad_decode_field(pi, field, val);
> +			if (!mad_dump_field(field, buf, 1024, val))
> +				return;
> +		}
> +		printf("%s\n", buf);
> +	}
> +
> +	for (field = IB_PORT_CAPMASK2_F;
> +	     field < IB_PORT_LINK_SPEED_EXT_LAST_F; field++) {
> +		for (i=0;i<tabs;i++)
> +			printf("\t");
> +		mad_decode_field(pi, field, val);
> +		if (!mad_dump_field(field, buf, 1024, val))
> +			return;
> +		printf("%s\n", buf);
> +	}
> +}
> diff --git a/src/iblinkinfo.c b/src/iblinkinfo.c
> index a817920..e4a8d65 100644
> --- a/src/iblinkinfo.c
> +++ b/src/iblinkinfo.c
> @@ -619,7 +619,7 @@ int main(int argc, char **argv)
>  	};
>  	char usage_args[] = "";
>  
> -	ibdiag_process_opts(argc, argv, &config, "aDdGgLlnpRS", opts,
> +	ibdiag_process_opts(argc, argv, &config, "aDdGgKLlnpRS", opts,
>  			    process_opt, usage_args, NULL);
>  
>  	argc -= optind;
> diff --git a/src/ibnetdiscover.c b/src/ibnetdiscover.c
> index 4748be9..6ed0801 100644
> --- a/src/ibnetdiscover.c
> +++ b/src/ibnetdiscover.c
> @@ -1074,7 +1074,7 @@ int main(int argc, char **argv)
>  	};
>  	char usage_args[] = "[topology-file]";
>  
> -	ibdiag_process_opts(argc, argv, &config, "DGLs", opts, process_opt,
> +	ibdiag_process_opts(argc, argv, &config, "DGKLs", opts, process_opt,
>  			    usage_args, NULL);
>  
>  	f = stdout;
> diff --git a/src/ibping.c b/src/ibping.c
> index 205aa82..6d3246c 100644
> --- a/src/ibping.c
> +++ b/src/ibping.c
> @@ -202,7 +202,7 @@ int main(int argc, char **argv)
>  	};
>  	char usage_args[] = "<dest lid|guid>";
>  
> -	ibdiag_process_opts(argc, argv, NULL, "D", opts, process_opt,
> +	ibdiag_process_opts(argc, argv, NULL, "DK", opts, process_opt,
>  			    usage_args, NULL);
>  
>  	argc -= optind;
> diff --git a/src/ibqueryerrors.c b/src/ibqueryerrors.c
> index eb57418..c4ffcf1 100644
> --- a/src/ibqueryerrors.c
> +++ b/src/ibqueryerrors.c
> @@ -901,7 +901,7 @@ int main(int argc, char **argv)
>  	char usage_args[] = "";
>  
>  	memset(suppressed_fields, 0, sizeof suppressed_fields);
> -	ibdiag_process_opts(argc, argv, &config, "cDGLnRrSs", opts, process_opt,
> +	ibdiag_process_opts(argc, argv, &config, "cDGKLnRrSs", opts, process_opt,
>  			    usage_args, NULL);
>  
>  	argc -= optind;
> diff --git a/src/ibroute.c b/src/ibroute.c
> index faff34d..63baf04 100644
> --- a/src/ibroute.c
> +++ b/src/ibroute.c
> @@ -414,7 +414,7 @@ int main(int argc, char **argv)
>  		NULL,
>  	};
>  
> -	ibdiag_process_opts(argc, argv, NULL, NULL, opts, process_opt,
> +	ibdiag_process_opts(argc, argv, NULL, "K", opts, process_opt,
>  			    usage_args, usage_examples);
>  
>  	argc -= optind;
> diff --git a/src/ibsendtrap.c b/src/ibsendtrap.c
> index f98d9cf..98bacf1 100644
> --- a/src/ibsendtrap.c
> +++ b/src/ibsendtrap.c
> @@ -192,7 +192,7 @@ int main(int argc, char **argv)
>  	snprintf(usage_args + n, sizeof(usage_args) - n,
>  		 "\n  default behavior is to send \"%s\"", traps[0].trap_name);
>  
> -	ibdiag_process_opts(argc, argv, NULL, "DGL", NULL, NULL,
> +	ibdiag_process_opts(argc, argv, NULL, "DGKL", NULL, NULL,
>  			    usage_args, NULL);
>  
>  	argc -= optind;
> diff --git a/src/ibstat.c b/src/ibstat.c
> index 3d971ed..12d3c20 100644
> --- a/src/ibstat.c
> +++ b/src/ibstat.c
> @@ -292,7 +292,7 @@ int main(int argc, char *argv[])
>  		NULL
>  	};
>  
> -	ibdiag_process_opts(argc, argv, NULL, "CDeGLPst", opts, process_opt,
> +	ibdiag_process_opts(argc, argv, NULL, "CDeGKLPst", opts, process_opt,
>  			    usage_args, usage_examples);
>  
>  	argc -= optind;
> diff --git a/src/ibsysstat.c b/src/ibsysstat.c
> index 2b11a06..bac4bb1 100644
> --- a/src/ibsysstat.c
> +++ b/src/ibsysstat.c
> @@ -326,7 +326,7 @@ int main(int argc, char **argv)
>  	};
>  	char usage_args[] = "<dest lid|guid> [<op>]";
>  
> -	ibdiag_process_opts(argc, argv, NULL, "D", opts, process_opt,
> +	ibdiag_process_opts(argc, argv, NULL, "DK", opts, process_opt,
>  			    usage_args, NULL);
>  
>  	argc -= optind;
> diff --git a/src/ibtracert.c b/src/ibtracert.c
> index e8fedf3..575d9d0 100644
> --- a/src/ibtracert.c
> +++ b/src/ibtracert.c
> @@ -757,7 +757,7 @@ int main(int argc, char **argv)
>  		NULL,
>  	};
>  
> -	ibdiag_process_opts(argc, argv, NULL, "D", opts, process_opt,
> +	ibdiag_process_opts(argc, argv, NULL, "DK", opts, process_opt,
>  			    usage_args, usage_examples);
>  
>  	f = stdout;
> diff --git a/src/perfquery.c b/src/perfquery.c
> index b58ad70..9ca2e15 100644
> --- a/src/perfquery.c
> +++ b/src/perfquery.c
> @@ -710,7 +710,7 @@ int main(int argc, char **argv)
>  		NULL,
>  	};
>  
> -	ibdiag_process_opts(argc, argv, NULL, "D", opts, process_opt,
> +	ibdiag_process_opts(argc, argv, NULL, "DK", opts, process_opt,
>  			    usage_args, usage_examples);
>  
>  	argc -= optind;
> diff --git a/src/saquery.c b/src/saquery.c
> index 1e730a4..90feb2d 100644
> --- a/src/saquery.c
> +++ b/src/saquery.c
> @@ -116,20 +116,6 @@ static unsigned valid_gid(ib_gid_t * gid)
>  	return memcmp(&zero_gid, gid, sizeof(*gid));
>  }
>  
> -static void format_buf(char *in, char *out, unsigned size)
> -{
> -	unsigned i;
> -
> -	for (i = 0; i < size - 3 && *in; i++) {
> -		*out++ = *in;
> -		if (*in++ == '\n' && *in) {
> -			*out++ = '\t';
> -			*out++ = '\t';
> -		}
> -	}
> -	*out = '\0';
> -}
> -
>  static void print_node_desc(ib_node_record_t * node_record)
>  {
>  	ib_node_info_t *p_ni = &(node_record->node_info);
> @@ -300,19 +286,17 @@ static void dump_portinfo_record(void *data)
>  
>  static void dump_one_portinfo_record(void *data)
>  {
> -	char buf[2300], buf2[4096];
>  	ib_portinfo_record_t *pir = data;
>  	ib_port_info_t *pi = &pir->port_info;
>  
> -	mad_dump_portinfo(buf, sizeof(buf), pi, sizeof(*pi));
> -	format_buf(buf, buf2, sizeof(buf2));
>  	printf("PortInfoRecord dump:\n"
>  	       "\tRID:\n"
>  	       "\t\tEndPortLid..............%u\n"
>  	       "\t\tPortNum.................%u\n"
>  	       "\t\tOptions.................0x%x\n"
> -	       "\tPortInfo dump:\n\t\t%s",
> -	       cl_ntoh16(pir->lid), pir->port_num, pir->options, buf2);
> +	       "\tPortInfo dump:\n",
> +	       cl_ntoh16(pir->lid), pir->port_num, pir->options);
> +	dump_portinfo(pi, sizeof(*pi), 2);
>  }
>  
>  static void dump_one_mcmember_record(void *data)
> @@ -471,7 +455,8 @@ static void dump_service_record(void *data)
>  	       cl_ntoh64(p_sr->service_id),
>  	       inet_ntop(AF_INET6, p_sr->service_gid.raw, gid, sizeof gid),
>  	       cl_ntoh16(p_sr->service_pkey), cl_ntoh32(p_sr->service_lease),
> -	       buf_service_key, buf_service_name,
> +	       (show_keys ? buf_service_key : NOT_DISPLAYED_STR),
> +               buf_service_name,
>  	       p_sr->service_data8[0], p_sr->service_data8[1],
>  	       p_sr->service_data8[2], p_sr->service_data8[3],
>  	       p_sr->service_data8[4], p_sr->service_data8[5],
> @@ -507,7 +492,7 @@ static void dump_inform_info_record(void *data)
>  	ib_inform_info_get_qpn_resp_time(p_iir->inform_info.g_or_v.
>  					 generic.qpn_resp_time_val, &qpn,
>  					 &resp_time_val);
> -	if (p_iir->inform_info.is_generic)
> +	if (p_iir->inform_info.is_generic) {
>  		printf("InformInfoRecord dump:\n"
>  		       "\t\tRID\n"
>  		       "\t\tSubscriberGID...........%s\n"
> @@ -519,10 +504,7 @@ static void dump_inform_info_record(void *data)
>  		       "\t\tis_generic..............0x%X\n"
>  		       "\t\tsubscribe...............0x%X\n"
>  		       "\t\ttrap_type...............0x%X\n"
> -		       "\t\ttrap_num................%u\n"
> -		       "\t\tqpn.....................0x%06X\n"
> -		       "\t\tresp_time_val...........0x%X\n"
> -		       "\t\tnode_type...............0x%06X\n",
> +		       "\t\ttrap_num................%u\n",
>  		       inet_ntop(AF_INET6, p_iir->subscriber_gid.raw, gid_str,
>  				 sizeof gid_str),
>  		       cl_ntoh16(p_iir->subscriber_enum),
> @@ -533,11 +515,20 @@ static void dump_inform_info_record(void *data)
>  		       p_iir->inform_info.is_generic,
>  		       p_iir->inform_info.subscribe,
>  		       cl_ntoh16(p_iir->inform_info.trap_type),
> -		       cl_ntoh16(p_iir->inform_info.g_or_v.generic.trap_num),
> -		       cl_ntoh32(qpn), resp_time_val,
> +		       cl_ntoh16(p_iir->inform_info.g_or_v.generic.trap_num));
> +		if (show_keys) {
> +			printf("\t\tqpn.....................0x%06X\n",
> +			       cl_ntoh32(qpn));
> +		} else {
> +			printf("\t\tqpn....................."
> +			       NOT_DISPLAYED_STR "\n");
> +		}
> +		printf("\t\tresp_time_val...........0x%X\n"
> +		       "\t\tnode_type...............0x%06X\n",
> +		       resp_time_val,
>  		       cl_ntoh32(ib_inform_info_get_prod_type
>  				 (&p_iir->inform_info)));
> -	else
> +	} else {
>  		printf("InformInfoRecord dump:\n"
>  		       "\t\tRID\n"
>  		       "\t\tSubscriberGID...........%s\n"
> @@ -549,10 +540,7 @@ static void dump_inform_info_record(void *data)
>  		       "\t\tis_generic..............0x%X\n"
>  		       "\t\tsubscribe...............0x%X\n"
>  		       "\t\ttrap_type...............0x%X\n"
> -		       "\t\tdev_id..................0x%X\n"
> -		       "\t\tqpn.....................0x%06X\n"
> -		       "\t\tresp_time_val...........0x%X\n"
> -		       "\t\tvendor_id...............0x%06X\n",
> +		       "\t\tdev_id..................0x%X\n",
>  		       inet_ntop(AF_INET6, p_iir->subscriber_gid.raw, gid_str,
>  				 sizeof gid_str),
>  		       cl_ntoh16(p_iir->subscriber_enum),
> @@ -563,10 +551,20 @@ static void dump_inform_info_record(void *data)
>  		       p_iir->inform_info.is_generic,
>  		       p_iir->inform_info.subscribe,
>  		       cl_ntoh16(p_iir->inform_info.trap_type),
> -		       cl_ntoh16(p_iir->inform_info.g_or_v.vend.dev_id),
> -		       cl_ntoh32(qpn), resp_time_val,
> +		       cl_ntoh16(p_iir->inform_info.g_or_v.vend.dev_id));
> +		if (show_keys) {
> +			printf("\t\tqpn.....................0x%06X\n",
> +			       cl_ntoh32(qpn));
> +		} else {
> +			printf("\t\tqpn....................."
> +			       NOT_DISPLAYED_STR "\n");
> +		}
> +		printf("\t\tresp_time_val...........0x%X\n"
> +		       "\t\tvendor_id...............0x%06X\n",
> +		       resp_time_val,
>  		       cl_ntoh32(ib_inform_info_get_prod_type
>  				 (&p_iir->inform_info)));
> +	}
>  }
>  
>  static void dump_one_link_record(void *data)
> diff --git a/src/sminfo.c b/src/sminfo.c
> index f1abc6a..1c12204 100644
> --- a/src/sminfo.c
> +++ b/src/sminfo.c
> @@ -109,7 +109,7 @@ int main(int argc, char **argv)
>  	};
>  	char usage_args[] = "<sm_lid|sm_dr_path> [modifier]";
>  
> -	ibdiag_process_opts(argc, argv, NULL, "s", opts, process_opt,
> +	ibdiag_process_opts(argc, argv, NULL, "sK", opts, process_opt,
>  			    usage_args, NULL);
>  
>  	argc -= optind;
> diff --git a/src/smpdump.c b/src/smpdump.c
> index 1e79c52..4d67be7 100644
> --- a/src/smpdump.c
> +++ b/src/smpdump.c
> @@ -231,7 +231,7 @@ int main(int argc, char *argv[])
>  
>  	ibd_timeout = 1000;
>  
> -	ibdiag_process_opts(argc, argv, NULL, "Gs", opts, process_opt,
> +	ibdiag_process_opts(argc, argv, NULL, "GKs", opts, process_opt,
>  			    usage_args, usage_examples);
>  
>  	argc -= optind;
> diff --git a/src/smpquery.c b/src/smpquery.c
> index 533b2c3..2909dc5 100644
> --- a/src/smpquery.c
> +++ b/src/smpquery.c
> @@ -133,7 +133,6 @@ static char *node_info(ib_portid_t * dest, char **argv, int argc)
>  
>  static char *port_info(ib_portid_t * dest, char **argv, int argc)
>  {
> -	char buf[2300];
>  	char data[IB_SMP_DATA_SIZE] = { 0 };
>  	int portnum = 0, orig_portnum;
>  
> @@ -146,9 +145,8 @@ static char *port_info(ib_portid_t * dest, char **argv, int argc)
>  	if (!smp_query_via(data, dest, IB_ATTR_PORT_INFO, portnum, 0, srcport))
>  		return "port info query failed";
>  
> -	mad_dump_portinfo(buf, sizeof buf, data, sizeof data);
> -
> -	printf("# Port info: %s port %d\n%s", portid2str(dest), orig_portnum, buf);
> +	printf("# Port info: %s port %d\n", portid2str(dest), orig_portnum);
> +	dump_portinfo(data, sizeof data, 0);
>  	return 0;
>  }
>  
> diff --git a/src/vendstat.c b/src/vendstat.c
> index 78f6d7d..dd89da7 100644
> --- a/src/vendstat.c
> +++ b/src/vendstat.c
> @@ -332,7 +332,7 @@ int main(int argc, char **argv)
>  		NULL
>  	};
>  
> -	ibdiag_process_opts(argc, argv, NULL, "D", opts, process_opt,
> +	ibdiag_process_opts(argc, argv, NULL, "DK", opts, process_opt,
>  			    usage_args, usage_examples);
>  
>  	argc -= optind;
> -- 
> 1.7.9.2
> 


-- 
Ira Weiny
Member of Technical Staff
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] 32+ messages in thread

* Re: [PATCH V3 2/8] infiniband-diags: install config file mode 400
       [not found]         ` <1338398497-12444-2-git-send-email-foraker1-i2BcT+NCU+M@public.gmane.org>
@ 2012-05-31 22:15           ` Ira Weiny
  0 siblings, 0 replies; 32+ messages in thread
From: Ira Weiny @ 2012-05-31 22:15 UTC (permalink / raw)
  To: Jim Foraker; +Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA

On Wed, 30 May 2012 10:21:31 -0700
Jim Foraker <foraker1-i2BcT+NCU+M@public.gmane.org> wrote:

> Necessary so that we may add credentials (ie, mkey) to it
> 
> Signed-off-by: Jim Foraker <foraker1-i2BcT+NCU+M@public.gmane.org>

Thanks, applied,
Ira

> ---
>  Makefile.am |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/Makefile.am b/Makefile.am
> index f861000..33b5f90 100644
> --- a/Makefile.am
> +++ b/Makefile.am
> @@ -148,4 +148,4 @@ install-data-hook:
>  	fi
>  	$(top_srcdir)/config/install-sh -c -m 444 $(top_srcdir)/scripts/IBswcountlimits.pm $(DESTDIR)/$(PERL_INSTALLDIR)/IBswcountlimits.pm
>  	$(top_srcdir)/config/install-sh -c -m 444 $(top_srcdir)/etc/error_thresholds $(DESTDIR)/$(sysconfdir)/infiniband-diags
> -	$(top_srcdir)/config/install-sh -c -m 444 $(top_srcdir)/etc/ibdiag.conf $(DESTDIR)/$(sysconfdir)/infiniband-diags
> +	$(top_srcdir)/config/install-sh -c -m 400 $(top_srcdir)/etc/ibdiag.conf $(DESTDIR)/$(sysconfdir)/infiniband-diags
> -- 
> 1.7.9.2
> 


-- 
Ira Weiny
Member of Technical Staff
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] 32+ messages in thread

* Re: [PATCH V3 3/8] infiniband-diags/ibportstate.c: Display MKey, lease, and protect bits
       [not found]         ` <1338398497-12444-3-git-send-email-foraker1-i2BcT+NCU+M@public.gmane.org>
@ 2012-05-31 22:16           ` Ira Weiny
  0 siblings, 0 replies; 32+ messages in thread
From: Ira Weiny @ 2012-05-31 22:16 UTC (permalink / raw)
  To: Jim Foraker; +Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA

On Wed, 30 May 2012 10:21:32 -0700
Jim Foraker <foraker1-i2BcT+NCU+M@public.gmane.org> wrote:

> By default, display mkey lease and protection bits.
> With a flag, also display mkey itself
> 
> Signed-off-by: Jim Foraker <foraker1-i2BcT+NCU+M@public.gmane.org>

Thanks, applied.
Ira

> ---
>  doc/rst/ibportstate.8.in.rst |    1 +
>  src/ibportstate.c            |   30 ++++++++++++++++++++++++------
>  2 files changed, 25 insertions(+), 6 deletions(-)
> 
> diff --git a/doc/rst/ibportstate.8.in.rst b/doc/rst/ibportstate.8.in.rst
> index 3af2aaa..1fc9bb2 100644
> --- a/doc/rst/ibportstate.8.in.rst
> +++ b/doc/rst/ibportstate.8.in.rst
> @@ -89,6 +89,7 @@ Debugging flags
>  .. include:: common/opt_h.rst
>  .. include:: common/opt_d.rst
>  .. include:: common/opt_e.rst
> +.. include:: common/opt_K.rst
>  .. include:: common/opt_v.rst
>  .. include:: common/opt_V.rst
>  
> diff --git a/src/ibportstate.c b/src/ibportstate.c
> index 5559d18..b2df212 100644
> --- a/src/ibportstate.c
> +++ b/src/ibportstate.c
> @@ -142,7 +142,7 @@ static int get_port_info(ib_portid_t * dest, uint8_t * data, int portnum,
>  }
>  
>  static void show_port_info(ib_portid_t * dest, uint8_t * data, int portnum,
> -			   int espeed_cap)
> +			   int espeed_cap, int is_switch)
>  {
>  	char buf[2300];
>  	char val[64];
> @@ -201,18 +201,36 @@ static void show_port_info(ib_portid_t * dest, uint8_t * data, int portnum,
>  			       val);
>  		sprintf(buf + strlen(buf), "%s", "\n");
>  	}
> +	if (!is_switch || portnum == 0) {
> +		if (show_keys) {
> +			mad_decode_field(data, IB_PORT_MKEY_F, val);
> +			mad_dump_field(IB_PORT_MKEY_F, buf + strlen(buf),
> +			    	       sizeof buf - strlen(buf), val);
> +		} else 
> +			snprint_field(buf+strlen(buf), sizeof(buf)-strlen(buf),
> +				      IB_PORT_MKEY_F, 32, NOT_DISPLAYED_STR);
> +		sprintf(buf+strlen(buf), "%s", "\n");
> +		mad_decode_field(data, IB_PORT_MKEY_LEASE_F, val);
> +		mad_dump_field(IB_PORT_MKEY_LEASE_F, buf + strlen(buf),
> +			       sizeof buf - strlen(buf), val);
> +		sprintf(buf+strlen(buf), "%s", "\n");
> +		mad_decode_field(data, IB_PORT_MKEY_PROT_BITS_F, val);
> +		mad_dump_field(IB_PORT_MKEY_PROT_BITS_F, buf + strlen(buf),
> +			       sizeof buf - strlen(buf), val);
> +		sprintf(buf+strlen(buf), "%s", "\n");
> +	}
>  
>  	printf("# Port info: %s port %d\n%s", portid2str(dest), portnum, buf);
>  }
>  
>  static void set_port_info(ib_portid_t * dest, uint8_t * data, int portnum,
> -			  int espeed_cap)
> +			  int espeed_cap, int is_switch)
>  {
>  	if (!smp_set_via(data, dest, IB_ATTR_PORT_INFO, portnum, 0, srcport))
>  		IBERROR("smp set portinfo failed");
>  
>  	printf("\nAfter PortInfo set:\n");
> -	show_port_info(dest, data, portnum, espeed_cap);
> +	show_port_info(dest, data, portnum, espeed_cap, is_switch);
>  }
>  
>  static void get_ext_port_info(ib_portid_t * dest, uint8_t * data, int portnum)
> @@ -460,7 +478,7 @@ int main(int argc, char **argv)
>  	else
>  		printf("%s PortInfo:\n", is_switch ? "Switch" : "CA");
>  	espeed_cap = get_port_info(&portid, data, portnum, is_switch);
> -	show_port_info(&portid, data, portnum, espeed_cap);
> +	show_port_info(&portid, data, portnum, espeed_cap, is_switch);
>  	if (is_mlnx_ext_port_info_supported(devid)) {
>  		get_ext_port_info(&portid, data2, portnum);
>  		show_ext_port_info(&portid, data2, portnum);
> @@ -527,7 +545,7 @@ int main(int argc, char **argv)
>  				      fdr10);
>  			set_ext_port_info(&portid, data2, portnum);
>  		}
> -		set_port_info(&portid, data, portnum, is_switch);
> +		set_port_info(&portid, data, portnum, espeed_cap, is_switch);
>  
>  	} else if (is_switch && portnum) {
>  		/* Now, make sure PortState is Active */
> @@ -596,7 +614,7 @@ int main(int argc, char **argv)
>  				get_ext_port_info(&peerportid, data2,
>  						  peerlocalportnum);
>  			show_port_info(&peerportid, data, peerlocalportnum,
> -				       peer_espeed_cap);
> +				       peer_espeed_cap, is_peer_switch);
>  			if (is_mlnx_ext_port_info_supported(rem_devid))
>  				show_ext_port_info(&peerportid, data2,
>  						   peerlocalportnum);
> -- 
> 1.7.9.2
> 


-- 
Ira Weiny
Member of Technical Staff
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] 32+ messages in thread

* Re: [PATCH V3.1 4/8] infiniband-diags: Allow specification of an mkey to use on the command line
       [not found]                     ` <1338491493-19714-1-git-send-email-foraker1-i2BcT+NCU+M@public.gmane.org>
@ 2012-05-31 22:17                       ` Ira Weiny
  0 siblings, 0 replies; 32+ messages in thread
From: Ira Weiny @ 2012-05-31 22:17 UTC (permalink / raw)
  To: Jim Foraker; +Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA

On Thu, 31 May 2012 12:11:33 -0700
Jim Foraker <foraker1-i2BcT+NCU+M@public.gmane.org> wrote:

> 
> Signed-off-by: Jim Foraker <foraker1-i2BcT+NCU+M@public.gmane.org>

Thanks, applied.
Ira

> ---
>  doc/rst/common/opt_y.rst                    |    6 ++++++
>  doc/rst/ibaddr.8.in.rst                     |    1 +
>  doc/rst/ibccconfig.8.in.rst                 |    1 +
>  doc/rst/ibccquery.8.in.rst                  |    1 +
>  doc/rst/iblinkinfo.8.in.rst                 |    1 +
>  doc/rst/ibnetdiscover.8.in.rst              |    1 +
>  doc/rst/ibportstate.8.in.rst                |    1 +
>  doc/rst/ibqueryerrors.8.in.rst              |    1 +
>  doc/rst/ibroute.8.in.rst                    |    1 +
>  doc/rst/ibtracert.8.in.rst                  |    2 ++
>  doc/rst/perfquery.8.in.rst                  |    1 +
>  doc/rst/sminfo.8.in.rst                     |    1 +
>  doc/rst/smpquery.8.in.rst                   |    1 +
>  include/ibdiag_common.h                     |    1 +
>  libibnetdisc/include/infiniband/ibnetdisc.h |    3 ++-
>  libibnetdisc/src/ibnetdisc.c                |    1 +
>  libibnetdisc/src/query_smp.c                |    1 +
>  src/ibaddr.c                                |    2 ++
>  src/ibcacheedit.c                           |    2 +-
>  src/ibccconfig.c                            |    2 ++
>  src/ibccquery.c                             |    2 ++
>  src/ibdiag_common.c                         |   13 +++++++++++++
>  src/iblinkinfo.c                            |    3 +++
>  src/ibnetdiscover.c                         |    2 ++
>  src/ibping.c                                |    2 +-
>  src/ibportstate.c                           |    2 ++
>  src/ibqueryerrors.c                         |    3 +++
>  src/ibroute.c                               |    2 ++
>  src/ibsendtrap.c                            |    2 ++
>  src/ibstat.c                                |    2 +-
>  src/ibsysstat.c                             |    2 +-
>  src/ibtracert.c                             |    4 +++-
>  src/perfquery.c                             |    2 ++
>  src/saquery.c                               |    2 +-
>  src/sminfo.c                                |    2 ++
>  src/smpquery.c                              |    2 ++
>  src/vendstat.c                              |    2 +-
>  37 files changed, 72 insertions(+), 8 deletions(-)
>  create mode 100644 doc/rst/common/opt_y.rst
> 
> diff --git a/doc/rst/common/opt_y.rst b/doc/rst/common/opt_y.rst
> new file mode 100644
> index 0000000..c49bd77
> --- /dev/null
> +++ b/doc/rst/common/opt_y.rst
> @@ -0,0 +1,6 @@
> +.. Define the common option -m
> +
> +**-y, --m_key <key>**
> +        use the specified M_key for requests. If non-numeric value (like 'x')
> +        is specified then a value will be prompted for.
> +
> diff --git a/doc/rst/ibaddr.8.in.rst b/doc/rst/ibaddr.8.in.rst
> index 93de897..6713fcf 100644
> --- a/doc/rst/ibaddr.8.in.rst
> +++ b/doc/rst/ibaddr.8.in.rst
> @@ -68,6 +68,7 @@ Port Selection flags
>  Configuration flags
>  -------------------
>  
> +.. include:: common/opt_y.rst
>  .. include:: common/opt_z-config.rst
>  
>  FILES
> diff --git a/doc/rst/ibccconfig.8.in.rst b/doc/rst/ibccconfig.8.in.rst
> index 3ab31b6..e88d8ac 100644
> --- a/doc/rst/ibccconfig.8.in.rst
> +++ b/doc/rst/ibccconfig.8.in.rst
> @@ -67,6 +67,7 @@ Port Selection flags
>  Configuration flags
>  -------------------
>  
> +.. include:: common/opt_y.rst
>  .. include:: common/opt_z-config.rst
>  
>  
> diff --git a/doc/rst/ibccquery.8.in.rst b/doc/rst/ibccquery.8.in.rst
> index 89b741c..773d2f8 100644
> --- a/doc/rst/ibccquery.8.in.rst
> +++ b/doc/rst/ibccquery.8.in.rst
> @@ -66,6 +66,7 @@ Port Selection flags
>  Configuration flags
>  -------------------
>  
> +.. include:: common/opt_y.rst
>  .. include:: common/opt_z-config.rst
>  
>  FILES
> diff --git a/doc/rst/iblinkinfo.8.in.rst b/doc/rst/iblinkinfo.8.in.rst
> index 1496bfc..9e13d57 100644
> --- a/doc/rst/iblinkinfo.8.in.rst
> +++ b/doc/rst/iblinkinfo.8.in.rst
> @@ -99,6 +99,7 @@ Configuration flags
>  .. include:: common/opt_o-outstanding_smps.rst
>  .. include:: common/opt_node_name_map.rst
>  .. include:: common/opt_t.rst
> +.. include:: common/opt_y.rst
>  
>  Debugging flags
>  ---------------
> diff --git a/doc/rst/ibnetdiscover.8.in.rst b/doc/rst/ibnetdiscover.8.in.rst
> index fb7c4c9..a5b92ca 100644
> --- a/doc/rst/ibnetdiscover.8.in.rst
> +++ b/doc/rst/ibnetdiscover.8.in.rst
> @@ -83,6 +83,7 @@ Configuration flags
>  .. include:: common/opt_o-outstanding_smps.rst
>  .. include:: common/opt_node_name_map.rst
>  .. include:: common/opt_t.rst
> +.. include:: common/opt_y.rst
>  
>  Debugging flags
>  ---------------
> diff --git a/doc/rst/ibportstate.8.in.rst b/doc/rst/ibportstate.8.in.rst
> index 1fc9bb2..d2223c8 100644
> --- a/doc/rst/ibportstate.8.in.rst
> +++ b/doc/rst/ibportstate.8.in.rst
> @@ -82,6 +82,7 @@ Configuration flags
>  
>  .. include:: common/opt_z-config.rst
>  .. include:: common/opt_t.rst
> +.. include:: common/opt_y.rst
>  
>  Debugging flags
>  ---------------
> diff --git a/doc/rst/ibqueryerrors.8.in.rst b/doc/rst/ibqueryerrors.8.in.rst
> index 15d488d..9a05e7b 100644
> --- a/doc/rst/ibqueryerrors.8.in.rst
> +++ b/doc/rst/ibqueryerrors.8.in.rst
> @@ -102,6 +102,7 @@ Configuration flags
>  .. include:: common/opt_o-outstanding_smps.rst
>  .. include:: common/opt_node_name_map.rst
>  .. include:: common/opt_t.rst
> +.. include:: common/opt_y.rst
>  
>  Debugging flags
>  ---------------
> diff --git a/doc/rst/ibroute.8.in.rst b/doc/rst/ibroute.8.in.rst
> index 0070dd6..c20136f 100644
> --- a/doc/rst/ibroute.8.in.rst
> +++ b/doc/rst/ibroute.8.in.rst
> @@ -67,6 +67,7 @@ Configuration flags
>  -------------------
>  
>  .. include:: common/opt_t.rst
> +.. include:: common/opt_y.rst
>  .. include:: common/opt_z-config.rst
>  
>  FILES
> diff --git a/doc/rst/ibtracert.8.in.rst b/doc/rst/ibtracert.8.in.rst
> index b002fa8..ab43af0 100644
> --- a/doc/rst/ibtracert.8.in.rst
> +++ b/doc/rst/ibtracert.8.in.rst
> @@ -65,8 +65,10 @@ Debugging flags
>  Configuration flags
>  -------------------
>  
> +
>  .. include:: common/opt_t.rst
>  .. include:: common/opt_node_name_map.rst
> +.. include:: common/opt_y.rst
>  .. include:: common/opt_z-config.rst
>  
>  FILES
> diff --git a/doc/rst/perfquery.8.in.rst b/doc/rst/perfquery.8.in.rst
> index f5d0e61..359c94e 100644
> --- a/doc/rst/perfquery.8.in.rst
> +++ b/doc/rst/perfquery.8.in.rst
> @@ -145,6 +145,7 @@ Configuration flags
>  -------------------
>  
>  .. include:: common/opt_t.rst
> +.. include:: common/opt_y.rst
>  .. include:: common/opt_z-config.rst
>  
>  
> diff --git a/doc/rst/sminfo.8.in.rst b/doc/rst/sminfo.8.in.rst
> index 1d7e69f..500d1d0 100644
> --- a/doc/rst/sminfo.8.in.rst
> +++ b/doc/rst/sminfo.8.in.rst
> @@ -71,6 +71,7 @@ Configuration flags
>  -------------------
>  
>  .. include:: common/opt_t.rst
> +.. include:: common/opt_y.rst
>  .. include:: common/opt_z-config.rst
>  
>  
> diff --git a/doc/rst/smpquery.8.in.rst b/doc/rst/smpquery.8.in.rst
> index b422731..989cb08 100644
> --- a/doc/rst/smpquery.8.in.rst
> +++ b/doc/rst/smpquery.8.in.rst
> @@ -81,6 +81,7 @@ Configuration flags
>  
>  .. include:: common/opt_t.rst
>  .. include:: common/opt_node_name_map.rst
> +.. include:: common/opt_y.rst
>  .. include:: common/opt_z-config.rst
>  
>  
> diff --git a/include/ibdiag_common.h b/include/ibdiag_common.h
> index e989088..0120203 100644
> --- a/include/ibdiag_common.h
> +++ b/include/ibdiag_common.h
> @@ -51,6 +51,7 @@ extern enum MAD_DEST ibd_dest_type;
>  extern ib_portid_t *ibd_sm_id;
>  extern int ibd_timeout;
>  extern uint32_t ibd_ibnetdisc_flags;
> +extern uint64_t ibd_mkey;
>  extern int show_keys;
>  
>  /*========================================================*/
> diff --git a/libibnetdisc/include/infiniband/ibnetdisc.h b/libibnetdisc/include/infiniband/ibnetdisc.h
> index 2ae2b06..335ad83 100644
> --- a/libibnetdisc/include/infiniband/ibnetdisc.h
> +++ b/libibnetdisc/include/infiniband/ibnetdisc.h
> @@ -151,7 +151,8 @@ typedef struct ibnd_config {
>  	unsigned timeout_ms;
>  	unsigned retries;
>  	uint32_t flags;
> -	uint8_t pad[52];
> +	uint64_t mkey;
> +	uint8_t pad[44];
>  } ibnd_config_t;
>  
>  /** =========================================================================
> diff --git a/libibnetdisc/src/ibnetdisc.c b/libibnetdisc/src/ibnetdisc.c
> index 8d38ab7..a0cbe3e 100644
> --- a/libibnetdisc/src/ibnetdisc.c
> +++ b/libibnetdisc/src/ibnetdisc.c
> @@ -711,6 +711,7 @@ ibnd_fabric_t *ibnd_discover_fabric(char * ca_name, int ca_port,
>  	}
>  	mad_rpc_set_timeout(scan.ibmad_port, cfg->timeout_ms);
>  	mad_rpc_set_retries(scan.ibmad_port, cfg->retries);
> +	smp_mkey_set(scan.ibmad_port, cfg->mkey);
>  
>  	IBND_DEBUG("from %s\n", portid2str(from));
>  
> diff --git a/libibnetdisc/src/query_smp.c b/libibnetdisc/src/query_smp.c
> index f4beb39..28620b4 100644
> --- a/libibnetdisc/src/query_smp.c
> +++ b/libibnetdisc/src/query_smp.c
> @@ -142,6 +142,7 @@ int issue_smp(smp_engine_t * engine, ib_portid_t * portid,
>  	smp->rpc.datasz = IB_SMP_DATA_SIZE;
>  	smp->rpc.dataoffs = IB_SMP_DATA_OFFS;
>  	smp->rpc.trid = mad_trid();
> +	smp->rpc.mkey = engine->cfg->mkey;
>  
>  	if (portid->lid <= 0 || portid->drpath.drslid == 0xffff ||
>  	    portid->drpath.drdlid == 0xffff)
> diff --git a/src/ibaddr.c b/src/ibaddr.c
> index 0735837..9d208f5 100644
> --- a/src/ibaddr.c
> +++ b/src/ibaddr.c
> @@ -149,6 +149,8 @@ int main(int argc, char **argv)
>  	if (!srcport)
>  		IBERROR("Failed to open '%s' port '%d'", ibd_ca, ibd_ca_port);
>  
> +	smp_mkey_set(srcport, ibd_mkey);
> +
>  	if (argc) {
>  		if (resolve_portid_str(ibd_ca, ibd_ca_port, &portid, argv[0],
>  				       ibd_dest_type, ibd_sm_id, srcport) < 0)
> diff --git a/src/ibcacheedit.c b/src/ibcacheedit.c
> index 2f9a634..f302813 100644
> --- a/src/ibcacheedit.c
> +++ b/src/ibcacheedit.c
> @@ -269,7 +269,7 @@ int main(int argc, char **argv)
>  	};
>  	char *usage_args = "<orig.cache> <new.cache>";
>  
> -	ibdiag_process_opts(argc, argv, NULL, "CDdeGKLPstv",
> +	ibdiag_process_opts(argc, argv, NULL, "CDdeGKLPstvy",
>  			    opts, process_opt, usage_args,
>  			    NULL);
>  
> diff --git a/src/ibccconfig.c b/src/ibccconfig.c
> index d796ed8..207c821 100644
> --- a/src/ibccconfig.c
> +++ b/src/ibccconfig.c
> @@ -631,6 +631,8 @@ int main(int argc, char **argv)
>  	if (!srcport)
>  		IBERROR("Failed to open '%s' port '%d'", ibd_ca, ibd_ca_port);
>  
> +	smp_mkey_set(srcport, ibd_mkey);
> +
>  	if (resolve_portid_str(ibd_ca, ibd_ca_port, &portid, argv[1],
>  			       ibd_dest_type, ibd_sm_id, srcport) < 0)
>  		IBERROR("can't resolve destination %s", argv[1]);
> diff --git a/src/ibccquery.c b/src/ibccquery.c
> index 34a9afd..f9d7b2f 100644
> --- a/src/ibccquery.c
> +++ b/src/ibccquery.c
> @@ -415,6 +415,8 @@ int main(int argc, char **argv)
>  	if (!srcport)
>  		IBERROR("Failed to open '%s' port '%d'", ibd_ca, ibd_ca_port);
>  
> +	smp_mkey_set(srcport, ibd_mkey);
> +
>  	if (resolve_portid_str(ibd_ca, ibd_ca_port, &portid, argv[1],
>  			       ibd_dest_type, ibd_sm_id, srcport) < 0)
>  		IBERROR("can't resolve destination %s", argv[1]);
> diff --git a/src/ibdiag_common.c b/src/ibdiag_common.c
> index 2662b9b..178ffe8 100644
> --- a/src/ibdiag_common.c
> +++ b/src/ibdiag_common.c
> @@ -71,6 +71,7 @@ char *ibd_ca = NULL;
>  int ibd_ca_port = 0;
>  int ibd_timeout = 0;
>  uint32_t ibd_ibnetdisc_flags = IBND_CONFIG_MLX_EPI;
> +uint64_t ibd_mkey;
>  int show_keys = 0;
>  
>  static const char *prog_name;
> @@ -265,6 +266,17 @@ static int process_opt(int ch, char *optarg)
>  	case 'K':
>  		show_keys = 1;
>  		break;
> +	case 'y':
> +		errno = 0;
> +		ibd_mkey = strtoull(optarg, &endp, 0);
> +		if (errno || *endp != '\0') {
> +			errno = 0;
> +			ibd_mkey = strtoull(getpass("M_Key: "), &endp, 0);
> +			if (errno || *endp != '\0') {
> +				IBERROR("Bad M_Key");
> +			}
> +                }
> +                break;
>  	default:
>  		return -1;
>  	}
> @@ -282,6 +294,7 @@ static const struct ibdiag_opt common_opts[] = {
>  	{"timeout", 't', 1, "<ms>", "timeout in ms"},
>  	{"sm_port", 's', 1, "<lid>", "SM port lid"},
>  	{"show_keys", 'K', 0, NULL, "display security keys in output"},
> +	{"m_key", 'y', 1, "<key>", "M_Key to use in request"},
>  	{"errors", 'e', 0, NULL, "show send and receive errors"},
>  	{"verbose", 'v', 0, NULL, "increase verbosity level"},
>  	{"debug", 'd', 0, NULL, "raise debug level"},
> diff --git a/src/iblinkinfo.c b/src/iblinkinfo.c
> index e4a8d65..2a55cf5 100644
> --- a/src/iblinkinfo.c
> +++ b/src/iblinkinfo.c
> @@ -632,12 +632,15 @@ int main(int argc, char **argv)
>  		exit(1);
>  	}
>  
> +	smp_mkey_set(ibmad_port, ibd_mkey);
> +
>  	if (ibd_timeout) {
>  		mad_rpc_set_timeout(ibmad_port, ibd_timeout);
>  		config.timeout_ms = ibd_timeout;
>  	}
>  
>  	config.flags = ibd_ibnetdisc_flags;
> +	config.mkey = ibd_mkey;
>  
>  	node_name_map = open_node_name_map(node_name_map_file);
>  
> diff --git a/src/ibnetdiscover.c b/src/ibnetdiscover.c
> index 6ed0801..d27b784 100644
> --- a/src/ibnetdiscover.c
> +++ b/src/ibnetdiscover.c
> @@ -1088,6 +1088,8 @@ int main(int argc, char **argv)
>  	if (argc && !(f = fopen(argv[0], "w")))
>  		IBERROR("can't open file %s for writing", argv[0]);
>  
> +	config.mkey = ibd_mkey;
> +
>  	node_name_map = open_node_name_map(node_name_map_file);
>  
>  	if (diff_cache_file &&
> diff --git a/src/ibping.c b/src/ibping.c
> index 6d3246c..beea26d 100644
> --- a/src/ibping.c
> +++ b/src/ibping.c
> @@ -202,7 +202,7 @@ int main(int argc, char **argv)
>  	};
>  	char usage_args[] = "<dest lid|guid>";
>  
> -	ibdiag_process_opts(argc, argv, NULL, "DK", opts, process_opt,
> +	ibdiag_process_opts(argc, argv, NULL, "DKy", opts, process_opt,
>  			    usage_args, NULL);
>  
>  	argc -= optind;
> diff --git a/src/ibportstate.c b/src/ibportstate.c
> index a8ba8d1..c7ee817 100644
> --- a/src/ibportstate.c
> +++ b/src/ibportstate.c
> @@ -394,6 +394,8 @@ int main(int argc, char **argv)
>  	if (!srcport)
>  		IBERROR("Failed to open '%s' port '%d'", ibd_ca, ibd_ca_port);
>  
> +	smp_mkey_set(srcport, ibd_mkey);
> +
>  	if (resolve_portid_str(ibd_ca, ibd_ca_port, &portid, argv[0],
>  			       ibd_dest_type, ibd_sm_id, srcport) < 0)
>  		IBERROR("can't resolve destination port %s", argv[0]);
> diff --git a/src/ibqueryerrors.c b/src/ibqueryerrors.c
> index c4ffcf1..076327c 100644
> --- a/src/ibqueryerrors.c
> +++ b/src/ibqueryerrors.c
> @@ -914,12 +914,15 @@ int main(int argc, char **argv)
>  	if (!ibmad_port)
>  		IBERROR("Failed to open port; %s:%d\n", ibd_ca, ibd_ca_port);
>  
> +	smp_mkey_set(ibmad_port, ibd_mkey);
> +
>  	if (ibd_timeout) {
>  		mad_rpc_set_timeout(ibmad_port, ibd_timeout);
>  		config.timeout_ms = ibd_timeout;
>  	}
>  
>  	config.flags = ibd_ibnetdisc_flags;
> +	config.mkey = ibd_mkey;
>  
>  	node_name_map = open_node_name_map(node_name_map_file);
>  
> diff --git a/src/ibroute.c b/src/ibroute.c
> index 63baf04..06549f5 100644
> --- a/src/ibroute.c
> +++ b/src/ibroute.c
> @@ -432,6 +432,8 @@ int main(int argc, char **argv)
>  	if (!srcport)
>  		IBERROR("Failed to open '%s' port '%d'", ibd_ca, ibd_ca_port);
>  
> +	smp_mkey_set(srcport, ibd_mkey);
> +
>  	if (resolve_portid_str(ibd_ca, ibd_ca_port, &portid, argv[0],
>  			       ibd_dest_type, ibd_sm_id, srcport) < 0)
>  		IBERROR("can't resolve destination port %s", argv[1]);
> diff --git a/src/ibsendtrap.c b/src/ibsendtrap.c
> index 98bacf1..39b75c2 100644
> --- a/src/ibsendtrap.c
> +++ b/src/ibsendtrap.c
> @@ -209,6 +209,8 @@ int main(int argc, char **argv)
>  	if (!srcport)
>  		IBERROR("Failed to open '%s' port '%d'", ibd_ca, ibd_ca_port);
>  
> +	smp_mkey_set(srcport, ibd_mkey);
> +
>  	rc = process_send_trap(trap_name);
>  	mad_rpc_close_port(srcport);
>  	return rc;
> diff --git a/src/ibstat.c b/src/ibstat.c
> index 12d3c20..665bb0a 100644
> --- a/src/ibstat.c
> +++ b/src/ibstat.c
> @@ -292,7 +292,7 @@ int main(int argc, char *argv[])
>  		NULL
>  	};
>  
> -	ibdiag_process_opts(argc, argv, NULL, "CDeGKLPst", opts, process_opt,
> +	ibdiag_process_opts(argc, argv, NULL, "CDeGKLPsty", opts, process_opt,
>  			    usage_args, usage_examples);
>  
>  	argc -= optind;
> diff --git a/src/ibsysstat.c b/src/ibsysstat.c
> index bac4bb1..d798fe2 100644
> --- a/src/ibsysstat.c
> +++ b/src/ibsysstat.c
> @@ -326,7 +326,7 @@ int main(int argc, char **argv)
>  	};
>  	char usage_args[] = "<dest lid|guid> [<op>]";
>  
> -	ibdiag_process_opts(argc, argv, NULL, "DK", opts, process_opt,
> +	ibdiag_process_opts(argc, argv, NULL, "DKy", opts, process_opt,
>  			    usage_args, NULL);
>  
>  	argc -= optind;
> diff --git a/src/ibtracert.c b/src/ibtracert.c
> index 575d9d0..5800e40 100644
> --- a/src/ibtracert.c
> +++ b/src/ibtracert.c
> @@ -757,7 +757,7 @@ int main(int argc, char **argv)
>  		NULL,
>  	};
>  
> -	ibdiag_process_opts(argc, argv, NULL, "DK", opts, process_opt,
> +	ibdiag_process_opts(argc, argv, NULL, "DKy", opts, process_opt,
>  			    usage_args, usage_examples);
>  
>  	f = stdout;
> @@ -774,6 +774,8 @@ int main(int argc, char **argv)
>  	if (!srcport)
>  		IBERROR("Failed to open '%s' port '%d'", ibd_ca, ibd_ca_port);
>  
> +	smp_mkey_set(srcport, ibd_mkey);
> +
>  	node_name_map = open_node_name_map(node_name_map_file);
>  
>  	if (resolve_portid_str(ibd_ca, ibd_ca_port, &src_portid, argv[0],
> diff --git a/src/perfquery.c b/src/perfquery.c
> index 9ca2e15..e85b14e 100644
> --- a/src/perfquery.c
> +++ b/src/perfquery.c
> @@ -727,6 +727,8 @@ int main(int argc, char **argv)
>  	if (!srcport)
>  		IBERROR("Failed to open '%s' port '%d'", ibd_ca, ibd_ca_port);
>  
> +	smp_mkey_set(srcport, ibd_mkey);
> +
>  	if (argc) {
>  		if (resolve_portid_str(ibd_ca, ibd_ca_port, &portid, argv[0],
>  				       ibd_dest_type, ibd_sm_id, srcport) < 0)
> diff --git a/src/saquery.c b/src/saquery.c
> index 90feb2d..8dbfb82 100644
> --- a/src/saquery.c
> +++ b/src/saquery.c
> @@ -1636,7 +1636,7 @@ int main(int argc, char **argv)
>  	q = NULL;
>  	ibd_timeout = DEFAULT_SA_TIMEOUT_MS;
>  
> -	ibdiag_process_opts(argc, argv, &params, "DGLs", opts, process_opt,
> +	ibdiag_process_opts(argc, argv, &params, "DGLsy", opts, process_opt,
>  			    usage_args, NULL);
>  
>  	argc -= optind;
> diff --git a/src/sminfo.c b/src/sminfo.c
> index 1c12204..2471a08 100644
> --- a/src/sminfo.c
> +++ b/src/sminfo.c
> @@ -122,6 +122,8 @@ int main(int argc, char **argv)
>  	if (!srcport)
>  		IBERROR("Failed to open '%s' port '%d'", ibd_ca, ibd_ca_port);
>  
> +	smp_mkey_set(srcport, ibd_mkey);
> +
>  	if (argc) {
>  		if (resolve_portid_str(ibd_ca, ibd_ca_port, &portid, argv[0],
>  				       ibd_dest_type, 0, srcport) < 0)
> diff --git a/src/smpquery.c b/src/smpquery.c
> index 2909dc5..7b7036b 100644
> --- a/src/smpquery.c
> +++ b/src/smpquery.c
> @@ -478,6 +478,8 @@ int main(int argc, char **argv)
>  	if (!srcport)
>  		IBERROR("Failed to open '%s' port '%d'", ibd_ca, ibd_ca_port);
>  
> +	smp_mkey_set(srcport, ibd_mkey);
> +
>  	node_name_map = open_node_name_map(node_name_map_file);
>  
>  	if (ibd_dest_type != IB_DEST_DRSLID) {
> diff --git a/src/vendstat.c b/src/vendstat.c
> index dd89da7..c1a34b8 100644
> --- a/src/vendstat.c
> +++ b/src/vendstat.c
> @@ -332,7 +332,7 @@ int main(int argc, char **argv)
>  		NULL
>  	};
>  
> -	ibdiag_process_opts(argc, argv, NULL, "DK", opts, process_opt,
> +	ibdiag_process_opts(argc, argv, NULL, "DKy", opts, process_opt,
>  			    usage_args, usage_examples);
>  
>  	argc -= optind;
> -- 
> 1.7.9.2
> 


-- 
Ira Weiny
Member of Technical Staff
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] 32+ messages in thread

* Re: [PATCH V3 5/8] infiniband-diags/ibportstate.c: Support changing MKey, lease, and protect bits
       [not found]         ` <1338398497-12444-5-git-send-email-foraker1-i2BcT+NCU+M@public.gmane.org>
@ 2012-05-31 22:21           ` Ira Weiny
  0 siblings, 0 replies; 32+ messages in thread
From: Ira Weiny @ 2012-05-31 22:21 UTC (permalink / raw)
  To: Jim Foraker; +Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA

On Wed, 30 May 2012 10:21:34 -0700
Jim Foraker <foraker1-i2BcT+NCU+M@public.gmane.org> wrote:

> 
> Signed-off-by: Jim Foraker <foraker1-i2BcT+NCU+M@public.gmane.org>

Thanks, applied.
Ira

> ---
>  doc/rst/ibportstate.8.in.rst |    6 ++++
>  src/ibportstate.c            |   72 ++++++++++++++++++++++++++++++++++--------
>  2 files changed, 65 insertions(+), 13 deletions(-)
> 
> diff --git a/doc/rst/ibportstate.8.in.rst b/doc/rst/ibportstate.8.in.rst
> index fca3f7a..052e86a 100644
> --- a/doc/rst/ibportstate.8.in.rst
> +++ b/doc/rst/ibportstate.8.in.rst
> @@ -61,6 +61,12 @@ OPTIONS
>          done on a switch. This peer port validation feature of query op
>          requires LID routing to be functioning in the subnet.
>  
> +        **mkey, mkeylease, and mkeyprot** are only allowed on CAs, routers, or
> +        switch port 0 (An error is generated if attempted on external switch
> +        ports).  Hexadecimal and octal mkeys may be specified by prepending the
> +        key with '0x' or '0', respectively.  If a non-numeric value (like 'x')
> +        is specified for the mkey, then ibportstate will prompt for a value.
> +
>  
>  Addressing Flags
>  ----------------
> diff --git a/src/ibportstate.c b/src/ibportstate.c
> index 02cf333..743a276 100644
> --- a/src/ibportstate.c
> +++ b/src/ibportstate.c
> @@ -41,6 +41,7 @@
>  #include <unistd.h>
>  #include <string.h>
>  #include <getopt.h>
> +#include <errno.h>
>  
>  #include <infiniband/umad.h>
>  #include <infiniband/mad.h>
> @@ -64,22 +65,28 @@ enum port_ops {
>  	LID,
>  	SMLID,
>  	LMC,
> +	MKEY,
> +	MKEYLEASE,
> +	MKEYPROT,
>  };
>  
>  struct ibmad_port *srcport;
> -int speed = 0; /* no state change */
> -int espeed = 0; /* no state change */
> -int fdr10 = 0; /* no state change */
> -int width = 0; /* no state change */
> -int lid;
> -int smlid;
> -int lmc;
> -int mtu;
> -int vls = 0; /* no state change */
> +uint64_t speed = 0; /* no state change */
> +uint64_t espeed = 0; /* no state change */
> +uint64_t fdr10 = 0; /* no state change */
> +uint64_t width = 0; /* no state change */
> +uint64_t lid;
> +uint64_t smlid;
> +uint64_t lmc;
> +uint64_t mtu;
> +uint64_t vls = 0; /* no state change */
> +uint64_t mkey;
> +uint64_t mkeylease;
> +uint64_t mkeyprot;
>  
>  struct {
>  	const char *name;
> -	int *val;
> +	uint64_t *val;
>  	int set;
>  } port_args[] = {
>  	{"query", NULL, 0},	/* QUERY */
> @@ -98,6 +105,9 @@ struct {
>  	{"lid", &lid, 0},	/* LID */
>  	{"smlid", &smlid, 0},	/* SMLID */
>  	{"lmc", &lmc, 0},	/* LMC */
> +	{"mkey", &mkey, 0},	/* MKEY */
> +	{"mkeylease", &mkeylease, 0},	/* MKEY LEASE */
> +	{"mkeyprot", &mkeyprot, 0},	/* MKEY PROTECT BITS */
>  };
>  
>  #define NPORT_ARGS (sizeof(port_args) / sizeof(port_args[0]))
> @@ -367,9 +377,10 @@ int main(int argc, char **argv)
>  	int i;
>  	uint16_t devid, rem_devid;
>  	long val;
> +	char *endp;
>  	char usage_args[] = "<dest dr_path|lid|guid> <portnum> [<op>]\n"
>  	    "\nSupported ops: enable, disable, reset, speed, width, query,\n"
> -	    "\tdown, arm, active, vls, mtu, lid, smlid, lmc\n";
> +	    "\tdown, arm, active, vls, mtu, lid, smlid, lmc, mkey, mkeylease, mkeyprot\n";
>  	const char *usage_examples[] = {
>  		"3 1 disable\t\t\t# by lid",
>  		"-G 0x2C9000100D051 1 enable\t# by guid",
> @@ -423,7 +434,7 @@ int main(int argc, char **argv)
>  			if (++i >= argc)
>  				IBERROR("%s requires an additional parameter",
>  					port_args[j].name);
> -			val = strtol(argv[i], 0, 0);
> +			val = strtoull(argv[i], 0, 0);
>  			switch (j) {
>  			case SPEED:
>  				if (val < 0 || val > 15)
> @@ -461,8 +472,29 @@ int main(int argc, char **argv)
>  			case LMC:
>  				if (val < 0 || val > 7)
>  					IBERROR("invalid lmc value %ld", val);
> +				break;
> +			case MKEY:
> +				errno = 0;
> +				val = strtoull(argv[i], &endp, 0);
> +				if (errno || *endp != '\0') {
> +					errno = 0;
> +					val = strtoull(getpass("New M_Key: "),
> +						       &endp, 0);
> +					if (errno || *endp != '\0') {
> +						IBERROR("Bad new M_Key\n");
> +					}
> +				}
> +				/* All 64-bit values are legal */
> +				break;
> +			case MKEYLEASE:
> +				if (val < 0 || val > 0xFFFF)
> +					IBERROR("invalid mkey lease time %ld", val);
> +				break;
> +			case MKEYPROT:
> +				if (val < 0 || val > 3)
> +					IBERROR("invalid mkey protection bit setting %ld", val);
>  			}
> -			*port_args[j].val = (int)val;
> +			*port_args[j].val = val;
>  			changed = 1;
>  			break;
>  		}
> @@ -475,6 +507,10 @@ int main(int argc, char **argv)
>  	is_switch = get_node_info(&portid, data);
>  	devid = (uint16_t) mad_get_field(data, 0, IB_NODE_DEVID_F);
>  
> +	if ((port_args[MKEY].set || port_args[MKEYLEASE].set ||
> +	     port_args[MKEYPROT].set) && is_switch && portnum != 0)
> +		IBERROR("Can't set M_Key fields on switch port != 0");
> +
>  	if (port_op != QUERY || changed)
>  		printf("Initial %s PortInfo:\n", is_switch ? "Switch" : "CA");
>  	else
> @@ -547,6 +583,16 @@ int main(int argc, char **argv)
>  				      fdr10);
>  			set_ext_port_info(&portid, data2, portnum);
>  		}
> +
> +		if (port_args[MKEY].set)
> +			mad_set_field64(data, 0, IB_PORT_MKEY_F, mkey);
> +		if (port_args[MKEYLEASE].set)
> +			mad_set_field(data, 0, IB_PORT_MKEY_LEASE_F,
> +				      mkeylease);
> +		if (port_args[MKEYPROT].set)
> +			mad_set_field(data, 0, IB_PORT_MKEY_PROT_BITS_F,
> +				      mkeyprot);
> +
>  		set_port_info(&portid, data, portnum, espeed_cap, is_switch);
>  
>  	} else if (is_switch && portnum) {
> -- 
> 1.7.9.2
> 


-- 
Ira Weiny
Member of Technical Staff
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] 32+ messages in thread

* Re: [PATCH V3 6/8] infiniband-diags: Add m_key option to config file
       [not found]         ` <1338398497-12444-6-git-send-email-foraker1-i2BcT+NCU+M@public.gmane.org>
@ 2012-05-31 22:22           ` Ira Weiny
  0 siblings, 0 replies; 32+ messages in thread
From: Ira Weiny @ 2012-05-31 22:22 UTC (permalink / raw)
  To: Jim Foraker; +Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA

On Wed, 30 May 2012 10:21:35 -0700
Jim Foraker <foraker1-i2BcT+NCU+M@public.gmane.org> wrote:

> 
> Signed-off-by: Jim Foraker <foraker1-i2BcT+NCU+M@public.gmane.org>

Thanks, applied.
Ira

> ---
>  etc/ibdiag.conf     |    2 ++
>  src/ibdiag_common.c |    2 ++
>  2 files changed, 4 insertions(+)
> 
> diff --git a/etc/ibdiag.conf b/etc/ibdiag.conf
> index 77f3ce9..2a2334f 100644
> --- a/etc/ibdiag.conf
> +++ b/etc/ibdiag.conf
> @@ -15,3 +15,5 @@
>  # Default = true
>  #MLX_EPI=false
>  
> +# define a default m_key
> +#m_key=0x00
> diff --git a/src/ibdiag_common.c b/src/ibdiag_common.c
> index 069f6e5..d7d784f 100644
> --- a/src/ibdiag_common.c
> +++ b/src/ibdiag_common.c
> @@ -157,6 +157,8 @@ void read_ibdiag_config(const char *file)
>  			} else {
>  				ibd_ibnetdisc_flags &= ~IBND_CONFIG_MLX_EPI;
>  			}
> +		} else if (strncmp(name, "m_key", strlen("m_key")) == 0) {
> +			ibd_mkey = strtoull(val_str, 0, 0);
>  		}
>  	}
>  
> -- 
> 1.7.9.2
> 


-- 
Ira Weiny
Member of Technical Staff
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] 32+ messages in thread

* Re: [PATCH V3.1 7/8] ib-diags/saquery: Fix smkey handling
       [not found]             ` <1338416060-14025-1-git-send-email-foraker1-i2BcT+NCU+M@public.gmane.org>
@ 2012-05-31 22:23               ` Ira Weiny
  0 siblings, 0 replies; 32+ messages in thread
From: Ira Weiny @ 2012-05-31 22:23 UTC (permalink / raw)
  To: Jim Foraker; +Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA

On Wed, 30 May 2012 15:14:20 -0700
Jim Foraker <foraker1-i2BcT+NCU+M@public.gmane.org> wrote:

> smkey is already defined as a global inside saquery.c, so remove
> broken support for passing it around as a function parameter
> 
> Signed-off-by: Jim Foraker <foraker1-i2BcT+NCU+M@public.gmane.org>

Thanks, applied.
Ira

> ---
>  include/ibdiag_common.h |    1 +
>  src/ibdiag_common.c     |    1 +
>  src/saquery.c           |   60 +++++++++++++++++++++++------------------------
>  3 files changed, 31 insertions(+), 31 deletions(-)
> 
> diff --git a/include/ibdiag_common.h b/include/ibdiag_common.h
> index 0120203..6dade10 100644
> --- a/include/ibdiag_common.h
> +++ b/include/ibdiag_common.h
> @@ -52,6 +52,7 @@ extern ib_portid_t *ibd_sm_id;
>  extern int ibd_timeout;
>  extern uint32_t ibd_ibnetdisc_flags;
>  extern uint64_t ibd_mkey;
> +extern uint64_t ibd_sakey;
>  extern int show_keys;
>  
>  /*========================================================*/
> diff --git a/src/ibdiag_common.c b/src/ibdiag_common.c
> index d7d784f..eaf504f 100644
> --- a/src/ibdiag_common.c
> +++ b/src/ibdiag_common.c
> @@ -72,6 +72,7 @@ int ibd_ca_port = 0;
>  int ibd_timeout = 0;
>  uint32_t ibd_ibnetdisc_flags = IBND_CONFIG_MLX_EPI;
>  uint64_t ibd_mkey;
> +uint64_t ibd_sakey;
>  int show_keys = 0;
>  
>  static const char *prog_name;
> diff --git a/src/saquery.c b/src/saquery.c
> index dec990a..7a7878b 100644
> --- a/src/saquery.c
> +++ b/src/saquery.c
> @@ -85,7 +85,6 @@ struct query_cmd {
>  
>  static char *node_name_map_file = NULL;
>  static nn_map_t *node_name_map = NULL;
> -static uint64_t smkey = 1;
>  
>  /**
>   * Declare some globals because I don't want this to be too complex.
> @@ -724,11 +723,11 @@ static void dump_results(struct sa_query_result *r, void (*dump_func) (void *))
>   */
>  static int get_any_records(bind_handle_t h,
>  			   uint16_t attr_id, uint32_t attr_mod,
> -			   ib_net64_t comp_mask, void *attr, uint64_t sm_key,
> +			   ib_net64_t comp_mask, void *attr,
>  			   struct sa_query_result *result)
>  {
>  	int ret = sa_query(h, IB_MAD_METHOD_GET_TABLE, attr_id, attr_mod,
> -			   cl_ntoh64(comp_mask), sm_key, attr, result);
> +			   cl_ntoh64(comp_mask), ibd_sakey, attr, result);
>  	if (ret) {
>  		fprintf(stderr, "Query SA failed: %s\n", strerror(ret));
>  		return ret;
> @@ -744,12 +743,12 @@ static int get_any_records(bind_handle_t h,
>  
>  static int get_and_dump_any_records(bind_handle_t h, uint16_t attr_id,
>  				    uint32_t attr_mod, ib_net64_t comp_mask,
> -				    void *attr, uint64_t sm_key,
> +				    void *attr,
>  				    void (*dump_func) (void *))
>  {
>  	struct sa_query_result result;
>  	int ret = get_any_records(h, attr_id, attr_mod, comp_mask, attr,
> -				  sm_key, &result);
> +				  &result);
>  	if (ret)
>  		return ret;
>  
> @@ -761,18 +760,17 @@ static int get_and_dump_any_records(bind_handle_t h, uint16_t attr_id,
>  /**
>   * Get all the records available for requested query type.
>   */
> -static int get_all_records(bind_handle_t h, uint16_t attr_id, int trusted,
> +static int get_all_records(bind_handle_t h, uint16_t attr_id,
>  			   struct sa_query_result *result)
>  {
> -	return get_any_records(h, attr_id, 0, 0, NULL, trusted ? smkey : 0,
> -			       result);
> +	return get_any_records(h, attr_id, 0, 0, NULL, result);
>  }
>  
>  static int get_and_dump_all_records(bind_handle_t h, uint16_t attr_id,
> -				    int trusted, void (*dump_func) (void *))
> +				    void (*dump_func) (void *))
>  {
>  	struct sa_query_result result;
> -	int ret = get_all_records(h, attr_id, 0, &result);
> +	int ret = get_all_records(h, attr_id, &result);
>  	if (ret)
>  		return ret;
>  
> @@ -792,7 +790,7 @@ static int get_lid_from_name(bind_handle_t h, const char *name, uint16_t * lid)
>  	int ret;
>  	struct sa_query_result result;
>  
> -	ret = get_all_records(h, IB_SA_ATTR_NODERECORD, 0, &result);
> +	ret = get_all_records(h, IB_SA_ATTR_NODERECORD, &result);
>  	if (ret)
>  		return ret;
>  
> @@ -892,7 +890,7 @@ static int get_issm_records(bind_handle_t h, ib_net32_t capability_mask,
>  	attr.port_info.capability_mask = capability_mask;
>  
>  	return get_any_records(h, IB_SA_ATTR_PORTINFORECORD, 1 << 31,
> -			       IB_PIR_COMPMASK_CAPMASK, &attr, 0, result);
> +			       IB_PIR_COMPMASK_CAPMASK, &attr, result);
>  }
>  
>  static int print_node_records(bind_handle_t h)
> @@ -901,7 +899,7 @@ static int print_node_records(bind_handle_t h)
>  	int ret;
>  	struct sa_query_result result;
>  
> -	ret = get_all_records(h, IB_SA_ATTR_NODERECORD, 0, &result);
> +	ret = get_all_records(h, IB_SA_ATTR_NODERECORD, &result);
>  	if (ret)
>  		return ret;
>  
> @@ -944,7 +942,7 @@ static int get_print_class_port_info(bind_handle_t h)
>  {
>  	struct sa_query_result result;
>  	int ret = sa_query(h, IB_MAD_METHOD_GET, CLASS_PORT_INFO, 0, 0,
> -			   0, NULL, &result);
> +			   ibd_sakey, NULL, &result);
>  	if (ret) {
>  		fprintf(stderr, "ERROR: Query SA failed: %s\n", strerror(ret));
>  		return ret;
> @@ -991,7 +989,7 @@ static int query_path_records(const struct query_cmd *q, bind_handle_t h,
>  				  SELEC);
>  
>  	return get_and_dump_any_records(h, IB_SA_ATTR_PATHRECORD, 0, comp_mask,
> -					&pr, 0, dump_path_record);
> +					&pr, dump_path_record);
>  }
>  
>  static int print_issm_records(bind_handle_t h)
> @@ -1027,11 +1025,11 @@ static int print_multicast_member_records(bind_handle_t h)
>  	int ret;
>  	unsigned i;
>  
> -	ret = get_all_records(h, IB_SA_ATTR_MCRECORD, 1, &mc_group_result);
> +	ret = get_all_records(h, IB_SA_ATTR_MCRECORD, &mc_group_result);
>  	if (ret)
>  		return ret;
>  
> -	ret = get_all_records(h, IB_SA_ATTR_NODERECORD, 0, &nr_result);
> +	ret = get_all_records(h, IB_SA_ATTR_NODERECORD, &nr_result);
>  	if (ret)
>  		goto return_mc;
>  
> @@ -1052,7 +1050,7 @@ return_mc:
>  
>  static int print_multicast_group_records(bind_handle_t h)
>  {
> -	return get_and_dump_all_records(h, IB_SA_ATTR_MCRECORD, 0,
> +	return get_and_dump_all_records(h, IB_SA_ATTR_MCRECORD,
>  					dump_multicast_group_record);
>  }
>  
> @@ -1076,7 +1074,7 @@ static int query_node_records(const struct query_cmd *q, bind_handle_t h,
>  	CHECK_AND_SET_VAL(lid, 16, 0, nr.lid, NR, LID);
>  
>  	return get_and_dump_any_records(h, IB_SA_ATTR_NODERECORD, 0, comp_mask,
> -					&nr, 0, dump_node_record);
> +					&nr, dump_node_record);
>  }
>  
>  static int query_portinfo_records(const struct query_cmd *q,
> @@ -1096,7 +1094,7 @@ static int query_portinfo_records(const struct query_cmd *q,
>  	CHECK_AND_SET_VAL(options, 8, -1, pir.options, PIR, OPTIONS);
>  
>  	return get_and_dump_any_records(h, IB_SA_ATTR_PORTINFORECORD, 0,
> -					comp_mask, &pir, 0,
> +					comp_mask, &pir,
>  					dump_one_portinfo_record);
>  }
>  
> @@ -1129,13 +1127,13 @@ static int query_mcmember_records(const struct query_cmd *q,
>  	CHECK_AND_SET_VAL(p->proxy_join, 8, -1, mr.proxy_join, MCR, PROXY);
>  
>  	return get_and_dump_any_records(h, IB_SA_ATTR_MCRECORD, 0, comp_mask,
> -					&mr, smkey, dump_one_mcmember_record);
> +					&mr, dump_one_mcmember_record);
>  }
>  
>  static int query_service_records(const struct query_cmd *q, bind_handle_t h,
>  				 struct query_params *p, int argc, char *argv[])
>  {
> -	return get_and_dump_all_records(h, IB_SA_ATTR_SERVICERECORD, 0,
> +	return get_and_dump_all_records(h, IB_SA_ATTR_SERVICERECORD,
>  					dump_service_record);
>  }
>  
> @@ -1143,7 +1141,7 @@ static int query_informinfo_records(const struct query_cmd *q,
>  				    bind_handle_t h, struct query_params *p,
>  				    int argc, char *argv[])
>  {
> -	return get_and_dump_all_records(h, IB_SA_ATTR_INFORMINFORECORD, 0,
> +	return get_and_dump_all_records(h, IB_SA_ATTR_INFORMINFORECORD,
>  					dump_inform_info_record);
>  }
>  
> @@ -1167,7 +1165,7 @@ static int query_link_records(const struct query_cmd *q, bind_handle_t h,
>  	CHECK_AND_SET_VAL(to_port, 8, -1, lr.to_port_num, LR, TO_PORT);
>  
>  	return get_and_dump_any_records(h, IB_SA_ATTR_LINKRECORD, 0, comp_mask,
> -					&lr, 0, dump_one_link_record);
> +					&lr, dump_one_link_record);
>  }
>  
>  static int query_sl2vl_records(const struct query_cmd *q, bind_handle_t h,
> @@ -1186,7 +1184,7 @@ static int query_sl2vl_records(const struct query_cmd *q, bind_handle_t h,
>  	CHECK_AND_SET_VAL(out_port, 8, -1, slvl.out_port_num, SLVL, OUT_PORT);
>  
>  	return get_and_dump_any_records(h, IB_SA_ATTR_SL2VLTABLERECORD, 0,
> -					comp_mask, &slvl, 0,
> +					comp_mask, &slvl,
>  					dump_one_slvl_record);
>  }
>  
> @@ -1206,7 +1204,7 @@ static int query_vlarb_records(const struct query_cmd *q, bind_handle_t h,
>  	CHECK_AND_SET_VAL(block, 8, -1, vlarb.block_num, VLA, BLOCK);
>  
>  	return get_and_dump_any_records(h, IB_SA_ATTR_VLARBTABLERECORD, 0,
> -					comp_mask, &vlarb, 0,
> +					comp_mask, &vlarb,
>  					dump_one_vlarb_record);
>  }
>  
> @@ -1227,7 +1225,7 @@ static int query_pkey_tbl_records(const struct query_cmd *q,
>  	CHECK_AND_SET_VAL(block, 16, -1, pktr.block_num, PKEY, BLOCK);
>  
>  	return get_and_dump_any_records(h, IB_SA_ATTR_PKEYTABLERECORD, 0,
> -					comp_mask, &pktr, smkey,
> +					comp_mask, &pktr,
>  					dump_one_pkey_tbl_record);
>  }
>  
> @@ -1246,7 +1244,7 @@ static int query_lft_records(const struct query_cmd *q, bind_handle_t h,
>  	CHECK_AND_SET_VAL(block, 16, -1, lftr.block_num, LFTR, BLOCK);
>  
>  	return get_and_dump_any_records(h, IB_SA_ATTR_LFTRECORD, 0, comp_mask,
> -					&lftr, 0, dump_one_lft_record);
> +					&lftr, dump_one_lft_record);
>  }
>  
>  static int query_guidinfo_records(const struct query_cmd *q, bind_handle_t h,
> @@ -1264,7 +1262,7 @@ static int query_guidinfo_records(const struct query_cmd *q, bind_handle_t h,
>  	CHECK_AND_SET_VAL(block, 8, -1, gir.block_num, GIR, BLOCKNUM);
>  
>  	return get_and_dump_any_records(h, IB_SA_ATTR_GUIDINFORECORD, 0,
> -					comp_mask, &gir, 0,
> +					comp_mask, &gir,
>  					dump_one_guidinfo_record);
>  }
>  
> @@ -1287,7 +1285,7 @@ static int query_mft_records(const struct query_cmd *q, bind_handle_t h,
>  	mftr.position_block_num |= cl_hton16(pos << 12);
>  
>  	return get_and_dump_any_records(h, IB_SA_ATTR_MFTRECORD, 0, comp_mask,
> -					&mftr, 0, dump_one_mft_record);
> +					&mftr, dump_one_mft_record);
>  }
>  
>  static const struct query_cmd query_cmds[] = {
> @@ -1399,7 +1397,7 @@ static int process_opt(void *context, int ch, char *optarg)
>  			fprintf(stderr, "cannot get SM_Key\n");
>  			ibdiag_show_usage();
>  		}
> -		smkey = strtoull(optarg, NULL, 0);
> +		ibd_sakey = strtoull(optarg, NULL, 0);
>  		break;
>  	case 'p':
>  		query_type = IB_SA_ATTR_PATHRECORD;
> -- 
> 1.7.9.2
> 


-- 
Ira Weiny
Member of Technical Staff
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] 32+ messages in thread

* Re: [PATCH V3.1 8/8] infiniband-diags: Add sa_smkey option to config file
       [not found]             ` <1338416114-14068-1-git-send-email-foraker1-i2BcT+NCU+M@public.gmane.org>
  2012-05-31 11:56               ` Hal Rosenstock
@ 2012-05-31 22:23               ` Ira Weiny
  1 sibling, 0 replies; 32+ messages in thread
From: Ira Weiny @ 2012-05-31 22:23 UTC (permalink / raw)
  To: Jim Foraker; +Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA

On Wed, 30 May 2012 15:15:14 -0700
Jim Foraker <foraker1-i2BcT+NCU+M@public.gmane.org> wrote:

> Defines a default for the smkey used in SA requests
> 
> Signed-off-by: Jim Foraker <foraker1-i2BcT+NCU+M@public.gmane.org>

Thanks, applied.
Ira

> ---
>  etc/ibdiag.conf     |    3 +++
>  src/ibdiag_common.c |    3 +++
>  2 files changed, 6 insertions(+)
> 
> diff --git a/etc/ibdiag.conf b/etc/ibdiag.conf
> index 2a2334f..9686d14 100644
> --- a/etc/ibdiag.conf
> +++ b/etc/ibdiag.conf
> @@ -17,3 +17,6 @@
>  
>  # define a default m_key
>  #m_key=0x00
> +
> +# default smkey to be used for SA requests
> +#sa_key=0x00
> diff --git a/src/ibdiag_common.c b/src/ibdiag_common.c
> index eaf504f..ba0ce0b 100644
> --- a/src/ibdiag_common.c
> +++ b/src/ibdiag_common.c
> @@ -160,6 +160,9 @@ void read_ibdiag_config(const char *file)
>  			}
>  		} else if (strncmp(name, "m_key", strlen("m_key")) == 0) {
>  			ibd_mkey = strtoull(val_str, 0, 0);
> +		} else if (strncmp(name, "sa_key",
> +				   strlen("sa_key")) == 0) {
> +			ibd_sakey = strtoull(val_str, 0, 0);
>  		}
>  	}
>  
> -- 
> 1.7.9.2
> 


-- 
Ira Weiny
Member of Technical Staff
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] 32+ messages in thread

* Re: [PATCH V3.1 8/8] infiniband-diags: Add sa_smkey option to config file
       [not found]                 ` <4FC75C61.7060408-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
@ 2012-05-31 22:25                   ` Ira Weiny
       [not found]                     ` <20120531152515.410a999a.weiny2-i2BcT+NCU+M@public.gmane.org>
  0 siblings, 1 reply; 32+ messages in thread
From: Ira Weiny @ 2012-05-31 22:25 UTC (permalink / raw)
  To: Hal Rosenstock; +Cc: Jim Foraker, linux-rdma-u79uwXL29TY76Z2rM5mHXA

On Thu, 31 May 2012 07:56:17 -0400
Hal Rosenstock <hal-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org> wrote:

> On 5/30/2012 6:15 PM, Jim Foraker wrote:
> > Defines a default for the smkey used in SA requests
> > 
> > Signed-off-by: Jim Foraker <foraker1-i2BcT+NCU+M@public.gmane.org>
> > ---
> >  etc/ibdiag.conf     |    3 +++
> >  src/ibdiag_common.c |    3 +++
> >  2 files changed, 6 insertions(+)
> > 
> > diff --git a/etc/ibdiag.conf b/etc/ibdiag.conf
> > index 2a2334f..9686d14 100644
> > --- a/etc/ibdiag.conf
> > +++ b/etc/ibdiag.conf
> > @@ -17,3 +17,6 @@
> >  
> >  # define a default m_key
> >  #m_key=0x00
> > +
> > +# default smkey to be used for SA requests
> > +#sa_key=0x00
> 
> I think we're in for support questions here mostly around MCMemberRecord :-(
> 
> If this is to be done, at a minimum, the change in admin expectation
> needs to be clearly documented in the infiniband-diags release notes.
> I'm not sure that's sufficient to have it noticed.
> 

I will.  Also I have added the following patch to document the default better.

Ira


infiniband-diags: saquery clarify default smkey option value

Signed-off-by: Ira Weiny <weiny2-i2BcT+NCU+M@public.gmane.org>
---
 doc/rst/saquery.8.in.rst |    5 ++++-
 src/saquery.c            |    4 +++-
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/doc/rst/saquery.8.in.rst b/doc/rst/saquery.8.in.rst
index 79c8bd3..1a11965 100644
--- a/doc/rst/saquery.8.in.rst
+++ b/doc/rst/saquery.8.in.rst
@@ -82,7 +82,10 @@ OPTIONS
 **--smkey <val>**
         use SM_Key value for the query. Will be used only with "trusted"
         queries.  If non-numeric value (like 'x') is specified then saquery
-        will prompt for a value.
+	will prompt for a value.
+	Default (when not specified here or in
+	@IBDIAG_CONFIG_PATH@/ibdiag.conf) is to use SM_Key == 0 (or
+	\"untrusted\")
 
 .. include:: common/opt_K.rst
 
diff --git a/src/saquery.c b/src/saquery.c
index 5f535fc..6e09374 100644
--- a/src/saquery.c
+++ b/src/saquery.c
@@ -1571,7 +1571,9 @@ int main(int argc, char **argv)
 		{"smkey", 4, 1, "<val>",
 		 "SA SM_Key value for the query."
 		 " If non-numeric value (like 'x') is specified then"
-		 " saquery will prompt for a value"},
+		 " saquery will prompt for a value. "
+		 " Default (when not specified here or in ibdiag.conf) is to "
+		 " use SM_Key == 0 (or \"untrusted\")"},
 		{"slid", 5, 1, "<lid>", "Source LID (PathRecord)"},
 		{"dlid", 6, 1, "<lid>", "Destination LID (PathRecord)"},
 		{"mlid", 7, 1, "<lid>", "Multicast LID (MCMemberRecord)"},
-- 
1.7.1

--
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] 32+ messages in thread

* Re: [PATCH V3.1 8/8] infiniband-diags: Add sa_smkey option to config file
       [not found]                     ` <20120531152515.410a999a.weiny2-i2BcT+NCU+M@public.gmane.org>
@ 2012-05-31 23:30                       ` Hal Rosenstock
       [not found]                         ` <4FC7FF07.6090207-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
  0 siblings, 1 reply; 32+ messages in thread
From: Hal Rosenstock @ 2012-05-31 23:30 UTC (permalink / raw)
  To: Ira Weiny; +Cc: Jim Foraker, linux-rdma-u79uwXL29TY76Z2rM5mHXA

On 5/31/2012 6:25 PM, Ira Weiny wrote:
> On Thu, 31 May 2012 07:56:17 -0400
> Hal Rosenstock <hal-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org> wrote:
> 
>> On 5/30/2012 6:15 PM, Jim Foraker wrote:
>>> Defines a default for the smkey used in SA requests
>>>
>>> Signed-off-by: Jim Foraker <foraker1-i2BcT+NCU+M@public.gmane.org>
>>> ---
>>>  etc/ibdiag.conf     |    3 +++
>>>  src/ibdiag_common.c |    3 +++
>>>  2 files changed, 6 insertions(+)
>>>
>>> diff --git a/etc/ibdiag.conf b/etc/ibdiag.conf
>>> index 2a2334f..9686d14 100644
>>> --- a/etc/ibdiag.conf
>>> +++ b/etc/ibdiag.conf
>>> @@ -17,3 +17,6 @@
>>>  
>>>  # define a default m_key
>>>  #m_key=0x00
>>> +
>>> +# default smkey to be used for SA requests
>>> +#sa_key=0x00
>>
>> I think we're in for support questions here mostly around MCMemberRecord :-(
>>
>> If this is to be done, at a minimum, the change in admin expectation
>> needs to be clearly documented in the infiniband-diags release notes.
>> I'm not sure that's sufficient to have it noticed.
>>
> 
> I will.  Also I have added the following patch to document the default better.

I meant the difference in the default behavior due to sakey now being 0
in saquery. Before with OpenSM and the old saquery, one got all members
of a multicast group whereas now with the new saquery one gets only one
group member unless trust is configured.

-- Hal

> 
> Ira
> 
> 
> infiniband-diags: saquery clarify default smkey option value
> 
> Signed-off-by: Ira Weiny <weiny2-i2BcT+NCU+M@public.gmane.org>
> ---
>  doc/rst/saquery.8.in.rst |    5 ++++-
>  src/saquery.c            |    4 +++-
>  2 files changed, 7 insertions(+), 2 deletions(-)
> 
> diff --git a/doc/rst/saquery.8.in.rst b/doc/rst/saquery.8.in.rst
> index 79c8bd3..1a11965 100644
> --- a/doc/rst/saquery.8.in.rst
> +++ b/doc/rst/saquery.8.in.rst
> @@ -82,7 +82,10 @@ OPTIONS
>  **--smkey <val>**
>          use SM_Key value for the query. Will be used only with "trusted"
>          queries.  If non-numeric value (like 'x') is specified then saquery
> -        will prompt for a value.
> +	will prompt for a value.
> +	Default (when not specified here or in
> +	@IBDIAG_CONFIG_PATH@/ibdiag.conf) is to use SM_Key == 0 (or
> +	\"untrusted\")
>  
>  .. include:: common/opt_K.rst
>  
> diff --git a/src/saquery.c b/src/saquery.c
> index 5f535fc..6e09374 100644
> --- a/src/saquery.c
> +++ b/src/saquery.c
> @@ -1571,7 +1571,9 @@ int main(int argc, char **argv)
>  		{"smkey", 4, 1, "<val>",
>  		 "SA SM_Key value for the query."
>  		 " If non-numeric value (like 'x') is specified then"
> -		 " saquery will prompt for a value"},
> +		 " saquery will prompt for a value. "
> +		 " Default (when not specified here or in ibdiag.conf) is to "
> +		 " use SM_Key == 0 (or \"untrusted\")"},
>  		{"slid", 5, 1, "<lid>", "Source LID (PathRecord)"},
>  		{"dlid", 6, 1, "<lid>", "Destination LID (PathRecord)"},
>  		{"mlid", 7, 1, "<lid>", "Multicast LID (MCMemberRecord)"},

--
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] 32+ messages in thread

* Re: [PATCH V3.1 8/8] infiniband-diags: Add sa_smkey option to config file
       [not found]                         ` <4FC7FF07.6090207-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
@ 2012-05-31 23:54                           ` Ira Weiny
  0 siblings, 0 replies; 32+ messages in thread
From: Ira Weiny @ 2012-05-31 23:54 UTC (permalink / raw)
  To: Hal Rosenstock; +Cc: Jim Foraker, linux-rdma-u79uwXL29TY76Z2rM5mHXA

On Thu, 31 May 2012 19:30:15 -0400
Hal Rosenstock <hal-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org> wrote:

> On 5/31/2012 6:25 PM, Ira Weiny wrote:
> > On Thu, 31 May 2012 07:56:17 -0400
> > Hal Rosenstock <hal-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org> wrote:
> > 
> >> On 5/30/2012 6:15 PM, Jim Foraker wrote:
> >>> Defines a default for the smkey used in SA requests
> >>>
> >>> Signed-off-by: Jim Foraker <foraker1-i2BcT+NCU+M@public.gmane.org>
> >>> ---
> >>>  etc/ibdiag.conf     |    3 +++
> >>>  src/ibdiag_common.c |    3 +++
> >>>  2 files changed, 6 insertions(+)
> >>>
> >>> diff --git a/etc/ibdiag.conf b/etc/ibdiag.conf
> >>> index 2a2334f..9686d14 100644
> >>> --- a/etc/ibdiag.conf
> >>> +++ b/etc/ibdiag.conf
> >>> @@ -17,3 +17,6 @@
> >>>  
> >>>  # define a default m_key
> >>>  #m_key=0x00
> >>> +
> >>> +# default smkey to be used for SA requests
> >>> +#sa_key=0x00
> >>
> >> I think we're in for support questions here mostly around MCMemberRecord :-(
> >>
> >> If this is to be done, at a minimum, the change in admin expectation
> >> needs to be clearly documented in the infiniband-diags release notes.
> >> I'm not sure that's sufficient to have it noticed.
> >>
> > 
> > I will.  Also I have added the following patch to document the default better.
> 
> I meant the difference in the default behavior due to sakey now being 0
> in saquery. Before with OpenSM and the old saquery, one got all members
> of a multicast group whereas now with the new saquery one gets only one
> group member unless trust is configured.

Yes, I planned to mention the differences in the release notes.

As for the tool itself, I thought this patch was necessary to make it clear what the default was.  While it is painful that one will have to read the specification to see what is included with an "untrusted" request, I felt it was too much to try and document that fully.

Ira

> 
> -- Hal
> 
> > 
> > Ira
> > 
> > 
> > infiniband-diags: saquery clarify default smkey option value
> > 
> > Signed-off-by: Ira Weiny <weiny2-i2BcT+NCU+M@public.gmane.org>
> > ---
> >  doc/rst/saquery.8.in.rst |    5 ++++-
> >  src/saquery.c            |    4 +++-
> >  2 files changed, 7 insertions(+), 2 deletions(-)
> > 
> > diff --git a/doc/rst/saquery.8.in.rst b/doc/rst/saquery.8.in.rst
> > index 79c8bd3..1a11965 100644
> > --- a/doc/rst/saquery.8.in.rst
> > +++ b/doc/rst/saquery.8.in.rst
> > @@ -82,7 +82,10 @@ OPTIONS
> >  **--smkey <val>**
> >          use SM_Key value for the query. Will be used only with "trusted"
> >          queries.  If non-numeric value (like 'x') is specified then saquery
> > -        will prompt for a value.
> > +	will prompt for a value.
> > +	Default (when not specified here or in
> > +	@IBDIAG_CONFIG_PATH@/ibdiag.conf) is to use SM_Key == 0 (or
> > +	\"untrusted\")
> >  
> >  .. include:: common/opt_K.rst
> >  
> > diff --git a/src/saquery.c b/src/saquery.c
> > index 5f535fc..6e09374 100644
> > --- a/src/saquery.c
> > +++ b/src/saquery.c
> > @@ -1571,7 +1571,9 @@ int main(int argc, char **argv)
> >  		{"smkey", 4, 1, "<val>",
> >  		 "SA SM_Key value for the query."
> >  		 " If non-numeric value (like 'x') is specified then"
> > -		 " saquery will prompt for a value"},
> > +		 " saquery will prompt for a value. "
> > +		 " Default (when not specified here or in ibdiag.conf) is to "
> > +		 " use SM_Key == 0 (or \"untrusted\")"},
> >  		{"slid", 5, 1, "<lid>", "Source LID (PathRecord)"},
> >  		{"dlid", 6, 1, "<lid>", "Destination LID (PathRecord)"},
> >  		{"mlid", 7, 1, "<lid>", "Multicast LID (MCMemberRecord)"},
> 


-- 
Ira Weiny
Member of Technical Staff
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] 32+ messages in thread

end of thread, other threads:[~2012-05-31 23:54 UTC | newest]

Thread overview: 32+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-05-30 17:20 [PATCH v3 0/8] Mkey support in infiniband-diags Jim Foraker
     [not found] ` <1338398414.11948.29.camel-mxTxeWJot8FliZ7u+bvwcg@public.gmane.org>
2012-05-30 17:21   ` [PATCH V3 1/8] infiniband-diags: Obfuscate sensitive output by default Jim Foraker
     [not found]     ` <1338398497-12444-1-git-send-email-foraker1-i2BcT+NCU+M@public.gmane.org>
2012-05-30 17:21       ` [PATCH V3 2/8] infiniband-diags: install config file mode 400 Jim Foraker
     [not found]         ` <1338398497-12444-2-git-send-email-foraker1-i2BcT+NCU+M@public.gmane.org>
2012-05-31 22:15           ` Ira Weiny
2012-05-30 17:21       ` [PATCH V3 3/8] infiniband-diags/ibportstate.c: Display MKey, lease, and protect bits Jim Foraker
     [not found]         ` <1338398497-12444-3-git-send-email-foraker1-i2BcT+NCU+M@public.gmane.org>
2012-05-31 22:16           ` Ira Weiny
2012-05-30 17:21       ` [PATCH V3 4/8] infiniband-diags: Allow specification of an mkey to use on the command line Jim Foraker
     [not found]         ` <1338398497-12444-4-git-send-email-foraker1-i2BcT+NCU+M@public.gmane.org>
2012-05-31 11:48           ` Hal Rosenstock
     [not found]             ` <4FC75A97.7080106-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
2012-05-31 15:18               ` Ira Weiny
2012-05-31 19:08               ` Jim Foraker
     [not found]                 ` <1338491297.19133.30.camel-mxTxeWJot8FliZ7u+bvwcg@public.gmane.org>
2012-05-31 19:11                   ` [PATCH V3.1 " Jim Foraker
     [not found]                     ` <1338491493-19714-1-git-send-email-foraker1-i2BcT+NCU+M@public.gmane.org>
2012-05-31 22:17                       ` Ira Weiny
2012-05-30 17:21       ` [PATCH V3 5/8] infiniband-diags/ibportstate.c: Support changing MKey, lease, and protect bits Jim Foraker
     [not found]         ` <1338398497-12444-5-git-send-email-foraker1-i2BcT+NCU+M@public.gmane.org>
2012-05-31 22:21           ` Ira Weiny
2012-05-30 17:21       ` [PATCH V3 6/8] infiniband-diags: Add m_key option to config file Jim Foraker
     [not found]         ` <1338398497-12444-6-git-send-email-foraker1-i2BcT+NCU+M@public.gmane.org>
2012-05-31 22:22           ` Ira Weiny
2012-05-30 17:21       ` [PATCH V3 7/8] ib-diags/saquery: Fix smkey handling Jim Foraker
     [not found]         ` <1338398497-12444-7-git-send-email-foraker1-i2BcT+NCU+M@public.gmane.org>
2012-05-30 22:14           ` [PATCH V3.1 " Jim Foraker
     [not found]             ` <1338416060-14025-1-git-send-email-foraker1-i2BcT+NCU+M@public.gmane.org>
2012-05-31 22:23               ` Ira Weiny
2012-05-30 17:21       ` [PATCH V3 8/8] infiniband-diags: Add sa_smkey option to config file Jim Foraker
     [not found]         ` <1338398497-12444-8-git-send-email-foraker1-i2BcT+NCU+M@public.gmane.org>
2012-05-30 18:06           ` Hal Rosenstock
     [not found]             ` <4FC66196.5030704-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
2012-05-30 18:43               ` Jim Foraker
     [not found]                 ` <1338403407.17237.860.camel-mxTxeWJot8FliZ7u+bvwcg@public.gmane.org>
2012-05-30 22:17                   ` Jim Foraker
2012-05-30 22:15           ` [PATCH V3.1 " Jim Foraker
     [not found]             ` <1338416114-14068-1-git-send-email-foraker1-i2BcT+NCU+M@public.gmane.org>
2012-05-31 11:56               ` Hal Rosenstock
     [not found]                 ` <4FC75C61.7060408-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
2012-05-31 22:25                   ` Ira Weiny
     [not found]                     ` <20120531152515.410a999a.weiny2-i2BcT+NCU+M@public.gmane.org>
2012-05-31 23:30                       ` Hal Rosenstock
     [not found]                         ` <4FC7FF07.6090207-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
2012-05-31 23:54                           ` Ira Weiny
2012-05-31 22:23               ` Ira Weiny
2012-05-31 11:48       ` [PATCH V3 1/8] infiniband-diags: Obfuscate sensitive output by default Hal Rosenstock
     [not found]         ` <4FC75A8D.4080305-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
2012-05-31 15:10           ` Ira Weiny
2012-05-31 22:15       ` Ira Weiny

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox