[openib-general] [PATCH] osmtest/osmtest.c: Exercise SA PathRecord multicast destination code

Hal Rosenstock halr at voltaire.com
Tue Jul 18 12:52:37 PDT 2006


osmtest/osmtest.c: Exercise SA PathRecord multicast destination code

Signed-off-by: Hal Rosenstock <halr at voltaire.com>

Index: osmtest/osmtest.c
===================================================================
--- osmtest/osmtest.c	(revision 8575)
+++ osmtest/osmtest.c	(working copy)
@@ -1006,6 +1006,78 @@ osmtest_get_path_rec_by_guid_pair( IN os
   return ( status );
 }
 
+/**********************************************************************
+ **********************************************************************/
+static ib_api_status_t
+osmtest_get_path_rec_by_gid_pair( IN osmtest_t * const p_osmt,
+                                  IN ib_gid_t sgid,
+                                  IN ib_gid_t dgid,
+                                  IN osmtest_req_context_t *p_context)
+{
+  cl_status_t status = IB_SUCCESS;
+  osmv_query_req_t req;
+  osmv_gid_pair_t gid_pair;
+
+  OSM_LOG_ENTER( &p_osmt->log,  osmtest_get_path_rec_by_gid_pair);
+
+  memset( p_context, 0, sizeof( *p_context ) );
+
+  p_context->p_osmt = p_osmt;
+  req.timeout_ms = p_osmt->opt.transaction_timeout;
+  req.retry_cnt = p_osmt->opt.retry_count;
+  req.flags = OSM_SA_FLAGS_SYNC;
+  req.query_context = p_context;
+  req.pfn_query_cb = osmtest_query_res_cb;
+
+  req.query_type = OSMV_QUERY_PATH_REC_BY_GIDS;
+
+  gid_pair.dest_gid = dgid;
+  gid_pair.src_gid = sgid;
+
+  req.p_query_input = &gid_pair;
+  req.sm_key = 0;
+
+  osm_log( &p_osmt->log, OSM_LOG_VERBOSE,
+           "osmtest_get_path_rec_by_gid_pair: "
+           "Query for path from 0x%016" PRIx64 " 0x%016" PRIx64 " to 0x%016" PRIx64 " 0x%016" PRIx64"\n",
+           sgid.unicast.prefix, sgid.unicast.interface_id,
+           dgid.unicast.prefix, dgid.unicast.interface_id );
+
+  status = osmv_query_sa( p_osmt->h_bind, &req );
+  if( status != IB_SUCCESS )
+  {
+    osm_log( &p_osmt->log, OSM_LOG_ERROR,
+             "osmtest_get_path_rec_by_gid_pair: ERR 006A: "
+             "ib_query failed (%s)\n", ib_get_err_str( status ) );
+    goto Exit;
+  }
+
+  status = (*p_context).result.status;
+
+
+  if( status != IB_SUCCESS )
+  {
+    osm_log( &p_osmt->log, OSM_LOG_ERROR,
+             "osmtest_get_path_rec_by_gid_pair: ERR 006B: "
+             "ib_query failed (%s)\n", ib_get_err_str( status ) );
+
+    if( status == IB_REMOTE_ERROR )
+    {
+      osm_log( &p_osmt->log, OSM_LOG_ERROR,
+               "osmtest_get_path_rec_by_gid_pair: "
+               "Remote error = %s\n",
+               ib_get_mad_status_str( osm_madw_get_mad_ptr
+                                      ( (*p_context).result.p_result_madw ) ) );
+    }
+    goto Exit;
+  }
+
+ Exit:
+
+  OSM_LOG_EXIT( &p_osmt->log );
+  return ( status );
+}
+
 #if defined (VENDOR_RMPP_SUPPORT) && defined (DUAL_SIDED_RMPP)
 /**********************************************************************
  **********************************************************************/
@@ -5326,6 +5398,7 @@ static ib_api_status_t
 osmtest_validate_against_db( IN osmtest_t * const p_osmt )
 {
   ib_api_status_t status = IB_SUCCESS;
+  ib_gid_t portgid, mgid;
 #ifdef VENDOR_RMPP_SUPPORT
   ib_net64_t sm_key;
   ib_net16_t test_lid;
@@ -5348,6 +5421,15 @@ osmtest_validate_against_db( IN osmtest_
   if( status != IB_SUCCESS )
     goto Exit;
 
+  /* Exercise SA PathRecord multicast destination code */
+  memset( &context, 0, sizeof( context ) );
+  ib_gid_set_default( &portgid, portguid );
+  /* Set IPoIB broadcast MGID */
+  mgid.unicast.prefix = CL_HTON64(0xff12401bffff0000ULL);
+  mgid.unicast.interface_id = CL_HTON64(0x00000000ffffffffULL);
+  /* Can't check status as don't know whether port is running IPoIB */
+  osmtest_get_path_rec_by_gid_pair( p_osmt, portgid, mgid, &context);
+
 #if defined (VENDOR_RMPP_SUPPORT) && defined (DUAL_SIDED_RMPP)
   memset( &context, 0, sizeof( context ) );
   memset( &request, 0, sizeof( request ) );







More information about the general mailing list