From patchwork Fri Sep 16 18:31:18 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Knut Omang X-Patchwork-Id: 9336399 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id AD466601C2 for ; Fri, 16 Sep 2016 18:33:35 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A273C2A06C for ; Fri, 16 Sep 2016 18:33:35 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 974962A06F; Fri, 16 Sep 2016 18:33:35 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3C29D2A06C for ; Fri, 16 Sep 2016 18:33:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935086AbcIPSdb (ORCPT ); Fri, 16 Sep 2016 14:33:31 -0400 Received: from userp1040.oracle.com ([156.151.31.81]:48278 "EHLO userp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935023AbcIPSd2 (ORCPT ); Fri, 16 Sep 2016 14:33:28 -0400 Received: from userv0021.oracle.com (userv0021.oracle.com [156.151.31.71]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id u8GIWuYM012838 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 16 Sep 2016 18:32:56 GMT Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by userv0021.oracle.com (8.13.8/8.13.8) with ESMTP id u8GIWsg1005415 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 16 Sep 2016 18:32:56 GMT Received: from abhmp0019.oracle.com (abhmp0019.oracle.com [141.146.116.25]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id u8GIWruD019072; Fri, 16 Sep 2016 18:32:53 GMT Received: from abi.no.oracle.com (/10.172.144.123) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Fri, 16 Sep 2016 11:32:53 -0700 From: Knut Omang To: Doug Ledford Cc: linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org, Knut Omang , Sean Hefty , Hal Rosenstock , Matan Barak , Mark Bloch , Leon Romanovsky , Haggai Eran , Sagi Grimberg , Yishai Hadas , Majd Dibbiny , Eran Ben Elisha , Or Gerlitz , Bart Van Assche , Steve Wise , Somnath Kotur Subject: [PATCH v2 7/8] ib_{uverbs/core}: add new ib_create_qp_ex with udata arg Date: Fri, 16 Sep 2016 20:31:18 +0200 Message-Id: <2cb7931da6c4d02199c1efddc38c33efde9a5683.1474049924.git-series.knut.omang@oracle.com> X-Mailer: git-send-email 2.5.5 In-Reply-To: References: In-Reply-To: References: X-Source-IP: userv0021.oracle.com [156.151.31.71] Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Necessary to get device specific arguments through to XRC QPs. Added new local header file to serve as support interface between ib_core and ib_uverbs. Right now there is a lot of duplicate setup code in uverbs_cmd.c on the ib_uverbs side and verbs.c on the ib_core side. This commit is a quick fix to have XRC support working, but similar calls can be added to consolidate the code for other parts of the API. --- drivers/infiniband/core/core_priv.h | 3 +++ drivers/infiniband/core/uverbs_cmd.c | 2 +- drivers/infiniband/core/verbs.c | 13 +++++++++++-- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/drivers/infiniband/core/core_priv.h b/drivers/infiniband/core/core_priv.h index 19d499d..0819006 100644 --- a/drivers/infiniband/core/core_priv.h +++ b/drivers/infiniband/core/core_priv.h @@ -152,5 +152,8 @@ int ib_nl_handle_set_timeout(struct sk_buff *skb, struct netlink_callback *cb); int ib_nl_handle_ip_res_resp(struct sk_buff *skb, struct netlink_callback *cb); +struct ib_qp *ib_create_qp_ex(struct ib_pd *pd, + struct ib_qp_init_attr *qp_init_attr, + struct ib_udata *udata); #endif /* _CORE_PRIV_H */ diff --git a/drivers/infiniband/core/uverbs_cmd.c b/drivers/infiniband/core/uverbs_cmd.c index 7033d10..7f4470e 100644 --- a/drivers/infiniband/core/uverbs_cmd.c +++ b/drivers/infiniband/core/uverbs_cmd.c @@ -1907,7 +1907,7 @@ static int create_qp(struct ib_uverbs_file *file, } if (cmd->qp_type == IB_QPT_XRC_TGT) - qp = ib_create_qp(pd, &attr); + qp = ib_create_qp_ex(pd, &attr, uhw); else qp = device->create_qp(pd, &attr, uhw); diff --git a/drivers/infiniband/core/verbs.c b/drivers/infiniband/core/verbs.c index 6efe23d..8f71b00 100644 --- a/drivers/infiniband/core/verbs.c +++ b/drivers/infiniband/core/verbs.c @@ -751,8 +751,9 @@ static struct ib_qp *ib_create_xrc_qp(struct ib_qp *qp, return qp; } -struct ib_qp *ib_create_qp(struct ib_pd *pd, - struct ib_qp_init_attr *qp_init_attr) +struct ib_qp *ib_create_qp_ex(struct ib_pd *pd, + struct ib_qp_init_attr *qp_init_attr, + struct ib_udata *udata) { struct ib_device *device = pd ? pd->device : qp_init_attr->xrcd->device; struct ib_qp *qp; @@ -836,6 +837,14 @@ struct ib_qp *ib_create_qp(struct ib_pd *pd, return qp; } +EXPORT_SYMBOL(ib_create_qp_ex); + + +struct ib_qp *ib_create_qp(struct ib_pd *pd, + struct ib_qp_init_attr *qp_init_attr) +{ + return ib_create_qp_ex(pd, qp_init_attr,NULL); +} EXPORT_SYMBOL(ib_create_qp); static const struct {