summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorYuval Mintz <yuvalm@mellanox.com>2018-02-28 23:29:33 +0200
committerDavid S. Miller <davem@davemloft.net>2018-03-01 13:13:23 -0500
commit0bbbf0e7d0e7ea8267836986346a9b3a35b74e4e (patch)
tree4a7f295d9179f46de5181dab1501b423d9a6c23e /include
parentb70432f7319eb75b24ca57dde8146c5e27244780 (diff)
downloadlinux-0bbbf0e7d0e7ea8267836986346a9b3a35b74e4e.tar.bz2
ipmr, ip6mr: Unite creation of new mr_table
Now that both ipmr and ip6mr are using the same mr_table structure, we can have a common function to allocate & initialize a new instance. Signed-off-by: Yuval Mintz <yuvalm@mellanox.com> Acked-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include')
-rw-r--r--include/linux/mroute_base.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/include/linux/mroute_base.h b/include/linux/mroute_base.h
index 1cc944a14df5..805305722803 100644
--- a/include/linux/mroute_base.h
+++ b/include/linux/mroute_base.h
@@ -85,6 +85,13 @@ void vif_device_init(struct vif_device *v,
unsigned char threshold,
unsigned short flags,
unsigned short get_iflink_mask);
+
+struct mr_table *
+mr_table_alloc(struct net *net, u32 id,
+ const struct rhashtable_params *rht_params,
+ void (*expire_func)(struct timer_list *t),
+ void (*table_set)(struct mr_table *mrt,
+ struct net *net));
#else
static inline void vif_device_init(struct vif_device *v,
struct net_device *dev,
@@ -94,5 +101,15 @@ static inline void vif_device_init(struct vif_device *v,
unsigned short get_iflink_mask)
{
}
+
+static inline struct mr_table *
+mr_table_alloc(struct net *net, u32 id,
+ const struct rhashtable_params *rht_params,
+ void (*expire_func)(struct timer_list *t),
+ void (*table_set)(struct mr_table *mrt,
+ struct net *net))
+{
+ return NULL;
+}
#endif
#endif