[ofa-general] [PATCH] osmtest/osmt_multicast.c: some refinements to the multicast flow

Yevgeny Kliteynik kliteyn at dev.mellanox.co.il
Thu Nov 13 06:23:25 PST 2008


Hi Sasha,

Here are some osmtest refinements (multicast flow) that
I did while debugging the recent two multicast bugs in
opensm: some comments fixes, creating a group that was
removed because last full member left, and adding one
query to check that invalid delete request really fails.

Signed-off-by: Yevgeny Kliteynik <kliteyn at dev.mellanox.co.il>
---
 opensm/osmtest/osmt_multicast.c |   64 ++++++++++++++++++++++++++++++++++----
 1 files changed, 57 insertions(+), 7 deletions(-)

diff --git a/opensm/osmtest/osmt_multicast.c b/opensm/osmtest/osmt_multicast.c
index a397142..57a8772 100644
--- a/opensm/osmtest/osmt_multicast.c
+++ b/opensm/osmtest/osmt_multicast.c
@@ -1813,7 +1813,7 @@ ib_api_status_t osmt_run_mcast_flow(IN osmtest_t * const p_osmt)

 	/* Lets try another valid join scope state */
 	OSM_LOG(&p_osmt->log, OSM_LOG_INFO,
-		"Checking new MGID creation with valid join state (o15.0.1.9)...\n");
+		"Checking new MGID creation with valid join state (o15.0.2.3)...\n");

 	mc_req_rec.mgid = good_mgid;
 	mc_req_rec.mgid.raw[12] = 0xFB;
@@ -1853,7 +1853,7 @@ ib_api_status_t osmt_run_mcast_flow(IN osmtest_t * const p_osmt)
 	    IB_MCR_COMPMASK_MGID |
 	    IB_MCR_COMPMASK_PORT_GID | IB_MCR_COMPMASK_JOIN_STATE;

-	status = osmt_send_mcast_request(p_osmt, 0x1,	/* User Defined query */
+	status = osmt_send_mcast_request(p_osmt, 0x1,	/* SubnAdmSet */
 					 &mc_req_rec, comp_mask, &res_sa_mad);
 	if (status != IB_SUCCESS) {
 		OSM_LOG(&p_osmt->log, OSM_LOG_ERROR, "ERR 02CC: "
@@ -1862,6 +1862,16 @@ ib_api_status_t osmt_run_mcast_flow(IN osmtest_t * const p_osmt)
 		goto Exit;
 	}

+	p_mc_res = ib_sa_mad_get_payload_ptr(&res_sa_mad);
+	if ((p_mc_res->scope_state & 0x7) != 0x7) {
+		OSM_LOG(&p_osmt->log, OSM_LOG_ERROR, "ERR 02D0: "
+			"Validating JoinState update failed. "
+			"Expected 0x27 got 0x%02X\n",
+			p_mc_res->scope_state);
+		status = IB_ERROR;
+		goto Exit;
+	}
+
 	/* o15.0.1.11: */
 	/* - Try to join into a MGID that exists with JoinState=SendOnlyMember -  */
 	/*   see that it updates JoinState. What is the routing change? */
@@ -1869,12 +1879,24 @@ ib_api_status_t osmt_run_mcast_flow(IN osmtest_t * const p_osmt)
 		"Checking Retry of existing MGID - See JoinState update (o15.0.1.11)...\n");

 	mc_req_rec.mgid = good_mgid;
-	mc_req_rec.scope_state = 0x22;	/* link-local scope, send only  member */

+	/* first, make sure  that the group exists */
+	mc_req_rec.scope_state = 0x21;
 	status = osmt_send_mcast_request(p_osmt, 1,
 					 &mc_req_rec, comp_mask, &res_sa_mad);
 	if (status != IB_SUCCESS) {
 		OSM_LOG(&p_osmt->log, OSM_LOG_ERROR, "ERR 02CD: "
+			"Failed to create/join as full member - got %s/%s\n",
+			ib_get_err_str(status),
+			ib_get_mad_status_str((ib_mad_t *) (&res_sa_mad)));
+		goto Exit;
+	}
+
+	mc_req_rec.scope_state = 0x22;	/* link-local scope, non-member */
+	status = osmt_send_mcast_request(p_osmt, 1,
+					 &mc_req_rec, comp_mask, &res_sa_mad);
+	if (status != IB_SUCCESS) {
+		OSM_LOG(&p_osmt->log, OSM_LOG_ERROR, "ERR 02D1: "
 			"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)));
@@ -1899,15 +1921,33 @@ ib_api_status_t osmt_run_mcast_flow(IN osmtest_t * const p_osmt)
 	mc_req_rec.rate =
 	    IB_LINK_WIDTH_ACTIVE_1X | IB_PATH_SELECTOR_GREATER_THAN << 6;
 	mc_req_rec.mgid = good_mgid;
-	/* link-local scope, non member (so we should not be able to delete) */
-	/*  but the FullMember bit should be gone */
+
 	OSM_LOG(&p_osmt->log, OSM_LOG_INFO,
 		"Checking Partially delete JoinState (o15.0.1.14)...\n");
-	mc_req_rec.scope_state = 0x22;
+
+	/* link-local scope, both non-member bits,
+	   so we should not be able to delete) */
+	mc_req_rec.scope_state = 0x26;
+	OSM_LOG(&p_osmt->log, OSM_LOG_ERROR, EXPECTING_ERRORS_START "\n");
 	status = osmt_send_mcast_request(p_osmt, 0,
 					 &mc_req_rec, comp_mask, &res_sa_mad);
-	if ((status != IB_SUCCESS) || (p_mc_res->scope_state != 0x21)) {
+	OSM_LOG(&p_osmt->log, OSM_LOG_ERROR, EXPECTING_ERRORS_END "\n");
+
+	if (status != IB_REMOTE_ERROR) {
 		OSM_LOG(&p_osmt->log, OSM_LOG_ERROR, "ERR 02CF: "
+			"Expected to fail partially update JoinState, "
+			"but got %s\n",
+			ib_get_err_str(status));
+		status = IB_ERROR;
+		goto Exit;
+	}
+
+	/* link-local scope, NonMember bit, the FullMember bit should stay */
+	mc_req_rec.scope_state = 0x22;
+	status = osmt_send_mcast_request(p_osmt, 0,
+					 &mc_req_rec, comp_mask, &res_sa_mad);
+	if (status != IB_SUCCESS) {
+		OSM_LOG(&p_osmt->log, OSM_LOG_ERROR, "ERR 02D3: "
 			"Failed to partially update JoinState : %s/%s\n",
 			ib_get_err_str(status),
 			ib_get_mad_status_str((ib_mad_t *) (&res_sa_mad)));
@@ -1915,6 +1955,16 @@ ib_api_status_t osmt_run_mcast_flow(IN osmtest_t * const p_osmt)
 		goto Exit;
 	}

+	p_mc_res = ib_sa_mad_get_payload_ptr(&res_sa_mad);
+	if (p_mc_res->scope_state != 0x21) {
+		OSM_LOG(&p_osmt->log, OSM_LOG_ERROR, "ERR 02D4: "
+			"Failed to partially update JoinState : "
+			"JoinState = 0x%02X, expected 0x%02X\n",
+			p_mc_res->scope_state, 0x21);
+		status = IB_ERROR;
+		goto Exit;
+	}
+
 	/* So far successfully delete state - Now change it */
 	mc_req_rec.mgid = good_mgid;
 	mc_req_rec.scope_state = 0x24;	/* link-local scope, send only  member */
-- 
1.5.1.4




More information about the general mailing list