[openib-general] [PATCH] osm: reviewing osmtest - osmt_multicast.c

Yevgeny Kliteynik kliteyn at dev.mellanox.co.il
Tue Oct 17 09:07:03 PDT 2006


Hi Hal

Fixing more things in the multicast test flow.
 
Still have things to do in case when multicast group removal
fails, and have to add some cleanup (as we've discussed previously).
--
Yevgeny

Signed-off-by:  Yevgeny Kliteynik <kliteyn at dev.mellanox.co.il>

Index: osmtest/osmt_multicast.c
===================================================================
--- osmtest/osmt_multicast.c	(revision 9856)
+++ osmtest/osmt_multicast.c	(working copy)
@@ -418,6 +418,12 @@ osmt_init_mc_query_rec(IN  osmtest_t * c
  * o15.0.1.16:
  * - Try GetTable with PortGUID wildcarded and get back some groups.
  ***********************************************************************/
+
+/* The following macro can be used only within the osmt_run_mcast_flow() function */
+#define IS_IPOIB_MGID(p_mgid) \
+           ( !memcmp(&osm_ipoib_good_mgid ,   (p_mgid) , sizeof(osm_ipoib_good_mgid)) || \
+             !memcmp(&osm_ts_ipoib_good_mgid ,(p_mgid) , sizeof(osm_ts_ipoib_good_mgid)) )
+
 ib_api_status_t
 osmt_run_mcast_flow( IN osmtest_t * const p_osmt ) {
   ib_api_status_t status;
@@ -433,13 +439,15 @@ osmt_run_mcast_flow( IN osmtest_t * cons
   ib_net16_t max_mlid = cl_hton16(0xFFFE),tmp_mlid;
   boolean_t ReachedMlidLimit = FALSE;
   int start_cnt = 0, cnt, middle_cnt = 0, end_cnt = 0;
-  int IPoIBIsFound = 0, mcg_outside_test_cnt = 0, fail_to_delete_mcg = 0;
+  int start_ipoib_cnt = 0, end_ipoib_cnt = 0;
+  int mcg_outside_test_cnt = 0, fail_to_delete_mcg = 0;
   osmtest_req_context_t context;
   ib_node_record_t *p_rec;
   uint32_t num_recs = 0, i;
   uint8_t mtu_phys = 0, rate_phys = 0;
   cl_map_t test_created_mlids; /* List of all mlids created in this test */
   ib_member_rec_t* p_recvd_rec;
+  boolean_t got_error = FALSE;
 
   static ib_gid_t good_mgid = {
     {
@@ -538,13 +546,19 @@ osmt_run_mcast_flow( IN osmtest_t * cons
   while( p_mgrp != (osmtest_mgrp_t*)cl_qmap_end( p_mgrp_mlid_tbl ) )
   {
     /* search for ipoib mgid */
-    if (!memcmp(&osm_ipoib_good_mgid,&p_mgrp->mcmember_rec.mgid,sizeof(osm_ipoib_good_mgid)) ||
-        !memcmp(&osm_ts_ipoib_good_mgid,&p_mgrp->mcmember_rec.mgid,sizeof(osm_ts_ipoib_good_mgid)))
+    if (IS_IPOIB_MGID(&p_mgrp->mcmember_rec.mgid))
     {
-      IPoIBIsFound = 1;
+      start_ipoib_cnt++;
     }
     else
+    {
+      osm_log( &p_osmt->log, OSM_LOG_INFO,
+               "osmt_run_mcast_flow: "
+               "Non-IPoIB MC Groups exist: mgid=0x%016" PRIx64 ":0x%016" PRIx64 "\n",
+               cl_ntoh64(p_mgrp->mcmember_rec.mgid.unicast.prefix),
+               cl_ntoh64(p_mgrp->mcmember_rec.mgid.unicast.interface_id) );
        mcg_outside_test_cnt++;
+    }
 
     p_mgrp = (osmtest_mgrp_t*)cl_qmap_next( &p_mgrp->map_item );
   }
@@ -553,7 +567,7 @@ osmt_run_mcast_flow( IN osmtest_t * cons
            "osmt_run_mcast_flow: "
            "Found %d non-IPoIB MC Groups\n", mcg_outside_test_cnt);
 
-  if (IPoIBIsFound)
+  if (start_ipoib_cnt)
   {
     /* o15-0.2.4 - Check a join request to already created MCG */
     osm_log( &p_osmt->log, OSM_LOG_INFO,
@@ -576,6 +590,9 @@ osmt_run_mcast_flow( IN osmtest_t * cons
 
     osm_log(&p_osmt->log, OSM_LOG_INFO,
             "osmt_run_mcast_flow: "
+            "Joining to an existing IPoIB multicast group\n");
+    osm_log(&p_osmt->log, OSM_LOG_INFO,
+            "osmt_run_mcast_flow: "
             "Sent Join request with :\n\t\tport_gid=0x%016"PRIx64
             ":0x%016" PRIx64 ", mgid=0x%016" PRIx64 ":0x%016" PRIx64
             "\n\t\tjoin state= 0x%x, response is : %s\n",
@@ -585,6 +602,14 @@ osmt_run_mcast_flow( IN osmtest_t * cons
             cl_ntoh64(mc_req_rec.mgid.unicast.interface_id),
             (mc_req_rec.scope_state & 0x0F),
             ib_get_err_str(status));
+    if (status != IB_SUCCESS)
+    {
+       osm_log( &p_osmt->log, OSM_LOG_ERROR,
+                "osmt_run_mcast_flow : ERR 02B3: "
+                "Failed joining existing IPoIB MCGroup - got %s\n",
+                ib_get_err_str(status));
+       goto Exit;
+    }
     /* Check MTU & Rate Value and resend with SA suggested values */
     p_mc_res = ib_sa_mad_get_payload_ptr(&res_sa_mad);
 
@@ -1473,7 +1498,7 @@ osmt_run_mcast_flow( IN osmtest_t * cons
   {
     osm_log( &p_osmt->log, OSM_LOG_ERROR,
              "osmt_run_mcast_flow: ERR 02A5: "
-             "Failed to create MCG for MGID=0 with higher than minimum RATE\n",
+             "Failed to create MCG for MGID=0 with higher than minimum RATE - got %s/%s\n",
              ib_get_err_str( status ),
              ib_get_mad_status_str( (ib_mad_t*)(&res_sa_mad) )
              );
@@ -1518,7 +1543,7 @@ osmt_run_mcast_flow( IN osmtest_t * cons
   {
     osm_log( &p_osmt->log, OSM_LOG_ERROR,
              "osmt_run_mcast_flow: ERR 0211: "
-             "Failed to create MCG for MGID=0 with less than highest RATE\n",
+             "Failed to create MCG for MGID=0 with less than highest RATE - got %s/%s\n",
              ib_get_err_str( status ),
              ib_get_mad_status_str( (ib_mad_t*)(&res_sa_mad) )
              );
@@ -1562,7 +1587,7 @@ osmt_run_mcast_flow( IN osmtest_t * cons
   {
     osm_log( &p_osmt->log, OSM_LOG_ERROR,
              "osmt_run_mcast_flow: ERR 0238: "
-             "Failed to create MCG for MGID=0 with less than highest MTU\n",
+             "Failed to create MCG for MGID=0 with less than highest MTU - got %s/%s\n",
              ib_get_err_str( status ),
              ib_get_mad_status_str( (ib_mad_t*)(&res_sa_mad) )
              );
@@ -1605,7 +1630,7 @@ osmt_run_mcast_flow( IN osmtest_t * cons
   {
     osm_log( &p_osmt->log, OSM_LOG_ERROR,
              "osmt_run_mcast_flow: ERR 0239: "
-             "Failed to create MCG for MGID=0 with higher than lowest MTU\n",
+             "Failed to create MCG for MGID=0 with higher than lowest MTU - got %s/%s\n",
              ib_get_err_str( status ),
              ib_get_mad_status_str( (ib_mad_t*)(&res_sa_mad) )
              );
@@ -1659,7 +1684,7 @@ osmt_run_mcast_flow( IN osmtest_t * cons
   {
     osm_log( &p_osmt->log, OSM_LOG_ERROR,
              "osmt_run_mcast_flow: ERR 0240: "
-             "Failed to create MCG for MGID=0 with exact MTU & RATE\n",
+             "Failed to create MCG for MGID=0 with exact MTU & RATE - got %s/%s\n",
              ib_get_err_str( status ),
              ib_get_mad_status_str( (ib_mad_t*)(&res_sa_mad) )
              );
@@ -1708,7 +1733,7 @@ osmt_run_mcast_flow( IN osmtest_t * cons
   {
     osm_log( &p_osmt->log, OSM_LOG_ERROR,
              "osmt_run_mcast_flow: ERR 0241: "
-             "Failed to create MCG for MGID=0 with exact RATE\n",
+             "Failed to create MCG for MGID=0 with exact RATE - got %s/%s\n",
              ib_get_err_str( status ),
              ib_get_mad_status_str( (ib_mad_t*)(&res_sa_mad) )
              );
@@ -1757,7 +1782,7 @@ osmt_run_mcast_flow( IN osmtest_t * cons
   {
     osm_log( &p_osmt->log, OSM_LOG_ERROR,
              "osmt_run_mcast_flow: ERR 0242: "
-             "Failed to create MCG for MGID=0 with exact MTU\n",
+             "Failed to create MCG for MGID=0 with exact MTU - got %s/%s\n",
              ib_get_err_str( status ),
              ib_get_mad_status_str( (ib_mad_t*)(&res_sa_mad) )
              );
@@ -1840,7 +1865,7 @@ osmt_run_mcast_flow( IN osmtest_t * cons
   {
     osm_log( &p_osmt->log, OSM_LOG_ERROR,
              "osmt_run_mcast_flow: ERR 0210: "
-             "Failed to create MCG for MGID=0\n",
+             "Failed to create MCG for MGID=0 - got %s/%s\n",
              ib_get_err_str( status ),
              ib_get_mad_status_str( (ib_mad_t*)(&res_sa_mad) )
              );
@@ -1919,11 +1944,11 @@ osmt_run_mcast_flow( IN osmtest_t * cons
     osm_log( &p_osmt->log, OSM_LOG_ERROR,
              "osmt_run_mcast_flow: ERR 0211: "
              "Failed to create MCG for MGID=0x%016" PRIx64 " : "
-             "0x%016" PRIx64 " (o15.0.1.6)...\n",
-             ib_get_err_str( status ),
-             ib_get_mad_status_str( (ib_mad_t*)(&res_sa_mad)),
+             "0x%016" PRIx64 " (o15.0.1.6) - got %s/%s\n",
              cl_ntoh64(good_mgid.unicast.prefix),
-             cl_ntoh64(good_mgid.unicast.interface_id));
+             cl_ntoh64(good_mgid.unicast.interface_id),
+             ib_get_err_str( status ),
+             ib_get_mad_status_str( (ib_mad_t*)(&res_sa_mad)) );
     goto Exit;
   }
 
@@ -1979,7 +2004,7 @@ osmt_run_mcast_flow( IN osmtest_t * cons
       (res_sa_mad.status != IB_SA_MAD_STATUS_REQ_INVALID)) {
     osm_log( &p_osmt->log, OSM_LOG_ERROR,
              "osmt_run_mcast_flow: ERR 0213: "
-             "Failed to recognize MGID error for MGID=0xFA......\n",
+             "Failed to recognize MGID error for MGID=0xFA - got %s/%s\n",
              ib_get_err_str( status ),
              ib_get_mad_status_str( (ib_mad_t*)(&res_sa_mad) )
              );
@@ -1993,13 +2018,12 @@ osmt_run_mcast_flow( IN osmtest_t * cons
            "Checking BAD MGID=0xFF12A01B..... with link-local scope (o15.0.1.6)...\n"
            );
 
-  osm_log( &p_osmt->log, OSM_LOG_ERROR,
-           "osmt_run_mcast_flow: " EXPECTING_ERRORS_START "\n" );
   mc_req_rec.mgid.raw[0] = 0xFF;
   mc_req_rec.mgid.raw[3] = 0x1B;
   comp_mask = comp_mask | IB_MCR_COMPMASK_SCOPE;
   mc_req_rec.scope_state = mc_req_rec.scope_state & 0x2F; /*  local scope */
-
+  osm_log( &p_osmt->log, OSM_LOG_ERROR,
+           "osmt_run_mcast_flow: " EXPECTING_ERRORS_START "\n" );
   status = osmt_send_mcast_request( p_osmt, 1,
                                     &mc_req_rec,
                                     comp_mask,
@@ -2026,14 +2050,12 @@ osmt_run_mcast_flow( IN osmtest_t * cons
            "Checking BAD MGID PREFIX=0xEF... (o15.0.1.6)...\n"
            );
 
-  osm_log( &p_osmt->log, OSM_LOG_ERROR,
-           "osmt_run_mcast_flow: " EXPECTING_ERRORS_START "\n" );
-
-
   mc_req_rec.mgid = good_mgid;
 
   mc_req_rec.mgid.raw[0] = 0xEF;
 
+  osm_log( &p_osmt->log, OSM_LOG_ERROR,
+           "osmt_run_mcast_flow: " EXPECTING_ERRORS_START "\n" );
   status = osmt_send_mcast_request( p_osmt, 1,
                                     &mc_req_rec,
                                     comp_mask,
@@ -2045,7 +2067,7 @@ osmt_run_mcast_flow( IN osmtest_t * cons
       (res_sa_mad.status != IB_SA_MAD_STATUS_REQ_INVALID)) {
     osm_log( &p_osmt->log, OSM_LOG_ERROR,
              "osmt_run_mcast_flow: ERR 0215: "
-             "Failed to recognize MGID PREFIX error for MGID=0xEF....\n",
+             "Failed to recognize MGID PREFIX error for MGID=0xEF - got %s/%s\n",
              ib_get_err_str( status ),
              ib_get_mad_status_str( (ib_mad_t*)(&res_sa_mad) )
              );
@@ -2075,11 +2097,11 @@ osmt_run_mcast_flow( IN osmtest_t * cons
     osm_log( &p_osmt->log, OSM_LOG_ERROR,
              "osmt_run_mcast_flow: ERR 0216: "
              "Failed to create MCG for MGID=0x%016" PRIx64 " : "
-             "0x%016" PRIx64 "\n",
-             ib_get_err_str( status ),
-             ib_get_mad_status_str( (ib_mad_t*)(&res_sa_mad) ),
+             "0x%016" PRIx64 " - got %s/%s\n",
              cl_ntoh64(good_mgid.unicast.prefix),
-             cl_ntoh64(good_mgid.unicast.interface_id));
+             cl_ntoh64(good_mgid.unicast.interface_id),
+             ib_get_err_str( status ),
+             ib_get_mad_status_str( (ib_mad_t*)(&res_sa_mad) ));
     goto Exit;
   }
 
@@ -2121,7 +2143,7 @@ osmt_run_mcast_flow( IN osmtest_t * cons
       (res_sa_mad.status != IB_SA_MAD_STATUS_REQ_INVALID)) {
     osm_log( &p_osmt->log, OSM_LOG_ERROR,
              "osmt_run_mcast_flow: ERR 0217: "
-             "Failed to recognize create with invalid flags value 0x2\n",
+             "Failed to recognize create with invalid flags value 0x2 - got %s/%s\n",
              ib_get_err_str( status ),
              ib_get_mad_status_str( (ib_mad_t*)(&res_sa_mad) )
              );
@@ -2146,7 +2168,7 @@ osmt_run_mcast_flow( IN osmtest_t * cons
   {
     osm_log( &p_osmt->log, OSM_LOG_ERROR,
              "osmt_run_mcast_flow: ERR 0218: "
-             "Failed to create MCG for MGID=0xFF02:0:0:0:0:0:0:1\n",
+             "Failed to create MCG for MGID=0xFF02:0:0:0:0:0:0:1 - got %s/%s\n",
              ib_get_err_str( status ),
              ib_get_mad_status_str( (ib_mad_t*)(&res_sa_mad) )
              );
@@ -2180,7 +2202,7 @@ osmt_run_mcast_flow( IN osmtest_t * cons
            "osmt_run_mcast_flow: " EXPECTING_ERRORS_START "\n" );
   mc_req_rec.mgid = good_mgid;
   mc_req_rec.mgid.raw[12] = 0xFF;
-  mc_req_rec.scope_state = 0x22; /*  link-local scope */
+  mc_req_rec.scope_state = 0x22; /*  link-local scope, non-member state */
 
   status = osmt_send_mcast_request( p_osmt, 1,
                                     &mc_req_rec,
@@ -2193,7 +2215,7 @@ osmt_run_mcast_flow( IN osmtest_t * cons
       (res_sa_mad.status != IB_SA_MAD_STATUS_REQ_INVALID)) {
     osm_log( &p_osmt->log, OSM_LOG_ERROR,
              "osmt_run_mcast_flow: ERR 0219: "
-             "Failed to recognize create with JoinState != FullMember\n",
+             "Failed to recognize create with JoinState != FullMember - got %s/%s\n",
              ib_get_err_str( status ),
              ib_get_mad_status_str( (ib_mad_t*)(&res_sa_mad) )
              );
@@ -2219,7 +2241,7 @@ osmt_run_mcast_flow( IN osmtest_t * cons
   {
     osm_log( &p_osmt->log, OSM_LOG_ERROR,
              "osmt_run_mcast_flow: ERR 0220: "
-             "Failed to create MCG with valid join state 0x3\n",
+             "Failed to create MCG with valid join state 0x3 - got %s/%s\n",
              ib_get_err_str( status ),
              ib_get_mad_status_str( (ib_mad_t*)(&res_sa_mad) )
              );
@@ -2263,7 +2285,7 @@ osmt_run_mcast_flow( IN osmtest_t * cons
       (res_sa_mad.status != IB_SA_MAD_STATUS_REQ_INVALID)) {
     osm_log( &p_osmt->log, OSM_LOG_ERROR,
              "osmt_run_mcast_flow: ERR 0221: "
-             "Failed to recognize create with JoinState != FullMember\n",
+             "Failed to recognize create with JoinState != FullMember - got %s/%s\n",
              ib_get_err_str( status ),
              ib_get_mad_status_str( (ib_mad_t*)(&res_sa_mad) )
              );
@@ -2274,7 +2296,7 @@ osmt_run_mcast_flow( IN osmtest_t * cons
   /* Lets try another valid join scope state */
   osm_log( &p_osmt->log, OSM_LOG_INFO,
            "osmt_run_mcast_flow: "
-           "Checking new MGID with valid join state (o15.0.1.9)...\n"
+           "Checking new MGID creation with valid join state (o15.0.1.9)...\n"
            );
 
   mc_req_rec.mgid = good_mgid;
@@ -2291,7 +2313,7 @@ osmt_run_mcast_flow( IN osmtest_t * cons
   {
     osm_log( &p_osmt->log, OSM_LOG_ERROR,
              "osmt_run_mcast_flow: ERR 0222: "
-             "Failed to create MCG with valid join state 0xF\n",
+             "Failed to create MCG with valid join state 0xF - got %s/%s\n",
              ib_get_err_str( status ),
              ib_get_mad_status_str( (ib_mad_t*)(&res_sa_mad) )
              );
@@ -2358,7 +2380,7 @@ osmt_run_mcast_flow( IN osmtest_t * cons
   {
     osm_log( &p_osmt->log, OSM_LOG_ERROR,
              "osmt_run_mcast_flow: ERR 02CD: "
-             "Failed to update existing MGID\n",
+             "Failed to update existing MGID - got %s/%s\n",
              ib_get_err_str( status ),
              ib_get_mad_status_str( (ib_mad_t*)(&res_sa_mad) )
              );
@@ -2426,7 +2448,7 @@ osmt_run_mcast_flow( IN osmtest_t * cons
   {
     osm_log( &p_osmt->log, OSM_LOG_ERROR,
              "osmt_run_mcast_flow: ERR 02C0: "
-             "Failed to update existing MCG\n",
+             "Failed to update existing MCG - got %s/%s\n",
              ib_get_err_str( status ),
              ib_get_mad_status_str( (ib_mad_t*)(&res_sa_mad) )
              );
@@ -2459,7 +2481,7 @@ osmt_run_mcast_flow( IN osmtest_t * cons
   {
     osm_log( &p_osmt->log, OSM_LOG_ERROR,
              "osmt_run_mcast_flow: ERR 02C2: "
-             "Failed to update existing MGID\n",
+             "Failed to update existing MGID - got %s/%s\n",
              ib_get_err_str( status ),
              ib_get_mad_status_str( (ib_mad_t*)(&res_sa_mad) )
              );
@@ -2493,7 +2515,7 @@ osmt_run_mcast_flow( IN osmtest_t * cons
   {
     osm_log( &p_osmt->log, OSM_LOG_ERROR,
              "osmt_run_mcast_flow: ERR 02C4: "
-             "Failed to update existing MGID\n",
+             "Failed to update existing MGID - got %s/%s\n",
              ib_get_err_str( status ),
              ib_get_mad_status_str( (ib_mad_t*)(&res_sa_mad) )
              );
@@ -2848,11 +2870,11 @@ osmt_run_mcast_flow( IN osmtest_t * cons
     osm_log( &p_osmt->log, OSM_LOG_ERROR,
              "osmt_run_mcast_flow: ERR 02BE: "
              "Failed to create MCG for 0x%016" PRIx64 " : "
-             "0x%016" PRIx64 ".\n",
-             ib_get_err_str( status ),
-             ib_get_mad_status_str( (ib_mad_t*)(&res_sa_mad) ),
+             "0x%016" PRIx64 " - got %s/%s\n",
              cl_ntoh64(good_mgid.unicast.prefix),
-             cl_ntoh64(good_mgid.unicast.interface_id));
+             cl_ntoh64(good_mgid.unicast.interface_id),
+             ib_get_err_str( status ),
+             ib_get_mad_status_str( (ib_mad_t*)(&res_sa_mad) ));
     goto Exit;
   }
 
@@ -3028,11 +3050,12 @@ osmt_run_mcast_flow( IN osmtest_t * cons
     {
       osm_log( &p_osmt->log, OSM_LOG_VERBOSE,
                "osmt_run_mcast_flow: "
-               "current port_guid = 0x%" PRIx64 "\n",
+               "remote port_guid = 0x%" PRIx64 "\n",
                cl_ntoh64(p_rec->node_info.port_guid));
 
       remote_port_guid = p_rec->node_info.port_guid;
       i = num_recs;
+      break;
     }
   }
 
@@ -3073,16 +3096,25 @@ osmt_run_mcast_flow( IN osmtest_t * cons
     memcpy(&proxy_mgid,&p_mc_res->mgid,sizeof(ib_gid_t));
 
     /* First try a bad deletion then good one */
+
+    osm_log( &p_osmt->log, OSM_LOG_INFO,
+             "osmt_run_mcast_flow: "
+             "Trying deletion of remote port with local port guid\n");
+
     osmt_init_mc_query_rec(p_osmt, &mc_req_rec);
     ib_member_set_join_state(&mc_req_rec, IB_MC_REC_STATE_FULL_MEMBER);
     comp_mask =
       IB_MCR_COMPMASK_MGID |
       IB_MCR_COMPMASK_PORT_GID |
       IB_MCR_COMPMASK_JOIN_STATE;
+    osm_log( &p_osmt->log, OSM_LOG_ERROR,
+             "osmt_run_mcast_flow: " EXPECTING_ERRORS_START "\n" );
     status = osmt_send_mcast_request( p_osmt, 0, /*  delete flag */
                                       &mc_req_rec,
                                       comp_mask,
                                       &res_sa_mad );
+    osm_log( &p_osmt->log, OSM_LOG_ERROR,
+             "osmt_run_mcast_flow: " EXPECTING_ERRORS_END "\n" );
     if (status == IB_SUCCESS)
     {
       osm_log( &p_osmt->log, OSM_LOG_ERROR,
@@ -3096,6 +3128,11 @@ osmt_run_mcast_flow( IN osmtest_t * cons
       status = IB_ERROR;
       goto Exit;
     }
+
+    osm_log( &p_osmt->log, OSM_LOG_INFO,
+             "osmt_run_mcast_flow: "
+             "Trying deletion of remote port with the right port guid\n");
+
     osmt_init_mc_query_rec(p_osmt, &mc_req_rec);
     ib_member_set_join_state(&mc_req_rec, IB_MC_REC_STATE_FULL_MEMBER);
     mc_req_rec.mgid = proxy_mgid;
@@ -3214,6 +3251,15 @@ osmt_run_mcast_flow( IN osmtest_t * cons
   /*  - Try GetTable with PortGUID wildcarded and get back some groups. */
 
   status = osmt_query_mcast( p_osmt);
+  if (status != IB_SUCCESS)
+  {
+    osm_log( &p_osmt->log, OSM_LOG_ERROR,
+             "osmt_run_mcast_flow: ERR 02B1: "
+             "Failed to query multicast groups: %s\n",
+             ib_get_err_str(status));
+    goto Exit;
+  }
+
   cnt = cl_qmap_count(&p_osmt->exp_subn.mgrp_mlid_tbl);
   osm_log( &p_osmt->log, OSM_LOG_INFO,
            "osmt_run_mcast_flow (Before Deletion of all MCG): "
@@ -3230,8 +3276,7 @@ osmt_run_mcast_flow( IN osmtest_t * cons
   while( p_mgrp != (osmtest_mgrp_t*)cl_qmap_end( p_mgrp_mlid_tbl ) )
   {
     /* Only if different from IPoIB Mgid try to delete */
-    if (memcmp(&osm_ipoib_good_mgid,&p_mgrp->mcmember_rec.mgid,sizeof(osm_ipoib_good_mgid)) &&
-        memcmp(&osm_ts_ipoib_good_mgid,&p_mgrp->mcmember_rec.mgid,sizeof(osm_ts_ipoib_good_mgid)))
+    if (!IS_IPOIB_MGID(&p_mgrp->mcmember_rec.mgid))
     {
       osmt_init_mc_query_rec(p_osmt, &mc_req_rec);
       mc_req_rec.mgid = p_mgrp->mcmember_rec.mgid;
@@ -3261,6 +3306,7 @@ osmt_run_mcast_flow( IN osmtest_t * cons
                                         &mc_req_rec,
                                         comp_mask,
                                         &res_sa_mad );
+      status = IB_SUCCESS;
       if (status != IB_SUCCESS)
       {
         osm_log( &p_osmt->log, OSM_LOG_ERROR,
@@ -3274,6 +3320,10 @@ osmt_run_mcast_flow( IN osmtest_t * cons
         fail_to_delete_mcg++;
       }
     }
+    else
+    {
+      end_ipoib_cnt++;
+    }
     p_mgrp = (osmtest_mgrp_t*)cl_qmap_next( &p_mgrp->map_item );
   }
 
@@ -3282,8 +3332,9 @@ osmt_run_mcast_flow( IN osmtest_t * cons
   if (status != IB_SUCCESS)
   {
     osm_log( &p_osmt->log, OSM_LOG_ERROR,
-             "osmt_run_mcast_flow: ERR 2FF "
-             "GetTable of all records has failed!\n");
+             "osmt_run_mcast_flow: ERR 02B2 "
+             "GetTable of all records has failed - got %s\n",
+             ib_get_err_str( status ));
     goto Exit;
   }
 
@@ -3293,17 +3344,34 @@ osmt_run_mcast_flow( IN osmtest_t * cons
   if (p_osmt->opt.mmode == 1 || p_osmt->opt.mmode == 3)
   {
       end_cnt = cl_qmap_count(&p_osmt->exp_subn.mgrp_mlid_tbl);
+
       osm_log( &p_osmt->log, OSM_LOG_INFO,
-               "osmt_run_mcast_flow (After Deletion of all MCG): "
-               "Number of MC Records found in SA DB is %d\n",end_cnt);
-          /* when we comapre num of MCG we should consider an outside source which create other MCGs */
-      if ((end_cnt-fail_to_delete_mcg) != (start_cnt - mcg_outside_test_cnt))
+               "osmt_run_mcast_flow: "
+               "Status of MC Records in SA DB during the test flow:\n"
+               "  Beginning of test\n"
+               "       Unrelated to the test: %d\n"
+               "       IPoIB MC Records     : %d\n"
+               "       Total                : %d\n"
+               "  End of test\n"
+               "       Failed to delete     : %d\n"
+               "       IPoIB MC Records     : %d\n"
+               "       Total                : %d\n",
+               mcg_outside_test_cnt, /* Non-IPoIB that existed at the beginning */
+               start_ipoib_cnt,      /* IPoIB records */
+               start_cnt,            /* Total: IPoIB and MC Records unrelated to the test */
+               fail_to_delete_mcg,   /* Failed to delete at the end */
+               end_ipoib_cnt,        /* IPoIB records */
+               end_cnt);             /* Total MC Records at the end */   
+
+      /* when we compare num of MCG we should consider an outside source which create other MCGs */
+      if ((end_cnt-fail_to_delete_mcg-end_ipoib_cnt) != (start_cnt-mcg_outside_test_cnt-start_ipoib_cnt))
       {
         osm_log( &p_osmt->log, OSM_LOG_INFO,
                  "osmt_run_mcast_flow: "
-                 "Got different number of records stored in SA DB\n\t\t"
+                 "Got different number of non-IPoIB records stored in SA DB\n\t\t"
                  "at Start got %d, at End got %d (IPoIB groups only)\n",
-                 (start_cnt-mcg_outside_test_cnt),(end_cnt-fail_to_delete_mcg));
+                 (start_cnt-mcg_outside_test_cnt-start_ipoib_cnt),
+                 (end_cnt-fail_to_delete_mcg-end_ipoib_cnt));
       }
 
       p_mgrp_mlid_tbl = &p_osmt->exp_subn.mgrp_mlid_tbl;
@@ -3327,20 +3395,27 @@ osmt_run_mcast_flow( IN osmtest_t * cons
                    cl_ntoh64(p_mgrp->mcmember_rec.mgid.unicast.prefix),
                    cl_ntoh64(p_mgrp->mcmember_rec.mgid.unicast.interface_id),
                    mlid );
-        status=IB_ERROR;
-        goto Exit;
-      }
+          got_error = TRUE;
+
+          /** 
+           * ToDo: Query all the group members of this MC Group
+           **/
+
+        }
         else
         {
-          osm_log( &p_osmt->log, OSM_LOG_INFO,
-                   "osmt_run_mcast_flow: "
-                   "Still exists MGID:0x%016" PRIx64 " : 0x%016"
-                   PRIx64 "\n",
-                   cl_ntoh64(p_mgrp->mcmember_rec.mgid.unicast.prefix),
-                   cl_ntoh64(p_mgrp->mcmember_rec.mgid.unicast.interface_id) );
+           osm_log( &p_osmt->log, OSM_LOG_INFO,
+                    "osmt_run_mcast_flow: "
+                    "Still exists %s MGID:0x%016" PRIx64 " : 0x%016" PRIx64 "\n",
+                    (IS_IPOIB_MGID(&p_mgrp->mcmember_rec.mgid)) ? "IPoIB" : "non-IPoIB",
+                    cl_ntoh64(p_mgrp->mcmember_rec.mgid.unicast.prefix),
+                    cl_ntoh64(p_mgrp->mcmember_rec.mgid.unicast.interface_id) );
         }
         p_mgrp = (osmtest_mgrp_t*)cl_qmap_next( &p_mgrp->map_item );
       }
+
+      if (got_error)
+         status = IB_ERROR;
   }
  Exit:
   OSM_LOG_EXIT( &p_osmt->log );





More information about the general mailing list