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

Configure Feed

Select the types of activity you want to include in your feed.

RDMA/qedr: Add EDPM mode type for user-fw compatibility

In older FW versions the completion flag was treated as the ack flag in
edpm messages. commit ff937b916eb6 ("qed: Add EDPM mode type for user-fw
compatibility") exposed the FW option of setting which mode the QP is in
by adding a flag to the qedr <-> qed API.

This patch adds the qedr <-> libqedr interface so that the libqedr can set
the flag appropriately and qedr can pass it down to FW. Flag is added for
backward compatibility with libqedr.

For older libs, this flag didn't exist and therefore set to zero.

Fixes: ac1b36e55a51 ("qedr: Add support for user context verbs")
Link: https://lore.kernel.org/r/20200707063100.3811-2-michal.kalderon@marvell.com
Signed-off-by: Yuval Bason <yuval.bason@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
bbe4f424 3e9fed7f

+11 -5
+1
drivers/infiniband/hw/qedr/qedr.h
··· 235 235 u32 dpi_size; 236 236 u16 dpi; 237 237 bool db_rec; 238 + u8 edpm_mode; 238 239 }; 239 240 240 241 union db_prod32 {
+8 -3
drivers/infiniband/hw/qedr/verbs.c
··· 275 275 DP_ERR(dev, "Problem copying data from user space\n"); 276 276 return -EFAULT; 277 277 } 278 - 278 + ctx->edpm_mode = !!(ureq.context_flags & 279 + QEDR_ALLOC_UCTX_EDPM_MODE); 279 280 ctx->db_rec = !!(ureq.context_flags & QEDR_ALLOC_UCTX_DB_REC); 280 281 } 281 282 ··· 317 316 uresp.dpm_flags = QEDR_DPM_TYPE_IWARP_LEGACY; 318 317 else 319 318 uresp.dpm_flags = QEDR_DPM_TYPE_ROCE_ENHANCED | 320 - QEDR_DPM_TYPE_ROCE_LEGACY; 319 + QEDR_DPM_TYPE_ROCE_LEGACY | 320 + QEDR_DPM_TYPE_ROCE_EDPM_MODE; 321 321 322 322 uresp.dpm_flags |= QEDR_DPM_SIZES_SET; 323 323 uresp.ldpm_limit_size = QEDR_LDPM_MAX_SIZE; ··· 1752 1750 struct qed_rdma_create_qp_out_params out_params; 1753 1751 struct qedr_pd *pd = get_qedr_pd(ibpd); 1754 1752 struct qedr_create_qp_uresp uresp; 1755 - struct qedr_ucontext *ctx = NULL; 1753 + struct qedr_ucontext *ctx = pd ? pd->uctx : NULL; 1756 1754 struct qedr_create_qp_ureq ureq; 1757 1755 int alloc_and_init = rdma_protocol_roce(&dev->ibdev, 1); 1758 1756 int rc = -EINVAL; ··· 1789 1787 in_params.rq_num_pages = qp->urq.pbl_info.num_pbes; 1790 1788 in_params.rq_pbl_ptr = qp->urq.pbl_tbl->pa; 1791 1789 } 1790 + 1791 + if (ctx) 1792 + SET_FIELD(in_params.flags, QED_ROCE_EDPM_MODE, ctx->edpm_mode); 1792 1793 1793 1794 qp->qed_qp = dev->ops->rdma_create_qp(dev->rdma_ctx, 1794 1795 &in_params, &out_params);
+2 -2
include/uapi/rdma/qedr-abi.h
··· 39 39 40 40 /* user kernel communication data structures. */ 41 41 enum qedr_alloc_ucontext_flags { 42 - QEDR_ALLOC_UCTX_RESERVED = 1 << 0, 42 + QEDR_ALLOC_UCTX_EDPM_MODE = 1 << 0, 43 43 QEDR_ALLOC_UCTX_DB_REC = 1 << 1 44 44 }; 45 45 ··· 56 56 QEDR_DPM_TYPE_ROCE_ENHANCED = 1 << 0, 57 57 QEDR_DPM_TYPE_ROCE_LEGACY = 1 << 1, 58 58 QEDR_DPM_TYPE_IWARP_LEGACY = 1 << 2, 59 - QEDR_DPM_TYPE_RESERVED = 1 << 3, 59 + QEDR_DPM_TYPE_ROCE_EDPM_MODE = 1 << 3, 60 60 QEDR_DPM_SIZES_SET = 1 << 4, 61 61 }; 62 62