Skip to content

Commit

Permalink
bnxt_re/lib: Fix the stride calculation for MSN/PSN area
Browse files Browse the repository at this point in the history
Library expects ilog2 of psn_size while calculating the stride.
ilog32 returns log2(v) + 1 and the calculation fails since
the psn size is a power of 2 value. Fix by passing psn_size - 1.

Fixes: 0a0e0d0 ("bnxt_re/lib: Adds MSN table capability for Gen P7 adapters")
Signed-off-by: Selvin Xavier <[email protected]>
  • Loading branch information
selvintxavier committed May 1, 2024
1 parent 3be5661 commit 65197a4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion providers/bnxt_re/verbs.c
Expand Up @@ -1391,7 +1391,7 @@ static int bnxt_re_alloc_queues(struct bnxt_re_qp *qp,
*/
que->pad = (que->va + que->depth * que->stride);
psn_size = bnxt_re_get_psne_size(qp->cntx);
que->pad_stride_log2 = ilog32(psn_size);
que->pad_stride_log2 = ilog32(psn_size - 1);

ret = bnxt_re_alloc_init_swque(qp->jsqq, qp->mem, &qattr[indx]);
if (ret)
Expand Down

0 comments on commit 65197a4

Please sign in to comment.