Commit 87c418bf authored by Yuval Mintz's avatar Yuval Mintz Committed by David S. Miller

ip6mr: Align hash implementation to ipmr

Since commit 8fb472c0 ("ipmr: improve hash scalability") ipmr has
been using rhashtable as a basis for its mfc routes, but ip6mr is
currently still using the old private MFC hash implementation.

Align ip6mr to the current ipmr implementation.
Signed-off-by: default avatarYuval Mintz <yuvalm@mellanox.com>
Acked-by: default avatarNikolay Aleksandrov <nikolay@cumulusnetworks.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 8571ab47
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
#include <net/net_namespace.h> #include <net/net_namespace.h>
#include <uapi/linux/mroute6.h> #include <uapi/linux/mroute6.h>
#include <linux/mroute_base.h> #include <linux/mroute_base.h>
#include <linux/rhashtable.h>
#ifdef CONFIG_IPV6_MROUTE #ifdef CONFIG_IPV6_MROUTE
static inline int ip6_mroute_opt(int opt) static inline int ip6_mroute_opt(int opt)
...@@ -65,10 +66,20 @@ static inline void ip6_mr_cleanup(void) ...@@ -65,10 +66,20 @@ static inline void ip6_mr_cleanup(void)
#define VIFF_STATIC 0x8000 #define VIFF_STATIC 0x8000
struct mfc6_cache_cmp_arg {
struct in6_addr mf6c_mcastgrp;
struct in6_addr mf6c_origin;
};
struct mfc6_cache { struct mfc6_cache {
struct list_head list; struct rhlist_head mnode;
struct in6_addr mf6c_mcastgrp; /* Group the entry belongs to */ union {
struct in6_addr mf6c_origin; /* Source of packet */ struct {
struct in6_addr mf6c_mcastgrp;
struct in6_addr mf6c_origin;
};
struct mfc6_cache_cmp_arg cmparg;
};
mifi_t mf6c_parent; /* Source interface */ mifi_t mf6c_parent; /* Source interface */
int mfc_flags; /* Flags on line */ int mfc_flags; /* Flags on line */
...@@ -88,22 +99,13 @@ struct mfc6_cache { ...@@ -88,22 +99,13 @@ struct mfc6_cache {
unsigned char ttls[MAXMIFS]; /* TTL thresholds */ unsigned char ttls[MAXMIFS]; /* TTL thresholds */
} res; } res;
} mfc_un; } mfc_un;
struct list_head list;
struct rcu_head rcu;
}; };
#define MFC_STATIC 1 #define MFC_STATIC 1
#define MFC_NOTIFY 2 #define MFC_NOTIFY 2
#define MFC6_LINES 64
#define MFC6_HASH(a, g) (((__force u32)(a)->s6_addr32[0] ^ \
(__force u32)(a)->s6_addr32[1] ^ \
(__force u32)(a)->s6_addr32[2] ^ \
(__force u32)(a)->s6_addr32[3] ^ \
(__force u32)(g)->s6_addr32[0] ^ \
(__force u32)(g)->s6_addr32[1] ^ \
(__force u32)(g)->s6_addr32[2] ^ \
(__force u32)(g)->s6_addr32[3]) % MFC6_LINES)
#define MFC_ASSERT_THRESH (3*HZ) /* Maximal freq. of asserts */ #define MFC_ASSERT_THRESH (3*HZ) /* Maximal freq. of asserts */
struct rtmsg; struct rtmsg;
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment