Skip to content

Commit 8eaca6b

Browse files
Kalesh APrleon
Kalesh AP
authored andcommitted
RDMA/bnxt_re: Fix unconditional fence for newer adapters
Older adapters required an unconditional fence for non-wire memory operations. Newer adapters doesn't require this and therefore, disabling the unconditional fence. Fixes: 1801d87 ("RDMA/bnxt_re: Support new 5760X P7 devices") Signed-off-by: Kashyap Desai <[email protected]> Signed-off-by: Kalesh AP <[email protected]> Signed-off-by: Selvin Xavier <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Leon Romanovsky <[email protected]>
1 parent 8fcbf0a commit 8eaca6b

File tree

1 file changed

+16
-12
lines changed

1 file changed

+16
-12
lines changed

drivers/infiniband/hw/bnxt_re/ib_verbs.c

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2566,11 +2566,6 @@ static int bnxt_re_build_inv_wqe(const struct ib_send_wr *wr,
25662566
wqe->type = BNXT_QPLIB_SWQE_TYPE_LOCAL_INV;
25672567
wqe->local_inv.inv_l_key = wr->ex.invalidate_rkey;
25682568

2569-
/* Need unconditional fence for local invalidate
2570-
* opcode to work as expected.
2571-
*/
2572-
wqe->flags |= BNXT_QPLIB_SWQE_FLAGS_UC_FENCE;
2573-
25742569
if (wr->send_flags & IB_SEND_SIGNALED)
25752570
wqe->flags |= BNXT_QPLIB_SWQE_FLAGS_SIGNAL_COMP;
25762571
if (wr->send_flags & IB_SEND_SOLICITED)
@@ -2593,12 +2588,6 @@ static int bnxt_re_build_reg_wqe(const struct ib_reg_wr *wr,
25932588
wqe->frmr.levels = qplib_frpl->hwq.level;
25942589
wqe->type = BNXT_QPLIB_SWQE_TYPE_REG_MR;
25952590

2596-
/* Need unconditional fence for reg_mr
2597-
* opcode to function as expected.
2598-
*/
2599-
2600-
wqe->flags |= BNXT_QPLIB_SWQE_FLAGS_UC_FENCE;
2601-
26022591
if (wr->wr.send_flags & IB_SEND_SIGNALED)
26032592
wqe->flags |= BNXT_QPLIB_SWQE_FLAGS_SIGNAL_COMP;
26042593

@@ -2729,6 +2718,18 @@ static int bnxt_re_post_send_shadow_qp(struct bnxt_re_dev *rdev,
27292718
return rc;
27302719
}
27312720

2721+
static void bnxt_re_legacy_set_uc_fence(struct bnxt_qplib_swqe *wqe)
2722+
{
2723+
/* Need unconditional fence for non-wire memory opcode
2724+
* to work as expected.
2725+
*/
2726+
if (wqe->type == BNXT_QPLIB_SWQE_TYPE_LOCAL_INV ||
2727+
wqe->type == BNXT_QPLIB_SWQE_TYPE_FAST_REG_MR ||
2728+
wqe->type == BNXT_QPLIB_SWQE_TYPE_REG_MR ||
2729+
wqe->type == BNXT_QPLIB_SWQE_TYPE_BIND_MW)
2730+
wqe->flags |= BNXT_QPLIB_SWQE_FLAGS_UC_FENCE;
2731+
}
2732+
27322733
int bnxt_re_post_send(struct ib_qp *ib_qp, const struct ib_send_wr *wr,
27332734
const struct ib_send_wr **bad_wr)
27342735
{
@@ -2808,8 +2809,11 @@ int bnxt_re_post_send(struct ib_qp *ib_qp, const struct ib_send_wr *wr,
28082809
rc = -EINVAL;
28092810
goto bad;
28102811
}
2811-
if (!rc)
2812+
if (!rc) {
2813+
if (!bnxt_qplib_is_chip_gen_p5_p7(qp->rdev->chip_ctx))
2814+
bnxt_re_legacy_set_uc_fence(&wqe);
28122815
rc = bnxt_qplib_post_send(&qp->qplib_qp, &wqe);
2816+
}
28132817
bad:
28142818
if (rc) {
28152819
ibdev_err(&qp->rdev->ibdev,

0 commit comments

Comments
 (0)