From patchwork Wed Jun 2 15:46:16 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Devesh Sharma X-Patchwork-Id: 12295193 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 90057C47092 for ; Wed, 2 Jun 2021 15:47:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 78F8061437 for ; Wed, 2 Jun 2021 15:47:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232229AbhFBPtS (ORCPT ); Wed, 2 Jun 2021 11:49:18 -0400 Received: from mail-pg1-f174.google.com ([209.85.215.174]:38577 "EHLO mail-pg1-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232307AbhFBPtO (ORCPT ); Wed, 2 Jun 2021 11:49:14 -0400 Received: by mail-pg1-f174.google.com with SMTP id 6so2572742pgk.5 for ; Wed, 02 Jun 2021 08:47:31 -0700 (PDT) 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 :mime-version; bh=O4QJgiz3u/6vR5mSCuRiLtLKBgBc4T3HzH6Gi50RteM=; b=YXzN4WUTIUONuhOHDmemd8G6LCDCoogKOlBcRZVrqBY4m3CfEZn7THaxb7XzZq1whe 6rhiN74M0T5qnxpki+b2oeN/letpZMtM4rp8IxXT9VRhpYDnMBkur0jzFJkmMsTWF8Rc ndmKnrO36Xn1JXbsAa+b4nPdLocZ6DgwLXlBM= 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:mime-version; bh=O4QJgiz3u/6vR5mSCuRiLtLKBgBc4T3HzH6Gi50RteM=; b=JcJFM5Do5780/GGzXTyu0ptK4PnbztjLy3f/aCLWtFHZsdgNpBVguJsfJJ/x6Hk7Va M3F0dsllYxChDTIqxKOBOmNgKJh8MnmV+PTpXRBbhtlulyzRI5gUR4E3Dtuli3lSpBVl /PrjSe1zfZnhckHZMod9ymGyTRAsTHONWW7WsUdeYOJiZlWAVnWiJXLTqYC6jEo/PmRu 2hitQZy+6fJX2wtyClhANiz6Rvd483z1kGQUujetDyrjovJQ/rAl847Ne2HtSGcrhtcZ wbkjhOhBFHMF23n/oNC3YLEDk5AiJRrbfIgbFMOYyS7DpzUHGOtW4OBDimpPdDVH1D0R TGrQ== X-Gm-Message-State: AOAM533yznW3jLRyL/x9Xx3lqWAFVjuUSj0L959YWU0yj4v4tCHl1D3D aSyLtm3He6Ra2WcKWoJkEm2oIsc9CC7uVlAp03k6xuCqWOfIkfcKROkgiQbDyfAKDpZ3Pkci3e4 Z5OthLkPUvNCts6uc5t4k72YKlP0dwPRY/7i8g+eKaKG0nGgqR+jRWdWUo99IDGuyAo/h6Tpzdu OQMfCxUA== X-Google-Smtp-Source: ABdhPJxXFUggUhkxs1vPnDQ4kEdN77aDbKlX7HXDD/mk7w5cDoSr0y4jAFHlrfUj0ucvOhYFzZGTBw== X-Received: by 2002:a65:4289:: with SMTP id j9mr34419081pgp.165.1622648791117; Wed, 02 Jun 2021 08:46:31 -0700 (PDT) Received: from dev01.dhcp.broadcom.net ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id k7sm30204pjj.46.2021.06.02.08.46.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Jun 2021 08:46:30 -0700 (PDT) From: Devesh Sharma To: linux-rdma@vger.kernel.org Cc: Devesh Sharma Subject: [PATCH V5 for-next 1/3] RDMA/bnxt_re: Enable global atomic ops if platform supports Date: Wed, 2 Jun 2021 21:16:16 +0530 Message-Id: <20210602154618.973816-2-devesh.sharma@broadcom.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210602154618.973816-1-devesh.sharma@broadcom.com> References: <20210602154618.973816-1-devesh.sharma@broadcom.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org Enabling Atomic operations for Gen P5 devices if the underlying platform supports global atomic ops. Fixes: 7ff662b76167 ("Disable atomic capability on bnxt_re adapters") Signed-off-by: Devesh Sharma --- drivers/infiniband/hw/bnxt_re/ib_verbs.c | 4 ++++ drivers/infiniband/hw/bnxt_re/main.c | 3 +++ drivers/infiniband/hw/bnxt_re/qplib_res.c | 17 +++++++++++++++++ drivers/infiniband/hw/bnxt_re/qplib_res.h | 1 + drivers/infiniband/hw/bnxt_re/qplib_sp.c | 13 ++++++++++++- drivers/infiniband/hw/bnxt_re/qplib_sp.h | 2 -- 6 files changed, 37 insertions(+), 3 deletions(-) diff --git a/drivers/infiniband/hw/bnxt_re/ib_verbs.c b/drivers/infiniband/hw/bnxt_re/ib_verbs.c index 537471ffaa79..a113d8d9e9ed 100644 --- a/drivers/infiniband/hw/bnxt_re/ib_verbs.c +++ b/drivers/infiniband/hw/bnxt_re/ib_verbs.c @@ -163,6 +163,10 @@ int bnxt_re_query_device(struct ib_device *ibdev, ib_attr->max_qp_init_rd_atom = dev_attr->max_qp_init_rd_atom; ib_attr->atomic_cap = IB_ATOMIC_NONE; ib_attr->masked_atomic_cap = IB_ATOMIC_NONE; + if (dev_attr->is_atomic) { + ib_attr->atomic_cap = IB_ATOMIC_GLOB; + ib_attr->masked_atomic_cap = IB_ATOMIC_GLOB; + } ib_attr->max_ee_rd_atom = 0; ib_attr->max_res_rd_atom = 0; diff --git a/drivers/infiniband/hw/bnxt_re/main.c b/drivers/infiniband/hw/bnxt_re/main.c index b090dfa4f4cb..0de4e22f9750 100644 --- a/drivers/infiniband/hw/bnxt_re/main.c +++ b/drivers/infiniband/hw/bnxt_re/main.c @@ -128,6 +128,9 @@ static int bnxt_re_setup_chip_ctx(struct bnxt_re_dev *rdev, u8 wqe_mode) rdev->rcfw.res = &rdev->qplib_res; bnxt_re_set_drv_mode(rdev, wqe_mode); + if (bnxt_qplib_determine_atomics(en_dev->pdev)) + ibdev_info(&rdev->ibdev, + "platform doesn't support global atomics."); return 0; } diff --git a/drivers/infiniband/hw/bnxt_re/qplib_res.c b/drivers/infiniband/hw/bnxt_re/qplib_res.c index 3ca47004b752..108a591e66ff 100644 --- a/drivers/infiniband/hw/bnxt_re/qplib_res.c +++ b/drivers/infiniband/hw/bnxt_re/qplib_res.c @@ -959,3 +959,20 @@ int bnxt_qplib_alloc_res(struct bnxt_qplib_res *res, struct pci_dev *pdev, bnxt_qplib_free_res(res); return rc; } + +int bnxt_qplib_determine_atomics(struct pci_dev *dev) +{ + int comp; + u16 ctl2; + + comp = pci_enable_atomic_ops_to_root(dev, + PCI_EXP_DEVCAP2_ATOMIC_COMP32); + if (comp) + return -ENOTSUPP; + comp = pci_enable_atomic_ops_to_root(dev, + PCI_EXP_DEVCAP2_ATOMIC_COMP64); + if (comp) + return -ENOTSUPP; + pcie_capability_read_word(dev, PCI_EXP_DEVCTL2, &ctl2); + return !(ctl2 & PCI_EXP_DEVCTL2_ATOMIC_REQ); +} diff --git a/drivers/infiniband/hw/bnxt_re/qplib_res.h b/drivers/infiniband/hw/bnxt_re/qplib_res.h index 7a1ab38b95da..d2aea52bd1d8 100644 --- a/drivers/infiniband/hw/bnxt_re/qplib_res.h +++ b/drivers/infiniband/hw/bnxt_re/qplib_res.h @@ -373,6 +373,7 @@ void bnxt_qplib_free_ctx(struct bnxt_qplib_res *res, int bnxt_qplib_alloc_ctx(struct bnxt_qplib_res *res, struct bnxt_qplib_ctx *ctx, bool virt_fn, bool is_p5); +int bnxt_qplib_determine_atomics(struct pci_dev *dev); static inline void bnxt_qplib_hwq_incr_prod(struct bnxt_qplib_hwq *hwq, u32 cnt) { diff --git a/drivers/infiniband/hw/bnxt_re/qplib_sp.c b/drivers/infiniband/hw/bnxt_re/qplib_sp.c index 049b3576302b..3d9259632eb3 100644 --- a/drivers/infiniband/hw/bnxt_re/qplib_sp.c +++ b/drivers/infiniband/hw/bnxt_re/qplib_sp.c @@ -54,6 +54,17 @@ const struct bnxt_qplib_gid bnxt_qplib_gid_zero = {{ 0, 0, 0, 0, 0, 0, 0, 0, /* Device */ +static bool bnxt_qplib_is_atomic_cap(struct bnxt_qplib_rcfw *rcfw) +{ + u16 pcie_ctl2 = 0; + + if (!bnxt_qplib_is_chip_gen_p5(rcfw->res->cctx)) + return false; + + pcie_capability_read_word(rcfw->pdev, PCI_EXP_DEVCTL2, &pcie_ctl2); + return (pcie_ctl2 & PCI_EXP_DEVCTL2_ATOMIC_REQ); +} + static void bnxt_qplib_query_version(struct bnxt_qplib_rcfw *rcfw, char *fw_ver) { @@ -162,7 +173,7 @@ int bnxt_qplib_get_dev_attr(struct bnxt_qplib_rcfw *rcfw, attr->tqm_alloc_reqs[i * 4 + 3] = *(++tqm_alloc); } - attr->is_atomic = false; + attr->is_atomic = bnxt_qplib_is_atomic_cap(rcfw); bail: bnxt_qplib_rcfw_free_sbuf(rcfw, sbuf); return rc; diff --git a/drivers/infiniband/hw/bnxt_re/qplib_sp.h b/drivers/infiniband/hw/bnxt_re/qplib_sp.h index bc228340684f..260104783691 100644 --- a/drivers/infiniband/hw/bnxt_re/qplib_sp.h +++ b/drivers/infiniband/hw/bnxt_re/qplib_sp.h @@ -42,8 +42,6 @@ #define BNXT_QPLIB_RESERVED_QP_WRS 128 -#define PCI_EXP_DEVCTL2_ATOMIC_REQ 0x0040 - struct bnxt_qplib_dev_attr { #define FW_VER_ARR_LEN 4 u8 fw_ver[FW_VER_ARR_LEN]; From patchwork Wed Jun 2 15:46:17 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Devesh Sharma X-Patchwork-Id: 12295191 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1B715C47083 for ; Wed, 2 Jun 2021 15:47:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id EFAFF61437 for ; Wed, 2 Jun 2021 15:47:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232414AbhFBPtS (ORCPT ); Wed, 2 Jun 2021 11:49:18 -0400 Received: from mail-pf1-f177.google.com ([209.85.210.177]:38865 "EHLO mail-pf1-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232340AbhFBPtQ (ORCPT ); Wed, 2 Jun 2021 11:49:16 -0400 Received: by mail-pf1-f177.google.com with SMTP id z26so2510200pfj.5 for ; Wed, 02 Jun 2021 08:47:33 -0700 (PDT) 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 :mime-version; bh=d8Pu6nFzOEuy68a7SYWOCuN9t6XYb5Hfso5TywbdJWg=; b=GIXkDobavxwtSKrUoBv7whhxiCkWWUqmZx5qoKmEuVc1sjguNLBY/qEXhw2an25pMy f785cDv+TNeWp65cYjYyxKPljXn2qGis3ziEbVnFMifkSugEKO0tHctO2nVU3Bwbd2Zj 4sqJ8KimcamMD8dxYQj0Eg9IFYct2PFZ9TqBY= 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:mime-version; bh=d8Pu6nFzOEuy68a7SYWOCuN9t6XYb5Hfso5TywbdJWg=; b=qTvZbcg7S8Lgj2mCu3Hk02L7XujTJpF5u1i+lJZ5uM8KIh0nsxx+ne5kYq6lgI0wOt Ed355FQ5FmqYyH7svv2c48eFcUiqky5WY0JcfSlqTALEr6dRLiCr62VztP5911H+HEna 3LR2nTNOJ38CQdkOUaUXuNftxh+aFVoHXyamHj4hQcH1jSSO5ZlP8m74z2p+EJUa7TBx GHH8H/Kg/WEC7ZzNe8bBRvOkM/EjS6msZcGZ3aR1T0AAhYcIx/Il3eL7aw+iGHPbpcDt lMz8P8q7rs/IwclHbv+UYBjw9CBUK+JjsPtiDoJ3e7JJL2SuysxBGzSB14N71ivC7Fu6 awdw== X-Gm-Message-State: AOAM532oZ+oYJeqqU/AA+UG3VAlwoLFU2/COwPogO1D54m9Y3Q36BQBa 4rFx4zH/w7CUjmaerdeIiL2bJCaO3ChHvWaOtS4X9MXxjoQ3bRk1Q/VMVgz+gYzTK22WUkJ/WxE kyfrwwxJ9p9hAmSBjUElogjDuzxVBoEJz5X13vLvMKCUl8cV36W+LsOgs/xyLz3ylICrHjftOQ6 OOd7xhbg== X-Google-Smtp-Source: ABdhPJxcIhQjMh5UoHFDx+sPjctX2/fj+JcMP3QpmacfAv+Td00WZdv1dwmhQjtl5mTUfFkynlqgbA== X-Received: by 2002:a63:1b09:: with SMTP id b9mr34606124pgb.354.1622648792812; Wed, 02 Jun 2021 08:46:32 -0700 (PDT) Received: from dev01.dhcp.broadcom.net ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id k7sm30204pjj.46.2021.06.02.08.46.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Jun 2021 08:46:32 -0700 (PDT) From: Devesh Sharma To: linux-rdma@vger.kernel.org Cc: Devesh Sharma Subject: [PATCH V5 for-next 2/3] bnxt_re: Update maintainers list Date: Wed, 2 Jun 2021 21:16:17 +0530 Message-Id: <20210602154618.973816-3-devesh.sharma@broadcom.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210602154618.973816-1-devesh.sharma@broadcom.com> References: <20210602154618.973816-1-devesh.sharma@broadcom.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org Updated the maintainers list and removed non-active members. Signed-off-by: Devesh Sharma --- MAINTAINERS | 2 -- 1 file changed, 2 deletions(-) diff --git a/MAINTAINERS b/MAINTAINERS index bd7aff0c120f..786573a556b9 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -3736,8 +3736,6 @@ F: drivers/gpio/gpio-bcm-kona.c BROADCOM NETXTREME-E ROCE DRIVER M: Selvin Xavier M: Devesh Sharma -M: Somnath Kotur -M: Sriharsha Basavapatna M: Naresh Kumar PBS L: linux-rdma@vger.kernel.org S: Supported From patchwork Wed Jun 2 15:46:18 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Devesh Sharma X-Patchwork-Id: 12295185 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D6026C4708F for ; Wed, 2 Jun 2021 15:46:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B1AE4610A1 for ; Wed, 2 Jun 2021 15:46:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231837AbhFBPsS (ORCPT ); Wed, 2 Jun 2021 11:48:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56568 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231770AbhFBPsS (ORCPT ); Wed, 2 Jun 2021 11:48:18 -0400 Received: from mail-pf1-x434.google.com (mail-pf1-x434.google.com [IPv6:2607:f8b0:4864:20::434]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7D996C061574 for ; Wed, 2 Jun 2021 08:46:35 -0700 (PDT) Received: by mail-pf1-x434.google.com with SMTP id t28so2485297pfg.10 for ; Wed, 02 Jun 2021 08:46:35 -0700 (PDT) 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 :mime-version; bh=j0FJxOFYLJLVRqClp4JQ6sPTgxnrGD6HhrCiq72Lrwo=; b=WADkFldzO/ZaMNMulsgSlCYXDArm1fRoyFPU78wisXwCqDSaDk8NlG0VhYjS89lLI1 eq0jV5o5CEgcMNEYGf/zy4HZkvKqWZ5DFToOCUoGgdmRhP1QBE0RHIodLnnGHBjQoRjG krViKKA1Pmmx/mhRVek5pC3xTASgLCnEXuuU8= 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:mime-version; bh=j0FJxOFYLJLVRqClp4JQ6sPTgxnrGD6HhrCiq72Lrwo=; b=jTECw1PSDnNz9CXGxeGKGNCihf5tBHzuuMJeaavA1JLVyc/6wfEA4a4EhnaUDjWzCi PQJKjELuUg7xeW7IJ+VM40GeVXHwCIO6F9Z3NDMe/5ZIAgZeGa87phSYO2oCmoTilyaI KTC2fnIJ/80ixc420SuIPZtoYhWVxjtgXYiI6fckR/rY41x7Xc6bYBG/sG9fXz4kyf2r R393bEgTH/GPiTlmdKxJL2GbJ22xUuMtlX4KSxzIz4pSm8SafwvI9r3rzTqgeTaoE0h2 EnMUjk5DpSsb+fweXNi4ul7r1XAdFiFg8uVsUcRZG7OFr3kldy4qqpe9dFaqPotdXtRL sB+g== X-Gm-Message-State: AOAM532JkTzYeUv2yiVenGmv5VmCwMgSMcMuqBco+DJcRdVntkjCAHe9 UmSsl4+IgrtQxWMVnRwzprTKuRTUtqoLm3eB08i3f4/nSnW60v6ds8+KMb5dO88N/wfpUqx3k28 Lx4BP04gCtbgw4mTI4Osg2HdmRE2THg6Q4to9/0dORkyyb63Ms0od59AHwohhOqHfWNcQ/Al92c tE4Zyhkw== X-Google-Smtp-Source: ABdhPJytkJn6HCK/+IDWAHuHMtQcZtNOdsj5CV38xzflK/5qMhDrHvo0VhfguQ+7Xbj4YOJXNEWtJA== X-Received: by 2002:a63:7204:: with SMTP id n4mr34979937pgc.78.1622648794565; Wed, 02 Jun 2021 08:46:34 -0700 (PDT) Received: from dev01.dhcp.broadcom.net ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id k7sm30204pjj.46.2021.06.02.08.46.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Jun 2021 08:46:34 -0700 (PDT) From: Devesh Sharma To: linux-rdma@vger.kernel.org Cc: Devesh Sharma Subject: [PATCH V5 for-next 3/3] RDMA/bnxt_re: update ABI to pass wqe-mode to user space Date: Wed, 2 Jun 2021 21:16:18 +0530 Message-Id: <20210602154618.973816-4-devesh.sharma@broadcom.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210602154618.973816-1-devesh.sharma@broadcom.com> References: <20210602154618.973816-1-devesh.sharma@broadcom.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org Changing ucontext ABI response structure to pass wqe_mode to user library. A flag in comp_mask has been set to indicate presence of wqe_mode. Signed-off-by: Devesh Sharma --- drivers/infiniband/hw/bnxt_re/ib_verbs.c | 3 +++ include/uapi/rdma/bnxt_re-abi.h | 5 ++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/infiniband/hw/bnxt_re/ib_verbs.c b/drivers/infiniband/hw/bnxt_re/ib_verbs.c index a113d8d9e9ed..5955713234cb 100644 --- a/drivers/infiniband/hw/bnxt_re/ib_verbs.c +++ b/drivers/infiniband/hw/bnxt_re/ib_verbs.c @@ -3882,6 +3882,9 @@ int bnxt_re_alloc_ucontext(struct ib_ucontext *ctx, struct ib_udata *udata) resp.max_cqd = dev_attr->max_cq_wqes; resp.rsvd = 0; + resp.comp_mask |= BNXT_RE_UCNTX_CMASK_HAVE_MODE; + resp.mode = rdev->chip_ctx->modes.wqe_mode; + rc = ib_copy_to_udata(udata, &resp, min(udata->outlen, sizeof(resp))); if (rc) { ibdev_err(ibdev, "Failed to copy user context"); diff --git a/include/uapi/rdma/bnxt_re-abi.h b/include/uapi/rdma/bnxt_re-abi.h index dc52e3cf574c..52205ed2b898 100644 --- a/include/uapi/rdma/bnxt_re-abi.h +++ b/include/uapi/rdma/bnxt_re-abi.h @@ -49,7 +49,8 @@ #define BNXT_RE_CHIP_ID0_CHIP_MET_SFT 0x18 enum { - BNXT_RE_UCNTX_CMASK_HAVE_CCTX = 0x1ULL + BNXT_RE_UCNTX_CMASK_HAVE_CCTX = 0x1ULL, + BNXT_RE_UCNTX_CMASK_HAVE_MODE = 0x02ULL }; struct bnxt_re_uctx_resp { @@ -62,6 +63,8 @@ struct bnxt_re_uctx_resp { __aligned_u64 comp_mask; __u32 chip_id0; __u32 chip_id1; + __u32 mode; + __u32 rsvd1; /* padding */ }; /*