Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 57e6464

Browse files
Kalesh APrleon
authored andcommitted
RDMA/bnxt_re: Pass the context for ulp_irq_stop
ulp_irq_stop() can be invoked from a context where FW is healthy or when FW is in a reset state. In the latter case, ULP must stop all interactions with HW/FW and also with application and stack. Added a new parameter to the ulp_irq_stop() function to achieve that. Reviewed-by: Vikas Gupta <[email protected]> Reviewed-by: Michael Chan <[email protected]> Reviewed-by: Chandramohan Akula <[email protected]> Reviewed-by: Pavan Chebbi <[email protected]> Signed-off-by: Kalesh AP <[email protected]> Signed-off-by: Selvin Xavier <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Leon Romanovsky <[email protected]>
1 parent 51dc531 commit 57e6464

File tree

3 files changed

+16
-3
lines changed

3 files changed

+16
-3
lines changed

drivers/infiniband/hw/bnxt_re/main.c

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,8 @@ static int bnxt_re_hwrm_qcaps(struct bnxt_re_dev *rdev);
8383

8484
static int bnxt_re_hwrm_qcfg(struct bnxt_re_dev *rdev, u32 *db_len,
8585
u32 *offset);
86+
static void bnxt_re_dispatch_event(struct ib_device *ibdev, struct ib_qp *qp,
87+
u8 port_num, enum ib_event_type event);
8688
static void bnxt_re_set_db_offset(struct bnxt_re_dev *rdev)
8789
{
8890
struct bnxt_qplib_chip_ctx *cctx;
@@ -411,7 +413,7 @@ static void bnxt_re_async_notifier(void *handle, struct hwrm_async_event_cmpl *c
411413
}
412414
}
413415

414-
static void bnxt_re_stop_irq(void *handle)
416+
static void bnxt_re_stop_irq(void *handle, bool reset)
415417
{
416418
struct bnxt_re_en_dev_info *en_info = auxiliary_get_drvdata(handle);
417419
struct bnxt_qplib_rcfw *rcfw;
@@ -422,6 +424,14 @@ static void bnxt_re_stop_irq(void *handle)
422424
rdev = en_info->rdev;
423425
rcfw = &rdev->rcfw;
424426

427+
if (reset) {
428+
set_bit(ERR_DEVICE_DETACHED, &rdev->rcfw.cmdq.flags);
429+
set_bit(BNXT_RE_FLAG_ERR_DEVICE_DETACHED, &rdev->flags);
430+
wake_up_all(&rdev->rcfw.cmdq.waitq);
431+
bnxt_re_dispatch_event(&rdev->ibdev, NULL, 1,
432+
IB_EVENT_DEVICE_FATAL);
433+
}
434+
425435
for (indx = BNXT_RE_NQ_IDX; indx < rdev->nqr->num_msix; indx++) {
426436
nq = &rdev->nqr->nq[indx - 1];
427437
bnxt_qplib_nq_stop_irq(nq, false);

drivers/net/ethernet/broadcom/bnxt/bnxt_ulp.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,7 @@ void bnxt_ulp_irq_stop(struct bnxt *bp)
297297
{
298298
struct bnxt_en_dev *edev = bp->edev;
299299
struct bnxt_ulp_ops *ops;
300+
bool reset = false;
300301

301302
if (!edev || !(edev->flags & BNXT_EN_FLAG_MSIX_REQUESTED))
302303
return;
@@ -310,7 +311,9 @@ void bnxt_ulp_irq_stop(struct bnxt *bp)
310311
ops = rtnl_dereference(ulp->ulp_ops);
311312
if (!ops || !ops->ulp_irq_stop)
312313
return;
313-
ops->ulp_irq_stop(ulp->handle);
314+
if (test_bit(BNXT_STATE_FW_RESET_DET, &bp->state))
315+
reset = true;
316+
ops->ulp_irq_stop(ulp->handle, reset);
314317
}
315318
}
316319

drivers/net/ethernet/broadcom/bnxt/bnxt_ulp.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ struct bnxt_msix_entry {
3232
struct bnxt_ulp_ops {
3333
/* async_notifier() cannot sleep (in BH context) */
3434
void (*ulp_async_notifier)(void *, struct hwrm_async_event_cmpl *);
35-
void (*ulp_irq_stop)(void *);
35+
void (*ulp_irq_stop)(void *, bool);
3636
void (*ulp_irq_restart)(void *, struct bnxt_msix_entry *);
3737
};
3838

0 commit comments

Comments
 (0)