Skip to content

Commit e6178bf

Browse files
Kalesh APrleon
authored andcommitted
RDMA/bnxt_re: Fix error recovery sequence
Fixed to return ENXIO from __send_message_basic_sanity() to indicate that device is in error state. In the case of ERR_DEVICE_DETACHED state, the driver should not post the commands to the firmware as it will time out eventually. Removed bnxt_re_modify_qp() call from bnxt_re_dev_stop() as it is a no-op. Fixes: cc5b9b4 ("RDMA/bnxt_re: Recover the device when FW error is detected") Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com> Signed-off-by: Kashyap Desai <kashyap.desai@broadcom.com> Link: https://patch.msgid.link/20241231025008.2267162-1-kalesh-anakkur.purayil@broadcom.com Reviewed-by: Selvin Xavier <selvin.xavier@broadcom.com> Signed-off-by: Leon Romanovsky <leon@kernel.org>
1 parent fb514b3 commit e6178bf

File tree

2 files changed

+4
-9
lines changed

2 files changed

+4
-9
lines changed

drivers/infiniband/hw/bnxt_re/main.c

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1715,24 +1715,18 @@ static bool bnxt_re_is_qp1_or_shadow_qp(struct bnxt_re_dev *rdev,
17151715

17161716
static void bnxt_re_dev_stop(struct bnxt_re_dev *rdev)
17171717
{
1718-
int mask = IB_QP_STATE;
1719-
struct ib_qp_attr qp_attr;
17201718
struct bnxt_re_qp *qp;
17211719

1722-
qp_attr.qp_state = IB_QPS_ERR;
17231720
mutex_lock(&rdev->qp_lock);
17241721
list_for_each_entry(qp, &rdev->qp_list, list) {
17251722
/* Modify the state of all QPs except QP1/Shadow QP */
17261723
if (!bnxt_re_is_qp1_or_shadow_qp(rdev, qp)) {
17271724
if (qp->qplib_qp.state !=
17281725
CMDQ_MODIFY_QP_NEW_STATE_RESET &&
17291726
qp->qplib_qp.state !=
1730-
CMDQ_MODIFY_QP_NEW_STATE_ERR) {
1727+
CMDQ_MODIFY_QP_NEW_STATE_ERR)
17311728
bnxt_re_dispatch_event(&rdev->ibdev, &qp->ib_qp,
17321729
1, IB_EVENT_QP_FATAL);
1733-
bnxt_re_modify_qp(&qp->ib_qp, &qp_attr, mask,
1734-
NULL);
1735-
}
17361730
}
17371731
}
17381732
mutex_unlock(&rdev->qp_lock);

drivers/infiniband/hw/bnxt_re/qplib_rcfw.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -424,7 +424,8 @@ static int __send_message_basic_sanity(struct bnxt_qplib_rcfw *rcfw,
424424

425425
/* Prevent posting if f/w is not in a state to process */
426426
if (test_bit(ERR_DEVICE_DETACHED, &rcfw->cmdq.flags))
427-
return bnxt_qplib_map_rc(opcode);
427+
return -ENXIO;
428+
428429
if (test_bit(FIRMWARE_STALL_DETECTED, &cmdq->flags))
429430
return -ETIMEDOUT;
430431

@@ -493,7 +494,7 @@ static int __bnxt_qplib_rcfw_send_message(struct bnxt_qplib_rcfw *rcfw,
493494

494495
rc = __send_message_basic_sanity(rcfw, msg, opcode);
495496
if (rc)
496-
return rc;
497+
return rc == -ENXIO ? bnxt_qplib_map_rc(opcode) : rc;
497498

498499
rc = __send_message(rcfw, msg, opcode);
499500
if (rc)

0 commit comments

Comments
 (0)