Skip to content

Commit

Permalink
net/smc: guarantee removal of link groups in reboot
Browse files Browse the repository at this point in the history
When rebooting it should be guaranteed all link groups are cleaned
up and freed.

Signed-off-by: Ursula Braun <ubraun@linux.ibm.com>
Signed-off-by: Karsten Graul <kgraul@linux.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Ursula Braun authored and David S. Miller committed Nov 16, 2019
1 parent 6dabd40 commit a33a803
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion net/smc/smc_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down Expand Up @@ -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();
}

0 comments on commit a33a803

Please sign in to comment.