Skip to content

Commit eb7f84e

Browse files
Michal Kalderonjgunthorpe
authored andcommitted
RDMA/qedr: Add EDPM max size to alloc ucontext response
User space should receive the maximum edpm size from kernel driver, similar to other edpm/ldpm related limits. Add an additional parameter to the alloc_ucontext_resp structure for the edpm maximum size. In addition, pass an indication from user-space to kernel (and not just kernel to user) that the DPM sizes are supported. This is for supporting backward-forward compatibility between driver and lib for everything related to DPM transaction and limit sizes. This should have been part of commit mentioned in Fixes tag. Link: https://lore.kernel.org/r/20200707063100.3811-3-michal.kalderon@marvell.com Fixes: 93a3d05 ("RDMA/qedr: Add kernel capability flags for dpm enabled mode") Signed-off-by: Ariel Elior <ariel.elior@marvell.com> Signed-off-by: Michal Kalderon <michal.kalderon@marvell.com> Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
1 parent bbe4f42 commit eb7f84e

2 files changed

Lines changed: 11 additions & 4 deletions

File tree

‎drivers/infiniband/hw/qedr/verbs.c‎

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -320,9 +320,12 @@ int qedr_alloc_ucontext(struct ib_ucontext *uctx, struct ib_udata *udata)
320320
QEDR_DPM_TYPE_ROCE_LEGACY |
321321
QEDR_DPM_TYPE_ROCE_EDPM_MODE;
322322

323-
uresp.dpm_flags |= QEDR_DPM_SIZES_SET;
324-
uresp.ldpm_limit_size = QEDR_LDPM_MAX_SIZE;
325-
uresp.edpm_trans_size = QEDR_EDPM_TRANS_SIZE;
323+
if (ureq.context_flags & QEDR_SUPPORT_DPM_SIZES) {
324+
uresp.dpm_flags |= QEDR_DPM_SIZES_SET;
325+
uresp.ldpm_limit_size = QEDR_LDPM_MAX_SIZE;
326+
uresp.edpm_trans_size = QEDR_EDPM_TRANS_SIZE;
327+
uresp.edpm_limit_size = QEDR_EDPM_MAX_SIZE;
328+
}
326329

327330
uresp.wids_enabled = 1;
328331
uresp.wid_count = oparams.wid_count;

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@
4040
/* user kernel communication data structures. */
4141
enum qedr_alloc_ucontext_flags {
4242
QEDR_ALLOC_UCTX_EDPM_MODE = 1 << 0,
43-
QEDR_ALLOC_UCTX_DB_REC = 1 << 1
43+
QEDR_ALLOC_UCTX_DB_REC = 1 << 1,
44+
QEDR_SUPPORT_DPM_SIZES = 1 << 2,
4445
};
4546

4647
struct qedr_alloc_ucontext_req {
@@ -50,6 +51,7 @@ struct qedr_alloc_ucontext_req {
5051

5152
#define QEDR_LDPM_MAX_SIZE (8192)
5253
#define QEDR_EDPM_TRANS_SIZE (64)
54+
#define QEDR_EDPM_MAX_SIZE (ROCE_REQ_MAX_INLINE_DATA_SIZE)
5355

5456
enum qedr_rdma_dpm_type {
5557
QEDR_DPM_TYPE_NONE = 0,
@@ -77,6 +79,8 @@ struct qedr_alloc_ucontext_resp {
7779
__u16 ldpm_limit_size;
7880
__u8 edpm_trans_size;
7981
__u8 reserved;
82+
__u16 edpm_limit_size;
83+
__u8 padding[6];
8084
};
8185

8286
struct qedr_alloc_pd_ureq {

0 commit comments

Comments
 (0)