From patchwork Wed Jun 2 04:28:39 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Devesh Sharma X-Patchwork-Id: 12292837 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 01A0EC47092 for ; Wed, 2 Jun 2021 04:29:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D0EEF61075 for ; Wed, 2 Jun 2021 04:29:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229581AbhFBEbg (ORCPT ); Wed, 2 Jun 2021 00:31:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44170 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229516AbhFBEbe (ORCPT ); Wed, 2 Jun 2021 00:31:34 -0400 Received: from mail-pj1-x102c.google.com (mail-pj1-x102c.google.com [IPv6:2607:f8b0:4864:20::102c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 664DDC06175F for ; Tue, 1 Jun 2021 21:28:58 -0700 (PDT) Received: by mail-pj1-x102c.google.com with SMTP id ei4so926727pjb.3 for ; Tue, 01 Jun 2021 21:28:58 -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=UkrCmBBAm9eP7VPLBeulDrHuKTF3vMyVVtqsxEtE/08=; b=QtUEA5dfSYfRxWEHVfXlGcVM/QNUTsjou9J/p3lF8VQIZnwECfskW6On8rd9b+kIzc e8qqo6tri4xovQewOyx8HFwT62P+qPNYHfLTe0Fp15/YZS1SUIvjkiQPjo+DpfAiwuet 2bg+ANZfyIIw4b8zxqAq1gfUkV1ntNk20jrgg= 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=UkrCmBBAm9eP7VPLBeulDrHuKTF3vMyVVtqsxEtE/08=; b=beSmN90R9r3WFMWR7vb4w8r1ovufwDm/NYhVl+DuNNk6FJwh2/fl3RL7a0MzhDMXUT gpYXoywY4D/UjqXMJPFl+ZRQQPNeTqQKgYVBl/0T+Err5yCAioS29HU/MAo+jwfAE9Jx FwhfY0/0MGn6cA8riqI+ZQI4l1Qlhv+HchxtN2cgurPVlAPaKDNsGZaMULAOX4sks0ZI 6o0pnmMnlT5l6lvMMRS8+XzGp6WhKNcKCHknu3LQTFPN0tlmUmaoL2ePyThIPNS+PZRO iG4p1mquM1LR1uiB3T8SX8MMuT9lGWbAbO4UuESNPJQS5w6ktjh7bpm+pj2gc7UqQn/t 7OoA== X-Gm-Message-State: AOAM532mDbcwGGkWzXiLLgeA2RAesQxwSbXfkbQp2PqzTAN8ZvrTy2YW +Zr0c/7shvI3cPc9UHC5aaivaqVsfeMnW+AcUoYj42W5DS87OCyVIrjNGA1DxX2sQ98PWjKu+ku EZOOQTOgKj/Mfaat63m5uj1t97inDcd/oYlbV5FOQYFr913OYhG6ZYUyykU/qnxxN3ccm6/grxj uLDmQtww== X-Google-Smtp-Source: ABdhPJw22JPS70UKIuxP68iTfhD5V39R43mwEFka91ffYPcyAKiYYBvqmmAs0b9ewvJstEqMMtG5rg== X-Received: by 2002:a17:90a:117:: with SMTP id b23mr28635633pjb.183.1622608137355; Tue, 01 Jun 2021 21:28:57 -0700 (PDT) Received: from dev01.dhcp.broadcom.net ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id b7sm14052547pfv.149.2021.06.01.21.28.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Jun 2021 21:28:57 -0700 (PDT) From: Devesh Sharma To: linux-rdma@vger.kernel.org Cc: Devesh Sharma Subject: [PATCH V4 for-next 3/3] RDMA/bnxt_re: update ABI to pass wqe-mode to user space Date: Wed, 2 Jun 2021 09:58:39 +0530 Message-Id: <20210602042839.968833-4-devesh.sharma@broadcom.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210602042839.968833-1-devesh.sharma@broadcom.com> References: <20210602042839.968833-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 */ }; /*