Skip to content

Commit 8b312db

Browse files
committed
RDMA/bnxt_re: Fix error recovery sequence
JIRA: https://issues.redhat.com/browse/RHEL-74367 commit e6178bf Author: Kalesh AP <kalesh-anakkur.purayil@broadcom.com> Date: Tue Dec 31 08:20:08 2024 +0530 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> Signed-off-by: Mohammad Heib <mheib@redhat.com>
1 parent dafb52b commit 8b312db

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
@@ -1435,24 +1435,18 @@ static bool bnxt_re_is_qp1_or_shadow_qp(struct bnxt_re_dev *rdev,
14351435

14361436
static void bnxt_re_dev_stop(struct bnxt_re_dev *rdev)
14371437
{
1438-
int mask = IB_QP_STATE;
1439-
struct ib_qp_attr qp_attr;
14401438
struct bnxt_re_qp *qp;
14411439

1442-
qp_attr.qp_state = IB_QPS_ERR;
14431440
mutex_lock(&rdev->qp_lock);
14441441
list_for_each_entry(qp, &rdev->qp_list, list) {
14451442
/* Modify the state of all QPs except QP1/Shadow QP */
14461443
if (!bnxt_re_is_qp1_or_shadow_qp(rdev, qp)) {
14471444
if (qp->qplib_qp.state !=
14481445
CMDQ_MODIFY_QP_NEW_STATE_RESET &&
14491446
qp->qplib_qp.state !=
1450-
CMDQ_MODIFY_QP_NEW_STATE_ERR) {
1447+
CMDQ_MODIFY_QP_NEW_STATE_ERR)
14511448
bnxt_re_dispatch_event(&rdev->ibdev, &qp->ib_qp,
14521449
1, IB_EVENT_QP_FATAL);
1453-
bnxt_re_modify_qp(&qp->ib_qp, &qp_attr, mask,
1454-
NULL);
1455-
}
14561450
}
14571451
}
14581452
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)