Skip to contentSkip to conversation

osmtest: Add grh test

PATCH New Hal Rosenstock 1 participant 1 message Jun 17, 2014 InfiniBand

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 osmtest: Add grh test

From: Dan Ben Yosef <danby-VPRAkNaXOzVWk0Htik3J/[email protected]>

Add GRH to all SA queries that osmtest sends.
Note: All SA queries except GetMulti MultiPathRecord query.

---
 include/vendor/osm_vendor_sa_api.h |    8 ++
 libvendor/osm_vendor_ibumad_sa.c   |   14 +++
 osmtest/include/osmtest.h          |    2 +
 osmtest/main.c                     |    9 ++-
 osmtest/osmtest.c                  |  157 ++++++++++++++++++++++++++++++++++++
 5 files changed, 189 insertions(+), 1 deletions(-)
include/vendor/osm_vendor_sa_api.h +8 -0
index 336251a..a5ecd24 100644
@@ -740,6 +740,8 @@ typedef struct _osmv_query_req {
 
 	const void *query_context;
 	osmv_pfn_query_cb_t pfn_query_cb;
+	int with_grh;
+	ib_gid_t gid;
 } osmv_query_req_t;
 /*
 * FIELDS
@@ -777,6 +779,12 @@ typedef struct _osmv_query_req {
 *		A user-defined callback that is invoked upon completion of the
 *		query.
 *
+*	with_grh
+*		Indicates that all sa queries need to sent with GRH.
+*
+*	gid
+*		Used to store the SM/SA gid.
+*
 * NOTES
 *	This structure is used when requesting an osm vendor provided query
 *	of subnet administration.  Clients specify the type of query through
libvendor/osm_vendor_ibumad_sa.c +14 -0
index e51a40f..58dc5a8 100644
@@ -417,6 +417,20 @@ __osmv_send_sa_req(IN osmv_sa_bind_info_t * p_bind,
 	p_madw->fail_msg = CL_DISP_MSGID_NONE;
 
 	/*
+	   add grh
+	 */
+	if (p_query_req->with_grh) {
+		OSM_LOG(p_log, OSM_LOG_DEBUG, "sending sa query with GRH "
+			"GID : 0x%016" PRIx64 " 0x%016" PRIx64 "\n",
+			p_query_req->gid.unicast.prefix,
+			p_query_req->gid.unicast.interface_id);
+		p_madw->mad_addr.addr_type.gsi.global_route = 1;
+		memset(&p_madw->mad_addr.addr_type.gsi.grh_info, 0,
+		       sizeof(p_madw->mad_addr.addr_type.gsi.grh_info));
+		memcpy(&p_madw->mad_addr.addr_type.gsi.grh_info.dest_gid, &(p_query_req->gid), 16);
+	}
+
+	/*
 	   Provide MAD context such that the call back will know what to do.
 	   We have to keep the entire request structure so we know the CB.
 	   Since we can not rely on the client to keep it around until
osmtest/include/osmtest.h +2 -0
index f63ea74..f66d3a8 100644
@@ -78,6 +78,7 @@ typedef struct _osmtest_opt {
 	uint32_t transaction_timeout;
 	boolean_t force_log_flush;
 	boolean_t create;
+	boolean_t with_grh;
 	uint32_t retry_count;
 	uint32_t stress;
 	uint32_t mmode;
@@ -129,6 +130,7 @@ typedef struct _osmtest {
 	osmtest_opt_t opt;
 	ib_port_attr_t local_port;
 	ib_gid_t local_port_gid;
+	ib_gid_t sm_port_gid;
 	subnet_t exp_subn;
 	cl_qpool_t node_pool;
 	cl_qpool_t port_pool;
osmtest/main.c +8 -1
index 6129674..006708d 100644
@@ -145,6 +145,10 @@ void show_usage()
 	       "          -s3  - Multi-MAD (RMPP) Path Record SA queries\n"
 	       "          -s4  - Single-MAD (non RMPP) get Path Record SA queries\n"
 	       "          Without -s, stress testing is not performed\n\n");
+	printf("-G\n"
+	       "--grh\n"
+	       "          sends all sa queries with grh with exception of\n"
+	       "	  GetMulti for MultiPathRecord\n\n");
 	printf("-M\n"
 	       "--Multicast_Mode\n"
 	       "          This option specify length of Multicast test:\n"
@@ -297,6 +301,7 @@ int main(int argc, char *argv[])
 		{"port", 0, NULL, 'p'},
 		{"help", 0, NULL, 'h'},
 		{"stress", 1, NULL, 's'},
+		{"grh", 0, NULL, 'G'},
 		{"Multicast_Mode", 1, NULL, 'M'},
 		{"timeout", 1, NULL, 't'},
 		{"verbose", 0, NULL, 'v'},
@@ -558,7 +563,9 @@ int main(int argc, char *argv[])
 			    ("\t\t\t\tVerbose option -vf (log flags = 0x%X)\n",
 			     log_flags);
 			break;
-
+		case 'G':
+			opt.with_grh = TRUE;
+			break;
 		case -1:
 			printf("Done with args\n");
 			break;
osmtest/osmtest.c +157 -0

295 lines not on this page · raw message

Signature · 6 lines
1.7.8.2

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