[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20191003094940.9797-14-jiri@resnulli.us>
Date: Thu, 3 Oct 2019 11:49:38 +0200
From: Jiri Pirko <jiri@...nulli.us>
To: netdev@...r.kernel.org
Cc: davem@...emloft.net, idosch@...lanox.com, dsahern@...il.com,
jakub.kicinski@...ronome.com, tariqt@...lanox.com,
saeedm@...lanox.com, kuznet@....inr.ac.ru, yoshfuji@...ux-ipv6.org,
shuah@...nel.org, mlxsw@...lanox.com
Subject: [patch net-next v3 13/15] netdevsim: take devlink net instead of init_net
From: Jiri Pirko <jiri@...lanox.com>
Follow-up patch is going to allow to reload devlink instance into
different network namespace, so use devlink_net() helper instead
of init_net.
Signed-off-by: Jiri Pirko <jiri@...lanox.com>
---
drivers/net/netdevsim/fib.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/netdevsim/fib.c b/drivers/net/netdevsim/fib.c
index fdc682f3a09a..13540dee7364 100644
--- a/drivers/net/netdevsim/fib.c
+++ b/drivers/net/netdevsim/fib.c
@@ -260,7 +260,7 @@ struct nsim_fib_data *nsim_fib_create(struct devlink *devlink,
nsim_fib_set_max_all(data, devlink);
data->fib_nb.notifier_call = nsim_fib_event_nb;
- err = register_fib_notifier(&init_net, &data->fib_nb,
+ err = register_fib_notifier(devlink_net(devlink), &data->fib_nb,
nsim_fib_dump_inconsistent, extack);
if (err) {
pr_err("Failed to register fib notifier\n");
@@ -300,6 +300,6 @@ void nsim_fib_destroy(struct devlink *devlink, struct nsim_fib_data *data)
NSIM_RESOURCE_IPV4_FIB_RULES);
devlink_resource_occ_get_unregister(devlink,
NSIM_RESOURCE_IPV4_FIB);
- unregister_fib_notifier(&init_net, &data->fib_nb);
+ unregister_fib_notifier(devlink_net(devlink), &data->fib_nb);
kfree(data);
}
--
2.21.0
Powered by blists - more mailing lists