Skip to content

Commit 8797405

Browse files
Devesh Sharmajgunthorpe
authored andcommitted
RDMA/bnxt_re: Update ABI to pass wqe-mode to user space
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 Link: https://lore.kernel.org/r/20210616202817.1185276-1-devesh.sharma@broadcom.com Signed-off-by: Devesh Sharma <devesh.sharma@broadcom.com> Reviewed-by: Leon Romanovsky <leonro@nvidia.com> Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
1 parent 84dcd8c commit 8797405

4 files changed

Lines changed: 15 additions & 7 deletions

File tree

‎drivers/infiniband/hw/bnxt_re/ib_verbs.c‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3882,6 +3882,9 @@ int bnxt_re_alloc_ucontext(struct ib_ucontext *ctx, struct ib_udata *udata)
38823882
resp.max_cqd = dev_attr->max_cq_wqes;
38833883
resp.rsvd = 0;
38843884

3885+
resp.comp_mask |= BNXT_RE_UCNTX_CMASK_HAVE_MODE;
3886+
resp.mode = rdev->chip_ctx->modes.wqe_mode;
3887+
38853888
rc = ib_copy_to_udata(udata, &resp, min(udata->outlen, sizeof(resp)));
38863889
if (rc) {
38873890
ibdev_err(ibdev, "Failed to copy user context");

‎drivers/infiniband/hw/bnxt_re/qplib_fp.h‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@
3939
#ifndef __BNXT_QPLIB_FP_H__
4040
#define __BNXT_QPLIB_FP_H__
4141

42+
#include <rdma/bnxt_re-abi.h>
43+
4244
/* Few helper structures temporarily defined here
4345
* should get rid of these when roce_hsi.h is updated
4446
* in original code base

‎drivers/infiniband/hw/bnxt_re/qplib_res.h‎

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,6 @@ extern const struct bnxt_qplib_gid bnxt_qplib_gid_zero;
4545
#define CHIP_NUM_57504 0x1751
4646
#define CHIP_NUM_57502 0x1752
4747

48-
enum bnxt_qplib_wqe_mode {
49-
BNXT_QPLIB_WQE_MODE_STATIC = 0x00,
50-
BNXT_QPLIB_WQE_MODE_VARIABLE = 0x01,
51-
BNXT_QPLIB_WQE_MODE_INVALID = 0x02
52-
};
53-
5448
struct bnxt_qplib_drv_modes {
5549
u8 wqe_mode;
5650
/* Other modes to follow here */

‎include/uapi/rdma/bnxt_re-abi.h‎

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,14 @@
4949
#define BNXT_RE_CHIP_ID0_CHIP_MET_SFT 0x18
5050

5151
enum {
52-
BNXT_RE_UCNTX_CMASK_HAVE_CCTX = 0x1ULL
52+
BNXT_RE_UCNTX_CMASK_HAVE_CCTX = 0x1ULL,
53+
BNXT_RE_UCNTX_CMASK_HAVE_MODE = 0x02ULL,
54+
};
55+
56+
enum bnxt_re_wqe_mode {
57+
BNXT_QPLIB_WQE_MODE_STATIC = 0x00,
58+
BNXT_QPLIB_WQE_MODE_VARIABLE = 0x01,
59+
BNXT_QPLIB_WQE_MODE_INVALID = 0x02,
5360
};
5461

5562
struct bnxt_re_uctx_resp {
@@ -62,6 +69,8 @@ struct bnxt_re_uctx_resp {
6269
__aligned_u64 comp_mask;
6370
__u32 chip_id0;
6471
__u32 chip_id1;
72+
__u32 mode;
73+
__u32 rsvd1; /* padding */
6574
};
6675

6776
/*

0 commit comments

Comments
 (0)