Skip to content
This repository was archived by the owner on Nov 8, 2023. It is now read-only.

Commit 60dc7fc

Browse files
Showrya M Nrleon
authored andcommitted
RDMA/siw: Remove NETDEV_GOING_DOWN event handler
Toggling link while running NVME-oF over siw hits a kernel panic due to race condition within siw_handler and ib_destroy_qp(). The IB_EVENT_PORT_ERR event can alone handle destroying qps. therefore remove unwanted processing in siw. Suggested-by: Bernard Metzler <[email protected]> Signed-off-by: Showrya M N <[email protected]> Signed-off-by: Potnuri Bharat Teja <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Leon Romanovsky <[email protected]>
1 parent 75ab153 commit 60dc7fc

File tree

2 files changed

+0
-39
lines changed

2 files changed

+0
-39
lines changed

drivers/infiniband/sw/siw/siw.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,6 @@ struct siw_device {
9494
atomic_t num_mr;
9595
atomic_t num_srq;
9696
atomic_t num_ctx;
97-
98-
struct work_struct netdev_down;
9997
};
10098

10199
struct siw_ucontext {

drivers/infiniband/sw/siw/siw_main.c

Lines changed: 0 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -364,39 +364,6 @@ static struct siw_device *siw_device_create(struct net_device *netdev)
364364
return NULL;
365365
}
366366

367-
/*
368-
* Network link becomes unavailable. Mark all
369-
* affected QP's accordingly.
370-
*/
371-
static void siw_netdev_down(struct work_struct *work)
372-
{
373-
struct siw_device *sdev =
374-
container_of(work, struct siw_device, netdev_down);
375-
376-
struct siw_qp_attrs qp_attrs;
377-
struct list_head *pos, *tmp;
378-
379-
memset(&qp_attrs, 0, sizeof(qp_attrs));
380-
qp_attrs.state = SIW_QP_STATE_ERROR;
381-
382-
list_for_each_safe(pos, tmp, &sdev->qp_list) {
383-
struct siw_qp *qp = list_entry(pos, struct siw_qp, devq);
384-
385-
down_write(&qp->state_lock);
386-
WARN_ON(siw_qp_modify(qp, &qp_attrs, SIW_QP_ATTR_STATE));
387-
up_write(&qp->state_lock);
388-
}
389-
ib_device_put(&sdev->base_dev);
390-
}
391-
392-
static void siw_device_goes_down(struct siw_device *sdev)
393-
{
394-
if (ib_device_try_get(&sdev->base_dev)) {
395-
INIT_WORK(&sdev->netdev_down, siw_netdev_down);
396-
schedule_work(&sdev->netdev_down);
397-
}
398-
}
399-
400367
static int siw_netdev_event(struct notifier_block *nb, unsigned long event,
401368
void *arg)
402369
{
@@ -418,10 +385,6 @@ static int siw_netdev_event(struct notifier_block *nb, unsigned long event,
418385
siw_port_event(sdev, 1, IB_EVENT_PORT_ACTIVE);
419386
break;
420387

421-
case NETDEV_GOING_DOWN:
422-
siw_device_goes_down(sdev);
423-
break;
424-
425388
case NETDEV_DOWN:
426389
sdev->state = IB_PORT_DOWN;
427390
siw_port_event(sdev, 1, IB_EVENT_PORT_ERR);

0 commit comments

Comments
 (0)