From patchwork Fri May 22 21:43:55 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arlin Davis X-Patchwork-Id: 6469021 Return-Path: X-Original-To: patchwork-linux-rdma@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id E1197C0020 for ; Fri, 22 May 2015 21:43:59 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 1A3D02052D for ; Fri, 22 May 2015 21:43:59 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E1BD52052C for ; Fri, 22 May 2015 21:43:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757022AbbEVVn5 (ORCPT ); Fri, 22 May 2015 17:43:57 -0400 Received: from mga11.intel.com ([192.55.52.93]:7439 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757188AbbEVVn4 convert rfc822-to-8bit (ORCPT ); Fri, 22 May 2015 17:43:56 -0400 Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga102.fm.intel.com with ESMTP; 22 May 2015 14:43:56 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.13,478,1427785200"; d="scan'208";a="714448860" Received: from orsmsx106.amr.corp.intel.com ([10.22.225.133]) by fmsmga001.fm.intel.com with ESMTP; 22 May 2015 14:43:56 -0700 Received: from orsmsx111.amr.corp.intel.com (10.22.240.12) by ORSMSX106.amr.corp.intel.com (10.22.225.133) with Microsoft SMTP Server (TLS) id 14.3.224.2; Fri, 22 May 2015 14:43:55 -0700 Received: from orsmsx101.amr.corp.intel.com ([169.254.8.102]) by ORSMSX111.amr.corp.intel.com ([169.254.11.218]) with mapi id 14.03.0224.002; Fri, 22 May 2015 14:43:55 -0700 From: "Davis, Arlin R" To: "linux-rdma@vger.kernel.org" Subject: [PATCH 3/5] dapl ucm: allocate/free AH hash table for UD endpoint types Thread-Topic: [PATCH 3/5] dapl ucm: allocate/free AH hash table for UD endpoint types Thread-Index: AdCUyWt9Qfh1m9LWTw61QoZbY/NgfQ== Date: Fri, 22 May 2015 21:43:55 +0000 Message-ID: <54347E5A035A054EAE9D05927FB467F977D76BA5@ORSMSX101.amr.corp.intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.22.254.139] MIME-Version: 1.0 Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Arlin Davis Signed-off-by: Arlin Davis --- dapl/openib_common/qp.c | 32 ++++++++++++++++++++++++++++++-- 1 files changed, 30 insertions(+), 2 deletions(-) if (ep_ptr->qp_handle->qp2) ibv_destroy_qp(ep_ptr->qp_handle->qp2); #endif + if (ep_ptr->qp_handle->ah) + dapl_os_free(ep_ptr->qp_handle->ah, + sizeof(ib_ah_handle_t) * DCM_AH_SPACE); + dapl_os_free(ep_ptr->qp_handle, sizeof(struct dcm_ib_qp)); } ep_ptr->qp_handle = IB_INVALID_HANDLE; @@ -405,6 +422,17 @@ DAT_RETURN dapls_ib_qp_free(IN DAPL_IA * ia_ptr, IN DAPL_EP * ep_ptr) dapl_os_unlock(&ep_ptr->header.lock); } + /* destroy any UD address handles */ + if (ep_ptr->qp_handle->ah) { + int i; + + for (i = 0; i < DCM_AH_SPACE; i++) { + if (ep_ptr->qp_handle->ah[i]) + ibv_destroy_ah(ep_ptr->qp_handle->ah[i]); + } + dapl_os_free(ep_ptr->qp_handle->ah, sizeof(ib_ah_handle_t) * DCM_AH_SPACE); + } + dapl_os_free(ep_ptr->qp_handle, sizeof(struct dcm_ib_qp)); ep_ptr->qp_handle = IB_INVALID_HANDLE; return DAT_SUCCESS; -- 1.7.3 -- 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/dapl/openib_common/qp.c b/dapl/openib_common/qp.c index 10abfbb..95ea70d 100644 --- a/dapl/openib_common/qp.c +++ b/dapl/openib_common/qp.c @@ -183,6 +183,13 @@ dapls_ib_qp_alloc(IN DAPL_IA * ia_ptr, (128 << ia_ptr->hca_ptr->ib_trans.ib_cm.mtu)) { goto err; } + ep_ptr->qp_handle->ah = + (ib_ah_handle_t*) dapl_os_alloc(sizeof(ib_ah_handle_t) * DCM_AH_SPACE); + + if (!ep_ptr->qp_handle->ah) + goto err; + + dapl_os_memzero(ep_ptr->qp_handle->ah, sizeof(ib_ah_handle_t) * DCM_AH_SPACE); } #endif @@ -225,9 +232,15 @@ dapls_ib_qp_alloc(IN DAPL_IA * ia_ptr, #endif ep_ptr->qp_handle->qp = ibv_create_qp(ib_pd_handle, &qp_create); if (!ep_ptr->qp_handle->qp) { - dapl_log(1," qp_alloc ERR %d %s line %d on device %s\n", - errno, strerror(errno), __LINE__ , + dapl_log(1," qp_alloc ERR %d %s on device %s\n", + errno, strerror(errno), ibv_get_device_name(ia_ptr->hca_ptr->ib_trans.ib_dev)); + dapl_log(1," qp_attr: SQ %d,%d cq %p RQ %d,%d cq %p SRQ %p [inl %d typ %d]\n", + qp_create.cap.max_send_wr, qp_create.cap.max_send_sge, + req_cq, qp_create.cap.max_recv_wr, + qp_create.cap.max_recv_sge, rcv_cq, + qp_create.srq, qp_create.cap.max_inline_data, + qp_create.qp_type); ret = errno; goto err; } @@ -330,6 +343,10 @@ err: