Skip to content

Commit

Permalink
ip6mr: Align hash implementation to ipmr
Browse files Browse the repository at this point in the history
Since commit 8fb472c ("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: Yuval Mintz <yuvalm@mellanox.com>
Acked-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Yuval Mintz authored and davem330 committed Mar 1, 2018
1 parent 8571ab4 commit 87c418b
Show file tree
Hide file tree
Showing 2 changed files with 184 additions and 159 deletions.
30 changes: 16 additions & 14 deletions include/linux/mroute6.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#include <net/net_namespace.h>
#include <uapi/linux/mroute6.h>
#include <linux/mroute_base.h>
#include <linux/rhashtable.h>

#ifdef CONFIG_IPV6_MROUTE
static inline int ip6_mroute_opt(int opt)
Expand Down Expand Up @@ -65,10 +66,20 @@ static inline void ip6_mr_cleanup(void)

#define VIFF_STATIC 0x8000

struct mfc6_cache_cmp_arg {
struct in6_addr mf6c_mcastgrp;
struct in6_addr mf6c_origin;
};

struct mfc6_cache {
struct list_head list;
struct in6_addr mf6c_mcastgrp; /* Group the entry belongs to */
struct in6_addr mf6c_origin; /* Source of packet */
struct rhlist_head mnode;
union {
struct {
struct in6_addr mf6c_mcastgrp;
struct in6_addr mf6c_origin;
};
struct mfc6_cache_cmp_arg cmparg;
};
mifi_t mf6c_parent; /* Source interface */
int mfc_flags; /* Flags on line */

Expand All @@ -88,22 +99,13 @@ struct mfc6_cache {
unsigned char ttls[MAXMIFS]; /* TTL thresholds */
} res;
} mfc_un;
struct list_head list;
struct rcu_head rcu;
};

#define MFC_STATIC 1
#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 */

struct rtmsg;
Expand Down
Loading

0 comments on commit 87c418b

Please sign in to comment.