From 92609987e60f7ade49cee0d6e0a87525d884b8b5 Mon Sep 17 00:00:00 2001 From: Selvin Xavier Date: Tue, 11 Jun 2024 04:40:27 -0700 Subject: [PATCH 1/2] Update kernel headers To commit: 6f6bfbc595fb ("RDMA/bnxt_re: Expose the MSN table capability for user library"). Signed-off-by: Selvin Xavier --- kernel-headers/rdma/bnxt_re-abi.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel-headers/rdma/bnxt_re-abi.h b/kernel-headers/rdma/bnxt_re-abi.h index c0c34aca9..e61104f35 100644 --- a/kernel-headers/rdma/bnxt_re-abi.h +++ b/kernel-headers/rdma/bnxt_re-abi.h @@ -55,7 +55,7 @@ enum { BNXT_RE_UCNTX_CMASK_WC_DPI_ENABLED = 0x04ULL, BNXT_RE_UCNTX_CMASK_DBR_PACING_ENABLED = 0x08ULL, BNXT_RE_UCNTX_CMASK_POW2_DISABLED = 0x10ULL, - BNXT_RE_COMP_MASK_UCNTX_HW_RETX_ENABLED = 0x40, + BNXT_RE_UCNTX_CMASK_MSN_TABLE_ENABLED = 0x40, }; enum bnxt_re_wqe_mode { From 803782e286a555712d80006bc7af07fb8654c02a Mon Sep 17 00:00:00 2001 From: Selvin Xavier Date: Sat, 4 May 2024 01:40:46 -0700 Subject: [PATCH 2/2] bnxt_re/lib: Check for MSN table capability Driver exposes the MSN table capability. Add code to check for this capability. Rename the macro as the decision is based on the MSN table capability now. Signed-off-by: Selvin Xavier --- providers/bnxt_re/bnxt_re-abi.h | 1 + providers/bnxt_re/main.c | 2 ++ providers/bnxt_re/main.h | 2 +- providers/bnxt_re/verbs.c | 6 +++--- providers/bnxt_re/verbs.h | 2 +- 5 files changed, 8 insertions(+), 5 deletions(-) diff --git a/providers/bnxt_re/bnxt_re-abi.h b/providers/bnxt_re/bnxt_re-abi.h index 62867b758..57af88c15 100644 --- a/providers/bnxt_re/bnxt_re-abi.h +++ b/providers/bnxt_re/bnxt_re-abi.h @@ -225,6 +225,7 @@ enum { BNXT_RE_COMP_MASK_UCNTX_WC_DPI_ENABLED = 0x01, BNXT_RE_COMP_MASK_UCNTX_DBR_PACING_ENABLED = 0x02, BNXT_RE_COMP_MASK_UCNTX_POW2_DISABLED = 0x04, + BNXT_RE_COMP_MASK_UCNTX_MSN_TABLE_ENABLED = 0x08, }; enum bnxt_re_que_flags_mask { diff --git a/providers/bnxt_re/main.c b/providers/bnxt_re/main.c index 1777b447c..7f95d2455 100644 --- a/providers/bnxt_re/main.c +++ b/providers/bnxt_re/main.c @@ -221,6 +221,8 @@ static struct verbs_context *bnxt_re_alloc_context(struct ibv_device *vdev, cntx->comp_mask |= BNXT_RE_COMP_MASK_UCNTX_DBR_PACING_ENABLED; if (resp.comp_mask & BNXT_RE_UCNTX_CMASK_POW2_DISABLED) cntx->comp_mask |= BNXT_RE_COMP_MASK_UCNTX_POW2_DISABLED; + if (resp.comp_mask & BNXT_RE_UCNTX_CMASK_MSN_TABLE_ENABLED) + cntx->comp_mask |= BNXT_RE_COMP_MASK_UCNTX_MSN_TABLE_ENABLED; /* mmap shared page. */ cntx->shpg = mmap(NULL, rdev->pg_size, PROT_READ | PROT_WRITE, diff --git a/providers/bnxt_re/main.h b/providers/bnxt_re/main.h index e114f60ac..f5be4b573 100644 --- a/providers/bnxt_re/main.h +++ b/providers/bnxt_re/main.h @@ -616,5 +616,5 @@ static inline void bnxt_re_sub_sec_busy_wait(uint32_t nsec) } } -#define BNXT_RE_HW_RETX(a) ((a)->comp_mask & BNXT_RE_COMP_MASK_UCNTX_HW_RETX_ENABLED) +#define BNXT_RE_MSN_TBL_EN(a) ((a)->comp_mask & BNXT_RE_COMP_MASK_UCNTX_MSN_TABLE_ENABLED) #endif diff --git a/providers/bnxt_re/verbs.c b/providers/bnxt_re/verbs.c index 45d4faeb2..1aa2362f1 100644 --- a/providers/bnxt_re/verbs.c +++ b/providers/bnxt_re/verbs.c @@ -1228,7 +1228,7 @@ static int bnxt_re_get_sqmem_size(struct bnxt_re_context *cntx, if (nslots < 0) return nslots; npsn = bnxt_re_get_npsn(mode, nswr, nslots); - if (BNXT_RE_HW_RETX(cntx)) + if (BNXT_RE_MSN_TBL_EN(cntx)) npsn = roundup_pow_of_two(npsn); qattr->nwr = nswr; @@ -1403,7 +1403,7 @@ static int bnxt_re_alloc_queues(struct bnxt_re_qp *qp, &que->tail : &qp->jsqq->start_idx; /* Init and adjust MSN table size according to qp mode */ - if (!BNXT_RE_HW_RETX(qp->cntx)) + if (!BNXT_RE_MSN_TBL_EN(qp->cntx)) goto skip_msn; que->msn = 0; que->msn_tbl_sz = 0; @@ -2030,7 +2030,7 @@ int bnxt_re_post_send(struct ibv_qp *ibvqp, struct ibv_send_wr *wr, bnxt_re_fill_wrid(wrid, wr->wr_id, bytes, sig, sq->tail, slots); wrid->wc_opcd = bnxt_re_ibv_wr_to_wc_opcd(wr->opcode); - if (BNXT_RE_HW_RETX(qp->cntx)) + if (BNXT_RE_MSN_TBL_EN(qp->cntx)) bnxt_re_fill_psns_for_msntbl(qp, bytes, *sq->dbtail); else bnxt_re_fill_psns(qp, wrid, bytes); diff --git a/providers/bnxt_re/verbs.h b/providers/bnxt_re/verbs.h index 52adf28ff..7979f09a7 100644 --- a/providers/bnxt_re/verbs.h +++ b/providers/bnxt_re/verbs.h @@ -62,7 +62,7 @@ struct bnxt_re_work_compl { static inline uint8_t bnxt_re_get_psne_size(struct bnxt_re_context *cntx) { - return (BNXT_RE_HW_RETX(cntx)) ? sizeof(struct bnxt_re_msns) : + return (BNXT_RE_MSN_TBL_EN(cntx)) ? sizeof(struct bnxt_re_msns) : (cntx->cctx.gen_p5_p7) ? sizeof(struct bnxt_re_psns_ext) : sizeof(struct bnxt_re_psns);