summaryrefslogtreecommitdiffstats
path: root/net/smc/smc_ism.c
diff options
context:
space:
mode:
authorUrsula Braun <ubraun@linux.ibm.com>2019-10-09 10:07:46 +0200
committerJakub Kicinski <jakub.kicinski@netronome.com>2019-10-10 04:45:44 +0200
commitc3d9494e68c4a5d23227ede822fda9bd68bef8e3 (patch)
tree640a13f101e2cbd834dcb1bccf9529b374436ff9 /net/smc/smc_ism.c
parentnet/smc: increase device refcount for added link group (diff)
downloadlinux-c3d9494e68c4a5d23227ede822fda9bd68bef8e3.tar.xz
linux-c3d9494e68c4a5d23227ede822fda9bd68bef8e3.zip
net/smc: no new connections on disappearing devices
Add a "going_away" indication to ISM devices and IB ports and avoid creation of new connections on such disappearing devices. And do not handle ISM events if ISM device is disappearing. Signed-off-by: Ursula Braun <ubraun@linux.ibm.com> Signed-off-by: Karsten Graul <kgraul@linux.ibm.com> Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Diffstat (limited to 'net/smc/smc_ism.c')
-rw-r--r--net/smc/smc_ism.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/net/smc/smc_ism.c b/net/smc/smc_ism.c
index 34dc619655e8..ee7340898cb4 100644
--- a/net/smc/smc_ism.c
+++ b/net/smc/smc_ism.c
@@ -315,6 +315,7 @@ void smcd_unregister_dev(struct smcd_dev *smcd)
spin_lock(&smcd_dev_list.lock);
list_del(&smcd->list);
spin_unlock(&smcd_dev_list.lock);
+ smcd->going_away = 1;
flush_workqueue(smcd->event_wq);
destroy_workqueue(smcd->event_wq);
smc_smcd_terminate(smcd, 0, VLAN_VID_MASK);
@@ -344,6 +345,8 @@ void smcd_handle_event(struct smcd_dev *smcd, struct smcd_event *event)
{
struct smc_ism_event_work *wrk;
+ if (smcd->going_away)
+ return;
/* copy event to event work queue, and let it be handled there */
wrk = kmalloc(sizeof(*wrk), GFP_ATOMIC);
if (!wrk)