Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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: 93a3d05f9d68 ("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>

authored by

Michal Kalderon and committed by
Jason Gunthorpe
eb7f84e3 bbe4f424

+11 -4
+6 -3
drivers/infiniband/hw/qedr/verbs.c
··· 320 320 QEDR_DPM_TYPE_ROCE_LEGACY | 321 321 QEDR_DPM_TYPE_ROCE_EDPM_MODE; 322 322 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 + } 326 329 327 330 uresp.wids_enabled = 1; 328 331 uresp.wid_count = oparams.wid_count;
+5 -1
include/uapi/rdma/qedr-abi.h
··· 40 40 /* user kernel communication data structures. */ 41 41 enum qedr_alloc_ucontext_flags { 42 42 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, 44 45 }; 45 46 46 47 struct qedr_alloc_ucontext_req { ··· 51 50 52 51 #define QEDR_LDPM_MAX_SIZE (8192) 53 52 #define QEDR_EDPM_TRANS_SIZE (64) 53 + #define QEDR_EDPM_MAX_SIZE (ROCE_REQ_MAX_INLINE_DATA_SIZE) 54 54 55 55 enum qedr_rdma_dpm_type { 56 56 QEDR_DPM_TYPE_NONE = 0, ··· 79 77 __u16 ldpm_limit_size; 80 78 __u8 edpm_trans_size; 81 79 __u8 reserved; 80 + __u16 edpm_limit_size; 81 + __u8 padding[6]; 82 82 }; 83 83 84 84 struct qedr_alloc_pd_ureq {