[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20191116164732.47059-3-kgraul@linux.ibm.com>
Date: Sat, 16 Nov 2019 17:47:30 +0100
From: Karsten Graul <kgraul@...ux.ibm.com>
To: davem@...emloft.net
Cc: netdev@...r.kernel.org, linux-s390@...r.kernel.org,
heiko.carstens@...ibm.com, raspl@...ux.ibm.com,
ubraun@...ux.ibm.com
Subject: [PATCH net-next 2/4] net/smc: guarantee removal of link groups in reboot
From: Ursula Braun <ubraun@...ux.ibm.com>
When rebooting it should be guaranteed all link groups are cleaned
up and freed.
Signed-off-by: Ursula Braun <ubraun@...ux.ibm.com>
Signed-off-by: Karsten Graul <kgraul@...ux.ibm.com>
---
net/smc/smc_core.c | 16 +++++++++++++++-
1 file changed, 15 insertions(+), 1 deletion(-)
diff --git a/net/smc/smc_core.c b/net/smc/smc_core.c
index cf34b9d96595..bb92c7c6214c 100644
--- a/net/smc/smc_core.c
+++ b/net/smc/smc_core.c
@@ -14,6 +14,7 @@
#include <linux/random.h>
#include <linux/workqueue.h>
#include <linux/wait.h>
+#include <linux/reboot.h>
#include <net/tcp.h>
#include <net/sock.h>
#include <rdma/ib_verbs.h>
@@ -1282,14 +1283,27 @@ static void smc_lgrs_shutdown(void)
spin_unlock(&smcd_dev_list.lock);
}
+static int smc_core_reboot_event(struct notifier_block *this,
+ unsigned long event, void *ptr)
+{
+ smc_lgrs_shutdown();
+
+ return 0;
+}
+
+static struct notifier_block smc_reboot_notifier = {
+ .notifier_call = smc_core_reboot_event,
+};
+
int __init smc_core_init(void)
{
atomic_set(&lgr_cnt, 0);
- return 0;
+ return register_reboot_notifier(&smc_reboot_notifier);
}
/* Called (from smc_exit) when module is removed */
void smc_core_exit(void)
{
+ unregister_reboot_notifier(&smc_reboot_notifier);
smc_lgrs_shutdown();
}
--
2.17.1
Powered by blists - more mailing lists