aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/netdevsim/netdevsim.h
diff options
context:
space:
mode:
authorJiri Pirko <jiri@mellanox.com>2019-04-25 15:59:42 +0200
committerDavid S. Miller <davem@davemloft.net>2019-04-26 01:52:02 -0400
commit5fc494225c1eb81309cc4c91f183cd30e4edb674 (patch)
tree4369d3393e958b7ffb3cf7cd4d5eba271d7f78ad /drivers/net/netdevsim/netdevsim.h
parentnetdevsim: move device registration on bus to be done earlier in init (diff)
downloadlinux-dev-5fc494225c1eb81309cc4c91f183cd30e4edb674.tar.xz
linux-dev-5fc494225c1eb81309cc4c91f183cd30e4edb674.zip
netdevsim: create devlink instance per netdevsim instance
Currently there is one devlink instance created per network namespace. That is quite odd considering the fact that devlink instance should represent an ASIC. The following patches are going to move the devlink instance even more down to a bus device, but until then, have one devlink instance per netdevsim instance. Struct nsim_devlink is introduced to hold fib setting. The changes in the fib code are only related to holding the configuration per devlink instance instead of network namespace. Signed-off-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to '')
-rw-r--r--drivers/net/netdevsim/netdevsim.h18
1 files changed, 9 insertions, 9 deletions
diff --git a/drivers/net/netdevsim/netdevsim.h b/drivers/net/netdevsim/netdevsim.h
index 2667f9b0e1f9..df50eb19715d 100644
--- a/drivers/net/netdevsim/netdevsim.h
+++ b/drivers/net/netdevsim/netdevsim.h
@@ -30,6 +30,7 @@ struct bpf_prog;
struct bpf_offload_dev;
struct dentry;
struct nsim_vf_config;
+struct nsim_fib_data;
struct netdevsim_shared_dev {
unsigned int refcnt;
@@ -153,16 +154,15 @@ enum nsim_resource_id {
NSIM_RESOURCE_IPV6_FIB_RULES,
};
-int nsim_devlink_setup(struct netdevsim *ns);
-void nsim_devlink_teardown(struct netdevsim *ns);
+int nsim_devlink_init(struct netdevsim *ns);
+void nsim_devlink_exit(struct netdevsim *ns);
-int nsim_devlink_init(void);
-void nsim_devlink_exit(void);
-
-int nsim_fib_init(void);
-void nsim_fib_exit(void);
-u64 nsim_fib_get_val(struct net *net, enum nsim_resource_id res_id, bool max);
-int nsim_fib_set_max(struct net *net, enum nsim_resource_id res_id, u64 val,
+struct nsim_fib_data *nsim_fib_create(void);
+void nsim_fib_destroy(struct nsim_fib_data *fib_data);
+u64 nsim_fib_get_val(struct nsim_fib_data *fib_data,
+ enum nsim_resource_id res_id, bool max);
+int nsim_fib_set_max(struct nsim_fib_data *fib_data,
+ enum nsim_resource_id res_id, u64 val,
struct netlink_ext_ack *extack);
#if IS_ENABLED(CONFIG_XFRM_OFFLOAD)