From patchwork Wed Jun 16 20:28: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: 12325889 X-Patchwork-Delegate: jgg@ziepe.ca 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=-17.9 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,MIME_NO_TEXT, 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 10E3BC48BE5 for ; Wed, 16 Jun 2021 20:28:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E6E3861003 for ; Wed, 16 Jun 2021 20:28:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233480AbhFPUam (ORCPT ); Wed, 16 Jun 2021 16:30:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49638 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233451AbhFPUaj (ORCPT ); Wed, 16 Jun 2021 16:30:39 -0400 Received: from mail-pf1-x432.google.com (mail-pf1-x432.google.com [IPv6:2607:f8b0:4864:20::432]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A48F7C061574 for ; Wed, 16 Jun 2021 13:28:32 -0700 (PDT) Received: by mail-pf1-x432.google.com with SMTP id p13so3198637pfw.0 for ; Wed, 16 Jun 2021 13:28:32 -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:mime-version; bh=mnY0Kerl3gsbbglOpnQpCUHI2cutJAceKRM61jjXBG8=; b=F5rCnConAETQtSV0qCFQQqLSrwOfMCQ7iQRAZ3wADZEyYN7nWYoAHPb8jnvv4bnk9A WUj4QNUR4RLxQqjia/ZsIv1Cxt0F3zNGDuPDLGmhA0VfQ0yh9AKiEVMKyUKc8E9NGSax /jqCQIIZVd5TOgihr5tUBFymKyNMvqGknUUMk= 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:mime-version; bh=mnY0Kerl3gsbbglOpnQpCUHI2cutJAceKRM61jjXBG8=; b=pWTjM6m09ycfmP49NjAeLaaGDif62AFxXdlvGnaJB+4kTYU367TGPoO2NfMCHszjIF WXkdCgFrsDahJhEvF2ykr9VjKe8sjv1kFk52x+h37/xqTB7iPzKpy9qPvKWv2A7J9hoA Ww/AR4lFzf9imJPiWtEVvSdj2nptnb0hnhKIEsT6mUD+jy+YtOh9VJ0/JmHO+oUPYZI/ 8QDHr2R/yN2aDN1HvPsPYTNO55TfRJKZ+DGSe+F5rLD6Ex2u42AZqwH+llrvecA+q0ng g3Tq5/xWqZSWDIoptSt4BM7G0NmJxG9NeaCgQ645j//67/i1PXGrEiEGeGtxPD1w9Rpd xFQw== X-Gm-Message-State: AOAM5330odi85F4FH5+dpKSnndOi0lCK4oHMAYjVCMFH1gg7PktVt+6O D3T0M5V0FbagKj9e2XsCZY7p6taanjnGWHCuzxKTb8vjm7AqKFMYdVasyEoM47jULaGDdaQ0qkD lVxYIBjJJ1rStxcNay3T9ImfQ9pkqH2zRQP7OCGx1YZzDakDu7d8Xv/cmqQcBa4ptlx2WT54Whf x4eerhmQ== X-Google-Smtp-Source: ABdhPJwHG2m6jbbZBjLkkuIVRZXfMcEfrOMj0EH9KOXfq0pXuCOc3JKb8uenUL1uce3bDjEyYOL9kQ== X-Received: by 2002:a63:f955:: with SMTP id q21mr1428293pgk.448.1623875311624; Wed, 16 Jun 2021 13:28:31 -0700 (PDT) Received: from dev01.dhcp.broadcom.net ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id s123sm2910498pfb.78.2021.06.16.13.28.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Jun 2021 13:28:31 -0700 (PDT) From: Devesh Sharma To: linux-rdma@vger.kernel.org Cc: Devesh Sharma Subject: [PATCH V8 for-next] RDMA/bnxt_re: update ABI to pass wqe-mode to user space Date: Thu, 17 Jun 2021 01:58:17 +0530 Message-Id: <20210616202817.1185276-1-devesh.sharma@broadcom.com> X-Mailer: git-send-email 2.25.1 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. Moved wqe-mode ABI to uapi/rdma/bnxt_re-abi.h Signed-off-by: Devesh Sharma Reviewed-by: Leon Romanovsky --- drivers/infiniband/hw/bnxt_re/ib_verbs.c | 3 +++ drivers/infiniband/hw/bnxt_re/qplib_fp.h | 2 ++ drivers/infiniband/hw/bnxt_re/qplib_res.h | 6 ------ include/uapi/rdma/bnxt_re-abi.h | 11 ++++++++++- 4 files changed, 15 insertions(+), 7 deletions(-) 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/drivers/infiniband/hw/bnxt_re/qplib_fp.h b/drivers/infiniband/hw/bnxt_re/qplib_fp.h index f50784405e27..037501952543 100644 --- a/drivers/infiniband/hw/bnxt_re/qplib_fp.h +++ b/drivers/infiniband/hw/bnxt_re/qplib_fp.h @@ -39,6 +39,8 @@ #ifndef __BNXT_QPLIB_FP_H__ #define __BNXT_QPLIB_FP_H__ +#include + /* Few helper structures temporarily defined here * should get rid of these when roce_hsi.h is updated * in original code base diff --git a/drivers/infiniband/hw/bnxt_re/qplib_res.h b/drivers/infiniband/hw/bnxt_re/qplib_res.h index d2aea52bd1d8..c291f495ae91 100644 --- a/drivers/infiniband/hw/bnxt_re/qplib_res.h +++ b/drivers/infiniband/hw/bnxt_re/qplib_res.h @@ -45,12 +45,6 @@ extern const struct bnxt_qplib_gid bnxt_qplib_gid_zero; #define CHIP_NUM_57504 0x1751 #define CHIP_NUM_57502 0x1752 -enum bnxt_qplib_wqe_mode { - BNXT_QPLIB_WQE_MODE_STATIC = 0x00, - BNXT_QPLIB_WQE_MODE_VARIABLE = 0x01, - BNXT_QPLIB_WQE_MODE_INVALID = 0x02 -}; - struct bnxt_qplib_drv_modes { u8 wqe_mode; /* Other modes to follow here */ diff --git a/include/uapi/rdma/bnxt_re-abi.h b/include/uapi/rdma/bnxt_re-abi.h index dc52e3cf574c..b1de99bf56ce 100644 --- a/include/uapi/rdma/bnxt_re-abi.h +++ b/include/uapi/rdma/bnxt_re-abi.h @@ -49,7 +49,14 @@ #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, +}; + +enum bnxt_re_wqe_mode { + BNXT_QPLIB_WQE_MODE_STATIC = 0x00, + BNXT_QPLIB_WQE_MODE_VARIABLE = 0x01, + BNXT_QPLIB_WQE_MODE_INVALID = 0x02, }; struct bnxt_re_uctx_resp { @@ -62,6 +69,8 @@ struct bnxt_re_uctx_resp { __aligned_u64 comp_mask; __u32 chip_id0; __u32 chip_id1; + __u32 mode; + __u32 rsvd1; /* padding */ }; /*