Skip to contentSkip to conversation

saquery: Add SMInfoRecord support

PATCH Applied Hal Rosenstock 2 participants 2 messages Jun 22, 2013 – Jul 5, 2013 1 message not in the archive InfiniBand

lore
Share & tools
lore
#0 lore raw

PATCH v3 1/1 saquery: Add SMInfoRecord support

This patch is the combination of 2 patches:
infiniband_diags/src/saquery.c: Add SMInfoRecord support infiniband_diags/doc/rst/saquery.8.in.rst: Add support to the manual

---
This patch is based on Husam's previous patch for this.

doc/rst/saquery.8.in.rst +1 -0
index 8d87096..0551917 100644
@@ -156,6 +156,7 @@ Supported query names (and aliases):
         MFTRecord (MFTR) [[mlid]/[position]/[block]]
         GUIDInfoRecord (GIR) [[lid]/[block]]
         SwitchInfoRecord (SWIR) [lid]
+        SMInfoRecord (SMIR) [lid]
 
 
 
src/saquery.c +45 -0

63 lines not on this page · raw message

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

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

Applied
#2 lore raw
Quoted 11 lines

-----Original Message-----
From: [email protected] [mailto:linux-rdma-
Subject: [PATCHv3 infiniband-diags] saquery: Add SMInfoRecord support

This patch is the combination of 2 patches:
infiniband_diags/src/saquery.c: Add SMInfoRecord support infiniband_diags/doc/rst/saquery.8.in.rst: Add support to the manual

Thanks Applied after rebase'ing against current master branch.

Ira

Quoted 87 lines

---
This patch is based on Husam's previous patch for this.

doc/rst/saquery.8.in.rst index renamed from doc/rst/saquery.8.in.rst +0 -0

8d87096..0551917 100644

doc/rst/saquery.8.in.rst +1 -0
@@ -156,6 +156,7 @@ Supported query names (and aliases):
         MFTRecord (MFTR) [[mlid]/[position]/[block]]
         GUIDInfoRecord (GIR) [[lid]/[block]]
         SwitchInfoRecord (SWIR) [lid]
+        SMInfoRecord (SMIR) [lid]
 
 
 
src/saquery.c +23 -0
@@ -489,6 +489,30 @@ static void dump_service_record(void *data)
 	       cl_ntoh64(p_sr->service_data64[1]));
 }
 
+static void dump_sm_info_record(void *data) {
+	ib_sminfo_record_t *p_smr = data;
+	const ib_sm_info_t *const p_smi = &p_smr->sm_info;
+	uint8_t priority, state;
+	priority = ib_sminfo_get_priority(p_smi);
+	state = ib_sminfo_get_state(p_smi);
+
+	printf("SMInfoRecord dump:\n"
+	       "\t\tRID\n"
+	       "\t\tLID...................%u\n"
+	       "\t\tSMInfo dump:\n"
+	       "\t\tGUID..................0x%016" PRIx64 "\n"
+	       "\t\tSM_Key................0x%016" PRIx64 "\n"
+	       "\t\tActCount..............%u\n"
+	       "\t\tPriority..............%u\n"
+	       "\t\tSMState...............%u\n",
+	       cl_ntoh16(p_smr->lid),
+	       cl_ntoh64(p_smr->sm_info.guid),
+	       cl_ntoh64(p_smr->sm_info.sm_key),
+	       cl_ntoh32(p_smr->sm_info.act_count),
+	       priority, state);
+}
+
 static void dump_switch_info_record(void *data)  {
 	ib_switch_info_record_t *p_sir = data; @@ -1194,6 +1218,25 @@

static int query_service_records(const struct query_cmd *q, struct sa_handle * h

src/saquery.c +2 -0
 					dump_service_record);
 }
 
+static int query_sm_info_records(const struct query_cmd *q,
+				 struct sa_handle * h, struct query_params

*p,

src/saquery.c +13 -0
+				 int argc, char *argv[])
+{
+	ib_sminfo_record_t smir;
+	ib_net64_t comp_mask = 0;
+	int lid = 0;
+
+	if (argc > 0)
+		parse_lid_and_ports(h, argv[0], &lid, NULL, NULL);
+
+	memset(&smir, 0, sizeof(smir));
+	CHECK_AND_SET_VAL(lid, 16, 0, smir.lid, SMIR, LID);
+
+	return get_and_dump_any_records(h,

IB_SA_ATTR_SMINFORECORD, 0,

src/saquery.c +4 -0
+					comp_mask, &smir, sizeof(smir),
+					dump_sm_info_record);
+}
+
 static int query_switchinfo_records(const struct query_cmd *q,
 				struct sa_handle * h, struct query_params

*p,

src/saquery.c +2 -1
 				int argc, char *argv[])
@@ -1406,6 +1449,8 @@ static const struct query_cmd query_cmds[] = {
 	 "[[lid]/[block]]", query_guidinfo_records},
 	{"SwitchInfoRecord", "SWIR", IB_SA_ATTR_SWITCHINFORECORD,
 	 "[lid]", query_switchinfo_records},
+	{"SMInfoRecord", "SMIR", IB_SA_ATTR_SMINFORECORD,
+	 "[lid]", query_sm_info_records},
 	{0}
 };
 
--
Quoted 3 lines

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

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