diff options
author | Yotam Gigi <yotamg@mellanox.com> | 2017-09-27 09:23:13 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-09-27 21:33:27 +0300 |
commit | 4d65b9487831170e699b2fc64a91b839d729bd78 (patch) | |
tree | a846f53eb3a0b6397634b8c753f576eadbdfd0ab /include/net/netns/ipv4.h | |
parent | 310ebbba3b7396b00bce08a33f1d2de2c74fa257 (diff) | |
download | linux-4d65b9487831170e699b2fc64a91b839d729bd78.tar.xz |
ipmr: Add FIB notification access functions
Make the ipmr module register as a FIB notifier. To do that, implement both
the ipmr_seq_read and ipmr_dump ops.
The ipmr_seq_read op returns a sequence counter that is incremented on
every notification related operation done by the ipmr. To implement that,
add a sequence counter in the netns_ipv4 struct and increment it whenever a
new MFC route or VIF are added or deleted. The sequence operations are
protected by the RTNL lock.
The ipmr_dump iterates the list of MFC routes and the list of VIF entries
and sends notifications about them. The entries dump is done under RCU
where the VIF dump uses the mrt_lock too, as the vif->dev field can change
under RCU.
Signed-off-by: Yotam Gigi <yotamg@mellanox.com>
Reviewed-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Reviewed-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/netns/ipv4.h')
-rw-r--r-- | include/net/netns/ipv4.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/include/net/netns/ipv4.h b/include/net/netns/ipv4.h index 8387f099115e..abc84d986da4 100644 --- a/include/net/netns/ipv4.h +++ b/include/net/netns/ipv4.h @@ -163,6 +163,9 @@ struct netns_ipv4 { struct fib_notifier_ops *notifier_ops; unsigned int fib_seq; /* protected by rtnl_mutex */ + struct fib_notifier_ops *ipmr_notifier_ops; + unsigned int ipmr_seq; /* protected by rtnl_mutex */ + atomic_t rt_genid; }; #endif |