[openib-general] [PATCH] osmtest: Add test for non base LID SA PortInfoRecord request when LMC > 0

Hal Rosenstock halr at voltaire.com
Tue Jun 13 09:38:33 PDT 2006


osmtest: Add test for non base LID SA PortInfoRecord request when LMC >
0

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

Index: osmtest/osmtest.c
===================================================================
--- osmtest/osmtest.c	(revision 7961)
+++ osmtest/osmtest.c	(working copy)
@@ -1613,6 +1613,7 @@ osmtest_stress_port_recs_small( IN osmte
  **********************************************************************/
 ib_api_status_t
 osmtest_get_local_port_lmc( IN osmtest_t * const p_osmt,
+                            IN ib_net16_t  lid,
                             OUT uint8_t *  const p_lmc )
 {
   osmtest_req_context_t context;
@@ -1629,7 +1630,7 @@ osmtest_get_local_port_lmc( IN osmtest_t
    * Do a blocking query for our own PortRecord in the subnet.
    */
   status = osmtest_get_port_rec( p_osmt,
-                                 cl_ntoh16(p_osmt->local_port.lid),
+                                 cl_ntoh16( lid ),
                                  &context );
 
   if( status != IB_SUCCESS )
@@ -3181,7 +3182,7 @@ osmtest_validate_path_data( IN osmtest_t
              cl_ntoh16( p_rec->slid ), cl_ntoh16( p_rec->dlid ) );
   }
 
-  status = osmtest_get_local_port_lmc( p_osmt, &lmc );
+  status = osmtest_get_local_port_lmc( p_osmt, p_osmt->local_port.lid, &lmc );
 
   /* HACK: Assume uniform LMC across endports in the subnet */ 
   /* In absence of this assumption, validation of this is much more complicated */
@@ -4885,10 +4886,13 @@ static ib_api_status_t
 osmtest_validate_against_db( IN osmtest_t * const p_osmt )
 {
   ib_api_status_t status = IB_SUCCESS;
-#if defined (VENDOR_RMPP_SUPPORT) && defined (DUAL_SIDED_RMPP)
+#ifdef VENDOR_RMPP_SUPPORT
+  uint8_t lmc;
+#ifdef DUAL_SIDED_RMPP
   osmtest_req_context_t context;
   osmv_multipath_req_t request;
 #endif
+#endif
 
   OSM_LOG_ENTER( &p_osmt->log, osmtest_validate_against_db );
 
@@ -4999,6 +5003,18 @@ osmtest_validate_against_db( IN osmtest_
   if( status != IB_SUCCESS )
     goto Exit;
 
+  /* If LMC > 0, test non base LID SA PortInfoRecord request */
+  status = osmtest_get_local_port_lmc( p_osmt, p_osmt->local_port.lid, &lmc );
+  if ( status != IB_SUCCESS )
+    goto Exit;
+
+  if (lmc != 0)
+  {
+    status = osmtest_get_local_port_lmc( p_osmt, p_osmt->local_port.lid + 1, NULL);
+    if ( status != IB_SUCCESS )
+      goto Exit;
+  }
+
   if (! p_osmt->opt.ignore_path_records)
   {
     status = osmtest_validate_all_path_recs( p_osmt );







More information about the general mailing list