From patchwork Tue Apr 5 18:05:17 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hal Rosenstock X-Patchwork-Id: 688431 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p35I5UlK021623 for ; Tue, 5 Apr 2011 18:05:30 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755565Ab1DESFZ (ORCPT ); Tue, 5 Apr 2011 14:05:25 -0400 Received: from mail-fx0-f46.google.com ([209.85.161.46]:39568 "EHLO mail-fx0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755563Ab1DESFY (ORCPT ); Tue, 5 Apr 2011 14:05:24 -0400 Received: by mail-fx0-f46.google.com with SMTP id 17so454033fxm.19 for ; Tue, 05 Apr 2011 11:05:21 -0700 (PDT) Received: by 10.223.42.89 with SMTP id r25mr2703501fae.89.1302026721373; Tue, 05 Apr 2011 11:05:21 -0700 (PDT) Received: from [192.168.1.103] (c-75-69-247-31.hsd1.ma.comcast.net [75.69.247.31]) by mx.google.com with ESMTPS id f21sm175496faa.6.2011.04.05.11.05.19 (version=SSLv3 cipher=OTHER); Tue, 05 Apr 2011 11:05:20 -0700 (PDT) Message-ID: <4D9B59DD.1040209@dev.mellanox.co.il> Date: Tue, 05 Apr 2011 14:05:17 -0400 From: Hal Rosenstock User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.15) Gecko/20110303 Thunderbird/3.1.9 MIME-Version: 1.0 To: Alex Netes CC: "linux-rdma@vger.kernel.org" Subject: [PATCH] osmtest/osmt_multicast.c: In osmt_run_mcast_flow, handle invalid status better Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Tue, 05 Apr 2011 18:05:30 +0000 (UTC) Invalid status may be returned for the insufficient components tests Also, set pkey when component mask set Signed-off-by: Hal Rosenstock --- -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/osmtest/osmt_multicast.c b/osmtest/osmt_multicast.c index 4325119..2ee6470 100644 --- a/osmtest/osmt_multicast.c +++ b/osmtest/osmt_multicast.c @@ -757,6 +757,7 @@ ib_api_status_t osmt_run_mcast_flow(IN osmtest_t * const p_osmt) /* no MGID */ memset(&mc_req_rec.mgid, 0, sizeof(ib_gid_t)); /* Request Join */ + mc_req_rec.pkey = IB_DEFAULT_PKEY; ib_member_set_join_state(&mc_req_rec, IB_MC_REC_STATE_FULL_MEMBER); comp_mask = @@ -794,6 +795,7 @@ ib_api_status_t osmt_run_mcast_flow(IN osmtest_t * const p_osmt) "Checking Join with insufficient comp mask - flow label (o15.0.1.3)...\n"); /* Request Join */ + mc_req_rec.pkey = IB_DEFAULT_PKEY; ib_member_set_join_state(&mc_req_rec, IB_MC_REC_STATE_FULL_MEMBER); comp_mask = @@ -808,13 +810,15 @@ ib_api_status_t osmt_run_mcast_flow(IN osmtest_t * const p_osmt) sa_mad); OSM_LOG(&p_osmt->log, OSM_LOG_ERROR, EXPECTING_ERRORS_END "\n"); - if (status != IB_REMOTE_ERROR || - ((ib_net16_t) (sa_mad->status & IB_SMP_STATUS_MASK)) != - IB_SA_MAD_STATUS_INSUF_COMPS) { - OSM_LOG(&p_osmt->log, OSM_LOG_ERROR, "ERR 02EC: " - "Expected REMOTE ERROR IB_SA_MAD_STATUS_INSUF_COMPS got:%s/%s\n", - ib_get_err_str(status), + if (((ib_net16_t) (sa_mad->status & IB_SMP_STATUS_MASK)) != + IB_SA_MAD_STATUS_INSUF_COMPS) + OSM_LOG(&p_osmt->log, OSM_LOG_INFO, + "Expected IB_SA_MAD_STATUS_INSUF_COMPS got:%s\n", ib_get_mad_status_str((ib_mad_t *) sa_mad)); + if (status != IB_REMOTE_ERROR) { + OSM_LOG(&p_osmt->log, OSM_LOG_ERROR, "ERR 02EC: " + "Expected REMOTE ERROR got:%s\n", + ib_get_err_str(status)); status = IB_ERROR; goto Exit; } @@ -825,6 +829,7 @@ ib_api_status_t osmt_run_mcast_flow(IN osmtest_t * const p_osmt) "Checking Join with insufficient comp mask - tclass (o15.0.1.3)...\n"); /* Request Join */ + mc_req_rec.pkey = IB_DEFAULT_PKEY; ib_member_set_join_state(&mc_req_rec, IB_MC_REC_STATE_FULL_MEMBER); comp_mask = @@ -839,13 +844,15 @@ ib_api_status_t osmt_run_mcast_flow(IN osmtest_t * const p_osmt) sa_mad); OSM_LOG(&p_osmt->log, OSM_LOG_ERROR, EXPECTING_ERRORS_END "\n"); - if (status != IB_REMOTE_ERROR || - ((ib_net16_t) (sa_mad->status & IB_SMP_STATUS_MASK)) != - IB_SA_MAD_STATUS_INSUF_COMPS) { - OSM_LOG(&p_osmt->log, OSM_LOG_ERROR, "ERR 02EA: " - "Expected REMOTE ERROR IB_SA_MAD_STATUS_INSUF_COMPS got:%s/%s\n", - ib_get_err_str(status), + if (((ib_net16_t) (sa_mad->status & IB_SMP_STATUS_MASK)) != + IB_SA_MAD_STATUS_INSUF_COMPS) + OSM_LOG(&p_osmt->log, OSM_LOG_INFO, + "Expected IB_SA_MAD_STATUS_INSUF_COMPS got:%s\n", ib_get_mad_status_str((ib_mad_t *) sa_mad)); + if (status != IB_REMOTE_ERROR) { + OSM_LOG(&p_osmt->log, OSM_LOG_ERROR, "ERR 02EA: " + "Expected REMOTE ERROR got:%s\n", + ib_get_err_str(status)); status = IB_ERROR; goto Exit; } @@ -858,6 +865,7 @@ ib_api_status_t osmt_run_mcast_flow(IN osmtest_t * const p_osmt) /* no MGID */ /* memset(&mc_req_rec.mgid, 0, sizeof(ib_gid_t)); */ /* Request Join */ + mc_req_rec.pkey = IB_DEFAULT_PKEY; 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 | @@ -872,13 +880,15 @@ ib_api_status_t osmt_run_mcast_flow(IN osmtest_t * const p_osmt) sa_mad); OSM_LOG(&p_osmt->log, OSM_LOG_ERROR, EXPECTING_ERRORS_END "\n"); - if (status != IB_REMOTE_ERROR || - ((ib_net16_t) (sa_mad->status & IB_SMP_STATUS_MASK)) != - IB_SA_MAD_STATUS_INSUF_COMPS) { - OSM_LOG(&p_osmt->log, OSM_LOG_ERROR, "ERR 02E9: " - "Expected REMOTE ERROR IB_SA_MAD_STATUS_INSUF_COMPS got:%s/%s\n", - ib_get_err_str(status), + if (((ib_net16_t) (sa_mad->status & IB_SMP_STATUS_MASK)) != + IB_SA_MAD_STATUS_INSUF_COMPS) + OSM_LOG(&p_osmt->log, OSM_LOG_INFO, + "Expected IB_SA_MAD_STATUS_INSUF_COMPS got:%s\n", ib_get_mad_status_str((ib_mad_t *) sa_mad)); + if (status != IB_REMOTE_ERROR) { + OSM_LOG(&p_osmt->log, OSM_LOG_ERROR, "ERR 02E9: " + "Expected REMOTE ERROR got:%s\n", + ib_get_err_str(status)); status = IB_ERROR; goto Exit; }