Skip to content

Commit 6a788e3

Browse files
kadesai16gregkh
authored andcommitted
RDMA/bnxt_re: Add missing paranthesis in map_qp_id_to_tbl_indx
[ Upstream commit 67ee8d4 ] The modulo operation returns wrong result without the paranthesis and that resulted in wrong QP table indexing. Fixes: 84cf229 ("RDMA/bnxt_re: Fix the qp table indexing") Reviewed-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com> Signed-off-by: Kashyap Desai <kashyap.desai@broadcom.com> Signed-off-by: Selvin Xavier <selvin.xavier@broadcom.com> Link: https://patch.msgid.link/1741021178-2569-3-git-send-email-selvin.xavier@broadcom.com Signed-off-by: Leon Romanovsky <leon@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 25be7f9 commit 6a788e3

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

drivers/infiniband/hw/bnxt_re/qplib_rcfw.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,9 +283,10 @@ int bnxt_qplib_deinit_rcfw(struct bnxt_qplib_rcfw *rcfw);
283283
int bnxt_qplib_init_rcfw(struct bnxt_qplib_rcfw *rcfw,
284284
struct bnxt_qplib_ctx *ctx, int is_virtfn);
285285
void bnxt_qplib_mark_qp_error(void *qp_handle);
286+
286287
static inline u32 map_qp_id_to_tbl_indx(u32 qid, struct bnxt_qplib_rcfw *rcfw)
287288
{
288289
/* Last index of the qp_tbl is for QP1 ie. qp_tbl_size - 1*/
289-
return (qid == 1) ? rcfw->qp_tbl_size - 1 : qid % rcfw->qp_tbl_size - 2;
290+
return (qid == 1) ? rcfw->qp_tbl_size - 1 : (qid % (rcfw->qp_tbl_size - 2));
290291
}
291292
#endif /* __BNXT_QPLIB_RCFW_H__ */

0 commit comments

Comments
 (0)