summaryrefslogtreecommitdiffstats
path: root/include/linux/mroute_base.h
diff options
context:
space:
mode:
authorYuval Mintz <yuvalm@mellanox.com>2018-03-26 15:01:32 +0300
committerDavid S. Miller <davem@davemloft.net>2018-03-26 13:14:42 -0400
commit54c4cad97b8fd414909b78d4274a6797baa52b3b (patch)
treefc3ddfbf44faa93392047ac1ad1eaf458cb7524d /include/linux/mroute_base.h
parentbc67a0daf8f3bc6fa8fcb68090f3c444de7f951c (diff)
downloadlinux-0-day-54c4cad97b8fd414909b78d4274a6797baa52b3b.tar.gz
linux-0-day-54c4cad97b8fd414909b78d4274a6797baa52b3b.tar.xz
ipmr: Make MFC fib notifiers common
Like vif notifications, move the notifier struct for MFC as well as its helpers into a common file; Currently they're only used by ipmr. Signed-off-by: Yuval Mintz <yuvalm@mellanox.com> Signed-off-by: Ido Schimmel <idosch@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux/mroute_base.h')
-rw-r--r--include/linux/mroute_base.h44
1 files changed, 44 insertions, 0 deletions
diff --git a/include/linux/mroute_base.h b/include/linux/mroute_base.h
index 23326f5402f3c..2c594686c05e6 100644
--- a/include/linux/mroute_base.h
+++ b/include/linux/mroute_base.h
@@ -152,6 +152,50 @@ struct mr_mfc {
struct rcu_head rcu;
};
+struct mfc_entry_notifier_info {
+ struct fib_notifier_info info;
+ struct mr_mfc *mfc;
+ u32 tb_id;
+};
+
+static inline int mr_call_mfc_notifier(struct notifier_block *nb,
+ struct net *net,
+ unsigned short family,
+ enum fib_event_type event_type,
+ struct mr_mfc *mfc, u32 tb_id)
+{
+ struct mfc_entry_notifier_info info = {
+ .info = {
+ .family = family,
+ .net = net,
+ },
+ .mfc = mfc,
+ .tb_id = tb_id
+ };
+
+ return call_fib_notifier(nb, net, event_type, &info.info);
+}
+
+static inline int mr_call_mfc_notifiers(struct net *net,
+ unsigned short family,
+ enum fib_event_type event_type,
+ struct mr_mfc *mfc, u32 tb_id,
+ unsigned int *ipmr_seq)
+{
+ struct mfc_entry_notifier_info info = {
+ .info = {
+ .family = family,
+ .net = net,
+ },
+ .mfc = mfc,
+ .tb_id = tb_id
+ };
+
+ ASSERT_RTNL();
+ (*ipmr_seq)++;
+ return call_fib_notifiers(net, event_type, &info.info);
+}
+
struct mr_table;
/**