]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit
ipmr: Add FIB notification access functions
authorYotam Gigi <yotamg@mellanox.com>
Wed, 27 Sep 2017 06:23:13 +0000 (08:23 +0200)
committerDavid S. Miller <davem@davemloft.net>
Wed, 27 Sep 2017 18:33:27 +0000 (11:33 -0700)
commit4d65b9487831170e699b2fc64a91b839d729bd78
treea846f53eb3a0b6397634b8c753f576eadbdfd0ab
parent310ebbba3b7396b00bce08a33f1d2de2c74fa257
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>
include/linux/mroute.h
include/net/netns/ipv4.h
net/ipv4/ipmr.c