Skip to content

Commit 803782e

Browse files
committed
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 <[email protected]>
1 parent 9260998 commit 803782e

File tree

5 files changed

+8
-5
lines changed

5 files changed

+8
-5
lines changed

providers/bnxt_re/bnxt_re-abi.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,7 @@ enum {
225225
BNXT_RE_COMP_MASK_UCNTX_WC_DPI_ENABLED = 0x01,
226226
BNXT_RE_COMP_MASK_UCNTX_DBR_PACING_ENABLED = 0x02,
227227
BNXT_RE_COMP_MASK_UCNTX_POW2_DISABLED = 0x04,
228+
BNXT_RE_COMP_MASK_UCNTX_MSN_TABLE_ENABLED = 0x08,
228229
};
229230

230231
enum bnxt_re_que_flags_mask {

providers/bnxt_re/main.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,8 @@ static struct verbs_context *bnxt_re_alloc_context(struct ibv_device *vdev,
221221
cntx->comp_mask |= BNXT_RE_COMP_MASK_UCNTX_DBR_PACING_ENABLED;
222222
if (resp.comp_mask & BNXT_RE_UCNTX_CMASK_POW2_DISABLED)
223223
cntx->comp_mask |= BNXT_RE_COMP_MASK_UCNTX_POW2_DISABLED;
224+
if (resp.comp_mask & BNXT_RE_UCNTX_CMASK_MSN_TABLE_ENABLED)
225+
cntx->comp_mask |= BNXT_RE_COMP_MASK_UCNTX_MSN_TABLE_ENABLED;
224226

225227
/* mmap shared page. */
226228
cntx->shpg = mmap(NULL, rdev->pg_size, PROT_READ | PROT_WRITE,

providers/bnxt_re/main.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -616,5 +616,5 @@ static inline void bnxt_re_sub_sec_busy_wait(uint32_t nsec)
616616
}
617617
}
618618

619-
#define BNXT_RE_HW_RETX(a) ((a)->comp_mask & BNXT_RE_COMP_MASK_UCNTX_HW_RETX_ENABLED)
619+
#define BNXT_RE_MSN_TBL_EN(a) ((a)->comp_mask & BNXT_RE_COMP_MASK_UCNTX_MSN_TABLE_ENABLED)
620620
#endif

providers/bnxt_re/verbs.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1228,7 +1228,7 @@ static int bnxt_re_get_sqmem_size(struct bnxt_re_context *cntx,
12281228
if (nslots < 0)
12291229
return nslots;
12301230
npsn = bnxt_re_get_npsn(mode, nswr, nslots);
1231-
if (BNXT_RE_HW_RETX(cntx))
1231+
if (BNXT_RE_MSN_TBL_EN(cntx))
12321232
npsn = roundup_pow_of_two(npsn);
12331233

12341234
qattr->nwr = nswr;
@@ -1403,7 +1403,7 @@ static int bnxt_re_alloc_queues(struct bnxt_re_qp *qp,
14031403
&que->tail : &qp->jsqq->start_idx;
14041404

14051405
/* Init and adjust MSN table size according to qp mode */
1406-
if (!BNXT_RE_HW_RETX(qp->cntx))
1406+
if (!BNXT_RE_MSN_TBL_EN(qp->cntx))
14071407
goto skip_msn;
14081408
que->msn = 0;
14091409
que->msn_tbl_sz = 0;
@@ -2030,7 +2030,7 @@ int bnxt_re_post_send(struct ibv_qp *ibvqp, struct ibv_send_wr *wr,
20302030
bnxt_re_fill_wrid(wrid, wr->wr_id, bytes,
20312031
sig, sq->tail, slots);
20322032
wrid->wc_opcd = bnxt_re_ibv_wr_to_wc_opcd(wr->opcode);
2033-
if (BNXT_RE_HW_RETX(qp->cntx))
2033+
if (BNXT_RE_MSN_TBL_EN(qp->cntx))
20342034
bnxt_re_fill_psns_for_msntbl(qp, bytes, *sq->dbtail);
20352035
else
20362036
bnxt_re_fill_psns(qp, wrid, bytes);

providers/bnxt_re/verbs.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ struct bnxt_re_work_compl {
6262

6363
static inline uint8_t bnxt_re_get_psne_size(struct bnxt_re_context *cntx)
6464
{
65-
return (BNXT_RE_HW_RETX(cntx)) ? sizeof(struct bnxt_re_msns) :
65+
return (BNXT_RE_MSN_TBL_EN(cntx)) ? sizeof(struct bnxt_re_msns) :
6666
(cntx->cctx.gen_p5_p7) ?
6767
sizeof(struct bnxt_re_psns_ext) :
6868
sizeof(struct bnxt_re_psns);

0 commit comments

Comments
 (0)