From patchwork Wed May 26 15:36:27 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Devesh Sharma X-Patchwork-Id: 12282157 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, 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 C9BACC47088 for ; Wed, 26 May 2021 15:36:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A9E3961002 for ; Wed, 26 May 2021 15:36:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232913AbhEZPiR (ORCPT ); Wed, 26 May 2021 11:38:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48992 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233675AbhEZPiQ (ORCPT ); Wed, 26 May 2021 11:38:16 -0400 Received: from mail-pj1-x1036.google.com (mail-pj1-x1036.google.com [IPv6:2607:f8b0:4864:20::1036]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 32BB8C061756 for ; Wed, 26 May 2021 08:36:45 -0700 (PDT) Received: by mail-pj1-x1036.google.com with SMTP id k5so1008708pjj.1 for ; Wed, 26 May 2021 08:36:45 -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=IkeI+ydRt/4XYMLwmEyfljlSDRLCvkCSMtIwLATLWDc=; b=FNOb6pVdCAfqnRhv0iGjlPNeNnyEOSRtfOgTMLSczkoO/y7+3t868CqRJfs8qtkVk5 IIy3i9uQ+O9LN1kSWejOq9RdeP5KMpZJRULxZXGjQ+yQQigLRvedkpyN0grHH7ax02x/ 59mFzAhSBEZZ46o8iCIi5vo2/F5Dl/ChhUHL0= 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=IkeI+ydRt/4XYMLwmEyfljlSDRLCvkCSMtIwLATLWDc=; b=h0y88PIWQJC7UVywF/0CsU/J5tw+wpAre94xmNeIyu82+sGnZPHx6k3dE5iduf91sn DaQnt2xf58iSAiFG0BF5nycdEOzT1z0iAPKH3vHz1fFe3g2wWHZp6zlzNSqPVH0M5F1h 4FmNiqZXvlYnNAFKezLstvyP2NBN0tLIc+G5BgmaRKJrm/1FLxo3CLCY9v6i/MkO8aK4 egxzUHZLukiOhX0qrsQrz+qGk+HIJwmXIi+Hxx+QqveoDxXC8syTXxlCpu9DDCbXWmPC uK2kwVVZ0QZ+AA1Btt52jU8R5/WleklEBd1LfgqVctHAESYeUXPPhN/+4vkw8SnEXB5W zzUg== X-Gm-Message-State: AOAM531kXvU6cbxzIQAmVx26YnkADwSXt97QmZT+j4tEiEPIPUoMKstj yjVZM2PbR+F9FdOdyb2fSW0Zlx7mNJ6iR/+KRfD68P44GRLd3SF6AoRwIxUCvjG2FkYkhCxSYlv EOmLMek1s9kyCBk7ZmGZxQ3x54NkUh1EWwcZ+/AsVSyD+YR2NpQK6vO3DapPX0Cpu+7JIoe6RYP UQUQNtybia X-Google-Smtp-Source: ABdhPJyBW5ah5Acwy0JIiqV5ULNYmg1MZ0XU1GxtNpcmtsQZEuJwUWclByVP0O0kCYvPlVHBGZdVVw== X-Received: by 2002:a17:90a:7bcc:: with SMTP id d12mr4644400pjl.230.1622043403846; Wed, 26 May 2021 08:36:43 -0700 (PDT) Received: from dev01.dhcp.broadcom.net ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id 125sm15887052pfg.52.2021.05.26.08.36.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 May 2021 08:36:43 -0700 (PDT) From: Devesh Sharma To: linux-rdma@vger.kernel.org Cc: Devesh Sharma Subject: [PATCH for-next V3 1/3] RDMA/bnxt_re: Enable global atomic ops if platform supports Date: Wed, 26 May 2021 21:06:27 +0530 Message-Id: <20210526153629.872796-2-devesh.sharma@broadcom.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210526153629.872796-1-devesh.sharma@broadcom.com> References: <20210526153629.872796-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 | 4 ++++ drivers/infiniband/hw/bnxt_re/qplib_res.c | 15 +++++++++++++++ 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, 36 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..ee0cdf89eb1a 100644 --- a/drivers/infiniband/hw/bnxt_re/main.c +++ b/drivers/infiniband/hw/bnxt_re/main.c @@ -128,6 +128,10 @@ 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..4de9359c2028 100644 --- a/drivers/infiniband/hw/bnxt_re/qplib_res.c +++ b/drivers/infiniband/hw/bnxt_re/qplib_res.c @@ -959,3 +959,18 @@ int bnxt_qplib_alloc_res(struct bnxt_qplib_res *res, struct pci_dev *pdev, bnxt_qplib_free_res(res); return rc; } + +bool bnxt_qplib_determine_atomics(struct pci_dev *dev) +{ + u16 ctl2; + + if(pci_enable_atomic_ops_to_root(dev, PCI_EXP_DEVCAP2_ATOMIC_COMP32) && + pci_enable_atomic_ops_to_root(dev, PCI_EXP_DEVCAP2_ATOMIC_COMP64)) + return true; /* Failure */ + pcie_capability_read_word(dev, PCI_EXP_DEVCTL2, &ctl2); + if (ctl2 & PCI_EXP_DEVCTL2_ATOMIC_REQ) + return 0; /* Success */ + pcie_capability_set_word(dev, PCI_EXP_DEVCTL2, + PCI_EXP_DEVCTL2_ATOMIC_REQ); + return 0; /* Success */ +} diff --git a/drivers/infiniband/hw/bnxt_re/qplib_res.h b/drivers/infiniband/hw/bnxt_re/qplib_res.h index 7a1ab38b95da..fb7fde4fed56 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); +bool 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..57407be16f27 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 u8 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 May 26 15:36:28 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Devesh Sharma X-Patchwork-Id: 12282159 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, 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 33EF7C4708A for ; Wed, 26 May 2021 15:36:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 17722613D2 for ; Wed, 26 May 2021 15:36:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233869AbhEZPiS (ORCPT ); Wed, 26 May 2021 11:38:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49002 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233675AbhEZPiR (ORCPT ); Wed, 26 May 2021 11:38:17 -0400 Received: from mail-pf1-x42a.google.com (mail-pf1-x42a.google.com [IPv6:2607:f8b0:4864:20::42a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A1E1CC061574 for ; Wed, 26 May 2021 08:36:46 -0700 (PDT) Received: by mail-pf1-x42a.google.com with SMTP id p39so1202419pfw.8 for ; Wed, 26 May 2021 08:36:46 -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=xxecT+hhQzdBkwBe1bHPjqfkxvxsnQxZY3b9+FjPhak=; b=bE5HOHbWqin5T2eIm60xOmrqf2fmwmRRtxjREosysg8tCuR/DSQwS4D+I8o9HMXWJj ii0lA7+zsvEl50vGjw+JWVJaCSsrlNC0pQpkeoR2bpi8mLy7kBjhmhPRUxzrmRo4z5fB UmeZQ6fhgsgLh0jaiuJTMarTxzdRKleXoZbuE= 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=xxecT+hhQzdBkwBe1bHPjqfkxvxsnQxZY3b9+FjPhak=; b=HOJFE79Hskpn4nYZvm2odLGo1vzcW9ilZpWEfkIl7vKVnFVwNoFZ/C5z5vmC+Fuvq5 xR4CdpM/NfVm6aOWAm3CDpVm9oMC+6KTmkIFlapa2DJFRjik/xhKwUfT35QR3vZiG4XH o2agMnSjaICWKiRuWP9xMuYN57jvlrrvtOKs7xDPIM+JeY4FytJ/LNclDxh7bz5F3fpD riSSxtjXPw+GBqt5PbDbav3kNoEQ+eueprV4EhQC9DXLXo/hJUSgb0cmj4lIbBSigCNC CTrFXhCy5q3podXQYiO9GFD+CNTfwQBFzBa0SNbgYniCsJ8UtFDNL3yfGA8qePiHXVAi p13Q== X-Gm-Message-State: AOAM532/KXyM8dAsK9/oP8ocXP0Q7SGHbrLUMNgerqYCYl8zNQOOUtDZ C/G+2oZWC+umGIQoddBrEy3e6urjgQO0D63P8hmhxWsoVtnScKqSSyoaEEZJzwRJNFc2rEwJyTE bgFb0TKQ0kfya0jw36UXoShQRNdphbSmW3PXugsDaRlnHe2d5k+OJ3y3+5jbIIQjoIPjuIiYjVO uNvO2CsY4l X-Google-Smtp-Source: ABdhPJwYDlsycYS8POCdkSX1moTqZ871i7lqT2NOes90asAWJwrIwdxNUsUcLkX99ZfPn8doZFefcA== X-Received: by 2002:a05:6a00:1996:b029:2e0:9d87:a547 with SMTP id d22-20020a056a001996b02902e09d87a547mr35422591pfl.12.1622043405614; Wed, 26 May 2021 08:36:45 -0700 (PDT) Received: from dev01.dhcp.broadcom.net ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id 125sm15887052pfg.52.2021.05.26.08.36.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 May 2021 08:36:45 -0700 (PDT) From: Devesh Sharma To: linux-rdma@vger.kernel.org Cc: Devesh Sharma Subject: [PATCH for-next V3 2/3] bnxt_re: Update maintainers list Date: Wed, 26 May 2021 21:06:28 +0530 Message-Id: <20210526153629.872796-3-devesh.sharma@broadcom.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210526153629.872796-1-devesh.sharma@broadcom.com> References: <20210526153629.872796-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 May 26 15:36:29 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Devesh Sharma X-Patchwork-Id: 12282161 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, 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 10AE9C47082 for ; Wed, 26 May 2021 15:36:50 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E81BB613D2 for ; Wed, 26 May 2021 15:36:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234282AbhEZPiU (ORCPT ); Wed, 26 May 2021 11:38:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49010 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233675AbhEZPiU (ORCPT ); Wed, 26 May 2021 11:38:20 -0400 Received: from mail-pj1-x1035.google.com (mail-pj1-x1035.google.com [IPv6:2607:f8b0:4864:20::1035]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 98928C061574 for ; Wed, 26 May 2021 08:36:48 -0700 (PDT) Received: by mail-pj1-x1035.google.com with SMTP id mp9-20020a17090b1909b029015fd1e3ad5aso538211pjb.3 for ; Wed, 26 May 2021 08:36:48 -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=RHLX+iPMXbs+cYCj3WSL3X91LRmnFnRPQ7jh4boRBro=; b=WUnHUfTDzw6wWilm6HMgSVHq3Uerx5f56MDytGvYpFwxNmtbb1PsfM5O1P5utrJgLl FvmQeh8brIWKexbvYKRrFj9RFXmdTqWtMn9SAbkpZPU+1LVXTInvvh1w530ZZNnBsDei x0WM1nh64K7D5llhuE5TFXqQhBpN1F9S0fQn0= 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=RHLX+iPMXbs+cYCj3WSL3X91LRmnFnRPQ7jh4boRBro=; b=T3wB0du/Gy5FFqoNLLh/fOO8OKJmM/oGEzq7CeElXTy3GJ6p81J+j/S6uDWiAY0yoM QCQ4ehQDQZMuHjVEHF/bBbQ+5XCR89kG3HZBT219uQ2LvaJfv9xN0MvYvVxIQPZcKZu/ GedNsIUc61lITz1o2WKL0hb5p1HzP4s8zq1Z8C84blRxj3sLZoYSDfuyPacs6N7o4xMP zAnIOGiOZzsvSIu90CUsskSNsX6dX7wCVW29/1MOeESgludQ5T34+z1dB1rLvtra+EVn ufyBO9AzrtsaMtaTe3RizNrGNSdOQDodwuRd6s4B2mKn7cJjmKpCT2wHIHe7gdMd4uaY zqaQ== X-Gm-Message-State: AOAM533tNJbZvjQEO69MRdLp82KzWOpuyTVRuYV7yTYuu6QR4sEDU74u OMRk5jdpHyKFvKqscfgkTV9MHHOf12khUxEG/JwrQWUo5sX6NkKFpAaEjrSyP5JoqsrmofGk4lx 06NonhMEOwPJjN+B1nFx9BwyWibKngq5vhHW/erKeZVfg6+VbdRbXAVzUqQewv+1jxSavC8F/ox +8pRK2GzLZ X-Google-Smtp-Source: ABdhPJz86lNrtRDn/LE+YWvHCwc1Dw5RXyDaVP/zNRgZA+WnAU4lK+yjxH2PFg1I42yhYmn+KbMhaA== X-Received: by 2002:a17:90a:cc06:: with SMTP id b6mr4592424pju.19.1622043407312; Wed, 26 May 2021 08:36:47 -0700 (PDT) Received: from dev01.dhcp.broadcom.net ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id 125sm15887052pfg.52.2021.05.26.08.36.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 May 2021 08:36:46 -0700 (PDT) From: Devesh Sharma To: linux-rdma@vger.kernel.org Cc: Devesh Sharma Subject: [PATCH for-next V3 3/3] RDMA/bnxt_re: update ABI to pass wqe-mode to user space Date: Wed, 26 May 2021 21:06:29 +0530 Message-Id: <20210526153629.872796-4-devesh.sharma@broadcom.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210526153629.872796-1-devesh.sharma@broadcom.com> References: <20210526153629.872796-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 */ }; /*