diff options
author | Jiri Pirko <jiri@mellanox.com> | 2019-09-30 10:15:10 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2019-10-02 11:48:44 -0400 |
commit | a30c7b429f2dd980202c912fcb76442364937b4d (patch) | |
tree | 4537260b19131102d96cab06268e89ed7ae052c5 /include/net | |
parent | afa0df5998131153ec3036f41e76ece33bf1334f (diff) | |
download | linux-stable-a30c7b429f2dd980202c912fcb76442364937b4d.tar.gz linux-stable-a30c7b429f2dd980202c912fcb76442364937b4d.tar.bz2 linux-stable-a30c7b429f2dd980202c912fcb76442364937b4d.zip |
net: introduce per-netns netdevice notifiers
Often the code for example in drivers is interested in getting notifier
call only from certain network namespace. In addition to the existing
global netdevice notifier chain introduce per-netns chains and allow
users to register to that. Eventually this would eliminate unnecessary
overhead in case there are many netdevices in many network namespaces.
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net')
-rw-r--r-- | include/net/net_namespace.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/include/net/net_namespace.h b/include/net/net_namespace.h index c5a98e03591d..5ac2bb16d4b3 100644 --- a/include/net/net_namespace.h +++ b/include/net/net_namespace.h @@ -36,6 +36,7 @@ #include <linux/ns_common.h> #include <linux/idr.h> #include <linux/skbuff.h> +#include <linux/notifier.h> struct user_namespace; struct proc_dir_entry; @@ -96,6 +97,8 @@ struct net { struct list_head dev_base_head; struct hlist_head *dev_name_head; struct hlist_head *dev_index_head; + struct raw_notifier_head netdev_chain; + unsigned int dev_base_seq; /* protected by rtnl_mutex */ int ifindex; unsigned int dev_unreg_count; |