From patchwork Fri Feb 10 11:19:51 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Selvin Xavier X-Patchwork-Id: 9566599 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 886E160216 for ; Fri, 10 Feb 2017 11:29:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 756122853D for ; Fri, 10 Feb 2017 11:29:40 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 694D328559; Fri, 10 Feb 2017 11:29:40 +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 02A2E2853D for ; Fri, 10 Feb 2017 11:29:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753170AbdBJL3d (ORCPT ); Fri, 10 Feb 2017 06:29:33 -0500 Received: from mail-qt0-f177.google.com ([209.85.216.177]:33385 "EHLO mail-qt0-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753165AbdBJL3b (ORCPT ); Fri, 10 Feb 2017 06:29:31 -0500 Received: by mail-qt0-f177.google.com with SMTP id v23so31554817qtb.0 for ; Fri, 10 Feb 2017 03:29:31 -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=G9/6pDicpkz7kKKvvmCOWGxV5Jb7DTRk4Ff+ZHjv7Mo=; b=KhYZ5WM0gn5Fo5GkOV1U24lMVOAtX6aXpcaysEWJm4mOzp261s4f1DHj+jnkQMW8gK MYAs3PmBeVx0TxwdOfps6LxmB1ThVMT2NtdfGovCylgpvwdWtF1RVSvsXKSJZQzVh+zs ouJW6vp8CHrKyJ21zAwcOel6U5McLxAosUHFg= 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=G9/6pDicpkz7kKKvvmCOWGxV5Jb7DTRk4Ff+ZHjv7Mo=; b=XMwFwmLIDcglMV1hsmRCOeKip2ShljHcqTDG3rktYRprs/faI5oxzPzLvLtMj/q2QB 5SK1NEYTb/sR0sNfAQnkyGRWjapXhj9r2i7MIwqOo8htTwyB6ASzrUMs2+RvUOmS7uYi whh+wq9KyRypQtRB/775aqilG+8Bj8snHEFAwEiNPtUXcvL/vx1tVAV2EGZK1W26PEki 8WKI9k1Du4eF1UIcpM5M5DBrGfB0ulEAMwohqAWfzlFGHhcitqxm9QHIizHfocwkq2U1 hGT7eDcaDbA+qckrwFALDKRINAPgiQHYnUm1RiUBS3n9bt/QFGA12EEBhjSSnw1XJesj DH8g== X-Gm-Message-State: AMke39mGPs7dn5fTQgbidwxmzTeUrDJp4Z2eFB2i6P7shmrjP4omoRhzLTPwzLZ1c/AtMPqx X-Received: by 10.237.43.167 with SMTP id e36mr7230410qtd.169.1486725684237; Fri, 10 Feb 2017 03:21:24 -0800 (PST) Received: from dhcp-10-192-206-197.iig.avagotech.net ([192.19.239.250]) by smtp.gmail.com with ESMTPSA id z23sm1211412qkb.30.2017.02.10.03.21.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 10 Feb 2017 03:21:23 -0800 (PST) From: Selvin Xavier To: dledford@redhat.com, linux-rdma@vger.kernel.org Cc: netdev@vger.kernel.org, Selvin Xavier , Eddie Wai , Devesh Sharma , Somnath Kotur , Sriharsha Basavapatna Subject: [PATCH V5 for-next 19/21] RDMA/bnxt_re: Set uverbs command mask Date: Fri, 10 Feb 2017 03:19:51 -0800 Message-Id: <1486725593-9872-20-git-send-email-selvin.xavier@broadcom.com> X-Mailer: git-send-email 2.5.5 In-Reply-To: <1486725593-9872-1-git-send-email-selvin.xavier@broadcom.com> References: <1486725593-9872-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 92a217b..6b9f117 100644 --- a/drivers/infiniband/hw/bnxt_re/main.c +++ b/drivers/infiniband/hw/bnxt_re/main.c @@ -62,6 +62,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"; @@ -432,8 +433,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;