Skip to contentSkip to conversation

infiniband-diags/saquery: Add GUIDInfoRecord support

PATCH Applied Hal Rosenstock 2 participants 2 messages Mar 25, 2011 – Mar 28, 2011 1 message not in the archive InfiniBand

v1 of 3 Applied Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH 3/3 infiniband-diags/saquery: Add GUIDInfoRecord support

---
 infiniband-diags/man/saquery.8 |    3 +-
 infiniband-diags/src/saquery.c |   48 
+++++++++++++++++++++++++++++++++++++++-
 2 files changed, 49 insertions(+), 2 deletions(-)
infiniband-diags/man/saquery.8 +2 -1
index b2b9d91..4a3102d 100644
@@ -1,4 +1,4 @@
-.TH SAQUERY 8 "October 19, 2008" "OpenIB" "OpenIB Diagnostics"
+.TH SAQUERY 8 "March 28, 2010" "OpenIB" "OpenIB Diagnostics"
 
 .SH NAME
 saquery \- query InfiniBand subnet administration attributes
@@ -117,6 +117,7 @@ Supported query names (and aliases):
  MCMemberRecord (MCMR)
  LFTRecord (LFTR) [[lid]/[block]]
  MFTRecord (MFTR) [[mlid]/[position]/[block]]
+ GUIDInfoRecord (GIR) [[lid]/[block]]
 .TP
 \fB\-d\fR
 enable debugging
infiniband-diags/src/saquery.c +25 -0
index cb4fc18..490f6d2 100644
@@ -781,6 +781,31 @@ static void dump_one_lft_record(void *data)
     printf("\n");
 }
 
+static void dump_one_guidinfo_record(void *data)
+{
+    ib_guidinfo_record_t *gir = data;
+    printf("GUIDInfo Record dump:\n"
+           "\t\tLID........................%u\n"
+           "\t\tBlock......................%u\n"
+           "\t\tGUID 0.....................0x%016" PRIx64 "\n"
+           "\t\tGUID 1.....................0x%016" PRIx64 "\n"
+           "\t\tGUID 2.....................0x%016" PRIx64 "\n"
+           "\t\tGUID 3.....................0x%016" PRIx64 "\n"
+           "\t\tGUID 4.....................0x%016" PRIx64 "\n"
+           "\t\tGUID 5.....................0x%016" PRIx64 "\n"
+           "\t\tGUID 6.....................0x%016" PRIx64 "\n"
+           "\t\tGUID 7.....................0x%016" PRIx64 "\n",
+           cl_ntoh16(gir->lid), gir->block_num,
+           cl_ntoh64(gir->guid_info.guid[0]),
+           cl_ntoh64(gir->guid_info.guid[1]),
+           cl_ntoh64(gir->guid_info.guid[2]),
+           cl_ntoh64(gir->guid_info.guid[3]),
+           cl_ntoh64(gir->guid_info.guid[4]),
+           cl_ntoh64(gir->guid_info.guid[5]),
+           cl_ntoh64(gir->guid_info.guid[6]),
+           cl_ntoh64(gir->guid_info.guid[7]));
+}
+
 static void dump_one_mft_record(void *data)
 {
     ib_mft_record_t *mftr = data;
@@ -1339,6 +1364,25 @@ static int query_lft_records(const struct query_cmd *q, bind_handle_t h,

&lftr, 0, dump_one_lft_record);
}

+static int query_guidinfo_records(const struct query_cmd *q, bind_handle_t h,
+ struct query_params *p, int argc, char *argv[])
+{

+    ib_guidinfo_record_t gir;
+    ib_net64_t comp_mask = 0;
+    int lid = 0, block = -1;

+
+ if (argc > 0)
+ parse_lid_and_ports(h, argv[0], &lid, &block, NULL);
+

+    memset(&gir, 0, sizeof(gir));
+    CHECK_AND_SET_VAL(lid, 16, 0, gir.lid, GIR, LID);
+    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,
+ dump_one_guidinfo_record);
+}
+
static int query_mft_records(const struct query_cmd *q, bind_handle_t h,

                  struct query_params *p, int argc, char *argv[])
 {
@@ -1419,6 +1463,8 @@ static const struct query_cmd query_cmds[] = {
      "[[lid]/[block]]", query_lft_records},
     {"MFTRecord", "MFTR", IB_SA_ATTR_MFTRECORD,
      "[[mlid]/[position]/[block]]", query_mft_records},
+    {"GUIDInfoRecord", "GIR", IB_SA_ATTR_GUIDINFORECORD,
+     "[[lid]/[block]]", query_guidinfo_records},
     {0}

};

Signature · 6 lines
1.5.3

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Applied
#2 lore raw
In reply to a message not in the archive
Quoted 7 lines · On Fri, 25 Mar 2011 12:23:31 -0700 Hal Rosenstock…
---
  infiniband-diags/man/saquery.8 |    3 +-
  infiniband-diags/src/saquery.c |   48 
+++++++++++++++++++++++++++++++++++++++-
  2 files changed, 49 insertions(+), 2 deletions(-)

Thanks, applied,
Ira

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