netdevsim: Restore per-network namespace accounting for fib entries

Prior to the commit in the fixes tag, the resource controller in netdevsim
tracked fib entries and rules per network namespace. Restore that behavior.

Fixes: 5fc494225c ("netdevsim: create devlink instance per netdevsim instance")
Signed-off-by: David Ahern <dsahern@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
David Ahern
2019-08-06 12:15:17 -07:00
committed by David S. Miller
parent 9481382b36
commit 59c84b9fcf
4 changed files with 98 additions and 86 deletions

View File

@@ -357,12 +357,18 @@ static int __init nsim_module_init(void)
if (err)
goto err_dev_exit;
err = rtnl_link_register(&nsim_link_ops);
err = nsim_fib_init();
if (err)
goto err_bus_exit;
err = rtnl_link_register(&nsim_link_ops);
if (err)
goto err_fib_exit;
return 0;
err_fib_exit:
nsim_fib_exit();
err_bus_exit:
nsim_bus_exit();
err_dev_exit:
@@ -373,6 +379,7 @@ err_dev_exit:
static void __exit nsim_module_exit(void)
{
rtnl_link_unregister(&nsim_link_ops);
nsim_fib_exit();
nsim_bus_exit();
nsim_dev_exit();
}