aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/netdevsim/netdevsim.h
diff options
context:
space:
mode:
authorJiri Pirko <jiri@mellanox.com>2019-04-25 15:59:54 +0200
committerDavid S. Miller <davem@davemloft.net>2019-04-26 01:52:03 -0400
commit794b2c05ca1c4ded4a023d11833e3855a0ed6ea8 (patch)
tree5230f4fd38b88f53e70baba251cda58074b1a40f /drivers/net/netdevsim/netdevsim.h
parentnetdevsim: implement dev probe/remove skeleton with port initialization (diff)
downloadlinux-dev-794b2c05ca1c4ded4a023d11833e3855a0ed6ea8.tar.xz
linux-dev-794b2c05ca1c4ded4a023d11833e3855a0ed6ea8.zip
netdevsim: extend device attrs to support port addition and deletion
In order to test flows in core, it is beneficial to maintain previously supported possibility to add and delete ports during netdevsim lifetime. Do it by extending device sysfs attrs by "new_port" and "del_port". Signed-off-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/netdevsim/netdevsim.h')
-rw-r--r--drivers/net/netdevsim/netdevsim.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/net/netdevsim/netdevsim.h b/drivers/net/netdevsim/netdevsim.h
index 0e6ca85e5487..6b60589cab91 100644
--- a/drivers/net/netdevsim/netdevsim.h
+++ b/drivers/net/netdevsim/netdevsim.h
@@ -152,12 +152,17 @@ struct nsim_dev {
struct list_head bpf_bound_maps;
struct netdev_phys_item_id switch_id;
struct list_head port_list;
+ struct mutex port_list_lock; /* protects port list */
};
int nsim_dev_init(void);
void nsim_dev_exit(void);
int nsim_dev_probe(struct nsim_bus_dev *nsim_bus_dev);
void nsim_dev_remove(struct nsim_bus_dev *nsim_bus_dev);
+int nsim_dev_port_add(struct nsim_bus_dev *nsim_bus_dev,
+ unsigned int port_index);
+int nsim_dev_port_del(struct nsim_bus_dev *nsim_bus_dev,
+ unsigned int port_index);
struct nsim_fib_data *nsim_fib_create(void);
void nsim_fib_destroy(struct nsim_fib_data *fib_data);