Skip to content

Commit

Permalink
bnxt_re/lib: Fix the inline size check
Browse files Browse the repository at this point in the history
[ Upstream commit 1eecc06 ]

Align the inline size only after the max_inline_check
to avoid failures.

Fixes: b9c6f8c ("bnxt_re/lib: Refactor post_send and post_recv")
Signed-off-by: Selvin Xavier <selvin.xavier@broadcom.com>
Signed-off-by: Nicolas Morey <nmorey@suse.com>
  • Loading branch information
selvintxavier authored and nmorey committed Dec 19, 2024
1 parent bb1086f commit ee046e3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion providers/bnxt_re/verbs.c
Original file line number Diff line number Diff line change
Expand Up @@ -1666,7 +1666,7 @@ static inline int bnxt_re_calc_inline_len(struct ibv_send_wr *swr)
illen = 0;
for (indx = 0; indx < swr->num_sge; indx++)
illen += swr->sg_list[indx].length;
return align(illen, sizeof(struct bnxt_re_sge));
return illen;
}

static int bnxt_re_put_inline(struct bnxt_re_queue *que, uint32_t *idx,
Expand Down Expand Up @@ -1730,6 +1730,7 @@ static int bnxt_re_required_slots(struct bnxt_re_qp *qp, struct ibv_send_wr *wr,
ilsize = bnxt_re_calc_inline_len(wr);
if (ilsize > qp->cap.max_inline)
return -EINVAL;
ilsize = align(ilsize, sizeof(struct bnxt_re_sge));
if (qp->push_st_en && ilsize <= qp->max_push_sz)
*pbuf = bnxt_re_get_pbuf(&qp->push_st_en, qp->cntx);
wqe_byte = (ilsize + bnxt_re_get_sqe_hdr_sz());
Expand Down

0 comments on commit ee046e3

Please sign in to comment.