From patchwork Wed Dec 21 11:42:08 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Selvin Xavier X-Patchwork-Id: 9482963 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 1B37060772 for ; Wed, 21 Dec 2016 11:44:32 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F0D51283F3 for ; Wed, 21 Dec 2016 11:44:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E5D4728420; Wed, 21 Dec 2016 11:44:31 +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.3 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID 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 6F7EC283F3 for ; Wed, 21 Dec 2016 11:44:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933611AbcLULoQ (ORCPT ); Wed, 21 Dec 2016 06:44:16 -0500 Received: from mail-wm0-f50.google.com ([74.125.82.50]:37482 "EHLO mail-wm0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932859AbcLULoM (ORCPT ); Wed, 21 Dec 2016 06:44:12 -0500 Received: by mail-wm0-f50.google.com with SMTP id t79so156288559wmt.0 for ; Wed, 21 Dec 2016 03:44:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=7Be7S2Q+t7H+J7puk+JiT7XVoEjmBf1ZTng/13rTmNU=; b=Dv7QhmXtGXY4LbrmLYKdRZKqMdFG1214jA8pwO+0VrVEQcsFxPIjVprXZsgYuCUjt9 rHCV9FfaYm3hzfFuOxCK8nLIk7XiFKDf0pMP/jF3E34rElEyMebK+Xd8mMQCX+IdjNQy dBx2vSJZwhvhrIebhVHCUzCAV8dtuIw9r/b2w= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=7Be7S2Q+t7H+J7puk+JiT7XVoEjmBf1ZTng/13rTmNU=; b=AhETkxwrDwPQvRuteGg3WFXn1LxXt3E4f2aIbeTyDSG2UKIVOBDSdIgIvP5kmPwZ91 wzYaFKMw0xrL+PvYFv/5TxGqkzOrTNhDt4p3Vt05NiSCBXRiKPbTZrhADEgG8/Itw50T QJFuW9psdjko0CnuV/x+9YO+nddnnmyFeEvwGwe3HWxKtsSNQUfBD6UpCEUPM34nX7jO ieS2AA2NIXyVBIS9NACNk4W3zHinhdVkSMQFkq74uGxvw8QucITHtc5kB4E6QrUdpPaY 0t1BuHgIubgAvxKZdkwr52Rus8vH0eHRJtGFyOQA+4SI3NOO2X2zIG2YqTKsXcEqBXU2 4MKA== X-Gm-Message-State: AIkVDXK1uq24G8wVmvn2Lmdr/7LYSrjghNRXT9B0BykOHAHgvEASgpz8dr2TZz83pD6Tgd4P X-Received: by 10.28.8.12 with SMTP id 12mr1282762wmi.46.1482320650362; Wed, 21 Dec 2016 03:44:10 -0800 (PST) Received: from dhcp-10-192-206-197.iig.avagotech.net ([192.19.239.250]) by smtp.gmail.com with ESMTPSA id t194sm2997257wmd.1.2016.12.21.03.44.05 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 21 Dec 2016 03:44:09 -0800 (PST) From: Selvin Xavier To: dledford@redhat.com, linux-rdma@vger.kernel.org Cc: netdev@vger.kernel.org, michael.chan@broadcom.com, Selvin Xavier , Eddie Wai , Devesh Sharma , Somnath Kotur , Sriharsha Basavapatna Subject: [PATCH for bnxt_re V4 19/21] RDMA/bnxt_re: Set uverbs command mask Date: Wed, 21 Dec 2016 03:42:08 -0800 Message-Id: <1482320530-5344-20-git-send-email-selvin.xavier@broadcom.com> X-Mailer: git-send-email 2.5.5 In-Reply-To: <1482320530-5344-1-git-send-email-selvin.xavier@broadcom.com> References: <1482320530-5344-1-git-send-email-selvin.xavier@broadcom.com> 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 This patch exports available uverbs command mask to the IB stack. Also, populates some of the missing parameters in the ibdev structure used for registration. v4: Changes the include file names Signed-off-by: Eddie Wai Signed-off-by: Devesh Sharma Signed-off-by: Somnath Kotur Signed-off-by: Sriharsha Basavapatna Signed-off-by: Selvin Xavier --- drivers/infiniband/hw/bnxt_re/main.c | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/drivers/infiniband/hw/bnxt_re/main.c b/drivers/infiniband/hw/bnxt_re/main.c index 7e78da6..7bc41da 100644 --- a/drivers/infiniband/hw/bnxt_re/main.c +++ b/drivers/infiniband/hw/bnxt_re/main.c @@ -61,6 +61,7 @@ #include "qplib_rcfw.h" #include "bnxt_re.h" #include "ib_verbs.h" +#include #include "bnxt.h" static char version[] = BNXT_RE_DESC " v" ROCE_DRV_MODULE_VERSION "\n"; @@ -435,8 +436,42 @@ static int bnxt_re_register_ib(struct bnxt_re_dev *rdev) strlen(BNXT_RE_DESC) + 5); ibdev->phys_port_cnt = 1; + bnxt_qplib_get_guid(rdev->netdev->dev_addr, (u8 *)&ibdev->node_guid); + ibdev->num_comp_vectors = 1; ibdev->dma_device = &rdev->en_dev->pdev->dev; + ibdev->local_dma_lkey = BNXT_QPLIB_RSVD_LKEY; + + /* User space */ + ibdev->uverbs_abi_ver = BNXT_RE_ABI_VERSION; + ibdev->uverbs_cmd_mask = + (1ull << IB_USER_VERBS_CMD_GET_CONTEXT) | + (1ull << IB_USER_VERBS_CMD_QUERY_DEVICE) | + (1ull << IB_USER_VERBS_CMD_QUERY_PORT) | + (1ull << IB_USER_VERBS_CMD_ALLOC_PD) | + (1ull << IB_USER_VERBS_CMD_DEALLOC_PD) | + (1ull << IB_USER_VERBS_CMD_REG_MR) | + (1ull << IB_USER_VERBS_CMD_REREG_MR) | + (1ull << IB_USER_VERBS_CMD_DEREG_MR) | + (1ull << IB_USER_VERBS_CMD_CREATE_COMP_CHANNEL) | + (1ull << IB_USER_VERBS_CMD_CREATE_CQ) | + (1ull << IB_USER_VERBS_CMD_RESIZE_CQ) | + (1ull << IB_USER_VERBS_CMD_DESTROY_CQ) | + (1ull << IB_USER_VERBS_CMD_CREATE_QP) | + (1ull << IB_USER_VERBS_CMD_MODIFY_QP) | + (1ull << IB_USER_VERBS_CMD_QUERY_QP) | + (1ull << IB_USER_VERBS_CMD_DESTROY_QP) | + (1ull << IB_USER_VERBS_CMD_CREATE_SRQ) | + (1ull << IB_USER_VERBS_CMD_MODIFY_SRQ) | + (1ull << IB_USER_VERBS_CMD_QUERY_SRQ) | + (1ull << IB_USER_VERBS_CMD_DESTROY_SRQ) | + (1ull << IB_USER_VERBS_CMD_CREATE_AH) | + (1ull << IB_USER_VERBS_CMD_MODIFY_AH) | + (1ull << IB_USER_VERBS_CMD_QUERY_AH) | + (1ull << IB_USER_VERBS_CMD_DESTROY_AH); + /* POLL_CQ and REQ_NOTIFY_CQ is directly handled in libbnxt_re */ + + /* Kernel verbs */ ibdev->query_device = bnxt_re_query_device; ibdev->modify_device = bnxt_re_modify_device;