From patchwork Sat Feb 12 19:33:46 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arlin Davis X-Patchwork-Id: 552201 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 p1CJXpxM027957 for ; Sat, 12 Feb 2011 19:33:51 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752539Ab1BLTdt (ORCPT ); Sat, 12 Feb 2011 14:33:49 -0500 Received: from mga11.intel.com ([192.55.52.93]:11638 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752521Ab1BLTdt convert rfc822-to-8bit (ORCPT ); Sat, 12 Feb 2011 14:33:49 -0500 Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga102.fm.intel.com with ESMTP; 12 Feb 2011 11:33:48 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.60,462,1291622400"; d="scan'208";a="657100067" Received: from orsmsx603.amr.corp.intel.com ([10.22.226.49]) by fmsmga002.fm.intel.com with ESMTP; 12 Feb 2011 11:33:49 -0800 Received: from orsmsx506.amr.corp.intel.com ([10.22.226.44]) by orsmsx603.amr.corp.intel.com ([10.22.226.49]) with mapi; Sat, 12 Feb 2011 11:33:48 -0800 From: "Davis, Arlin R" To: linux-rdma , "ofw@lists.openfabrics.org" Date: Sat, 12 Feb 2011 11:33:46 -0800 Subject: [PATCH 2/3] DAPL v2.0: ucm: cm object needs to be on work queue before req sent on wire Thread-Topic: [PATCH 2/3] DAPL v2.0: ucm: cm object needs to be on work queue before req sent on wire Thread-Index: AcvK68PLFArXHyEJTPibOf1MSNtYtw== Message-ID: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US MIME-Version: 1.0 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]); Sat, 12 Feb 2011 19:33:51 +0000 (UTC) diff --git a/dapl/openib_ucm/cm.c b/dapl/openib_ucm/cm.c index 69f7610..b2db32c 100644 --- a/dapl/openib_ucm/cm.c +++ b/dapl/openib_ucm/cm.c @@ -951,7 +951,7 @@ dapli_cm_connect(DAPL_EP *ep, dp_ib_cm_handle_t cm) htons(cm->msg.dport)); dapl_os_lock(&cm->lock); - if (cm->state != DCM_REP_PENDING) { + if (cm->state != DCM_INIT && cm->state != DCM_REP_PENDING) { dapl_os_unlock(&cm->lock); return DAT_INVALID_STATE; } @@ -985,8 +985,9 @@ dapli_cm_connect(DAPL_EP *ep, dp_ib_cm_handle_t cm) DAT_INVALID_ADDRESS_UNREACHABLE); } + cm->state = DCM_REP_PENDING; cm->msg.op = htons(DCM_REQ); - dapl_os_get_time(&cm->timer); /* reply expected */ + dapl_os_get_time(&cm->timer); /* reset reply timer */ if (ucm_send(&cm->hca->ib_trans, &cm->msg, &cm->msg.p_data, ntohs(cm->msg.p_size))) { dapl_os_unlock(&cm->lock); @@ -994,10 +995,6 @@ dapli_cm_connect(DAPL_EP *ep, dp_ib_cm_handle_t cm) } dapl_os_unlock(&cm->lock); - /* first time through, link EP and CM, put on work queue */ - if (!cm->retries) { - dapli_queue_conn(cm); - } return DAT_SUCCESS; bail: @@ -1658,7 +1655,10 @@ dapls_ib_connect(IN DAT_EP_HANDLE ep_handle, dapl_os_memcpy(&cm->msg.p_data, p_data, p_size); } - cm->state = DCM_REP_PENDING; + cm->state = DCM_INIT; + + /* link EP and CM, put on work queue */ + dapli_queue_conn(cm); /* build connect request, send to remote CM based on r_addr info */ return (dapli_cm_connect(ep, cm));