Skip to content

Commit

Permalink
Merge pull request #1457 from selvintxavier/msn_cap
Browse files Browse the repository at this point in the history
Add MSN table capability check
  • Loading branch information
rleon authored Jun 19, 2024
2 parents 4b42924 + 803782e commit 367ba33
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion kernel-headers/rdma/bnxt_re-abi.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
1 change: 1 addition & 0 deletions providers/bnxt_re/bnxt_re-abi.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 2 additions & 0 deletions providers/bnxt_re/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion providers/bnxt_re/main.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
6 changes: 3 additions & 3 deletions providers/bnxt_re/verbs.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion providers/bnxt_re/verbs.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 367ba33

Please sign in to comment.