Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b4bac172 authored by David Ahern's avatar David Ahern Committed by David S. Miller
Browse files

net/ipv6: Add support for path selection using hash of 5-tuple



Some operators prefer IPv6 path selection to use a standard 5-tuple
hash rather than just an L3 hash with the flow the label. To that end
add support to IPv6 for multipath hash policy similar to bf4e0a3d
("net: ipv4: add support for ECMP hash policy choice"). The default
is still L3 which covers source and destination addresses along with
flow label and IPv6 protocol.

Signed-off-by: default avatarDavid Ahern <dsahern@gmail.com>
Reviewed-by: default avatarIdo Schimmel <idosch@mellanox.com>
Tested-by: default avatarIdo Schimmel <idosch@mellanox.com>
Reviewed-by: default avatarNikolay Aleksandrov <nikolay@cumulusnetworks.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent b75cc8f9
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -1363,6 +1363,13 @@ flowlabel_reflect - BOOLEAN
	FALSE: disabled
	Default: FALSE

fib_multipath_hash_policy - INTEGER
	Controls which hash policy to use for multipath routes.
	Default: 0 (Layer 3)
	Possible values:
	0 - Layer 3 (source and destination addresses plus flow label)
	1 - Layer 4 (standard 5-tuple)

anycast_src_echo_reply - BOOLEAN
	Controls the use of anycast addresses as source addresses for ICMPv6
	echo reply
+2 −2
Original line number Diff line number Diff line
@@ -130,8 +130,8 @@ static inline int ip6_route_get_saddr(struct net *net, struct rt6_info *rt,
struct rt6_info *rt6_lookup(struct net *net, const struct in6_addr *daddr,
			    const struct in6_addr *saddr, int oif,
			    const struct sk_buff *skb, int flags);
u32 rt6_multipath_hash(const struct flowi6 *fl6, const struct sk_buff *skb,
		       struct flow_keys *hkeys);
u32 rt6_multipath_hash(const struct net *net, const struct flowi6 *fl6,
		       const struct sk_buff *skb, struct flow_keys *hkeys);

struct dst_entry *icmp6_dst_alloc(struct net_device *dev, struct flowi6 *fl6);

+1 −0
Original line number Diff line number Diff line
@@ -27,6 +27,7 @@ enum netevent_notif_type {
	NETEVENT_REDIRECT,	   /* arg is struct netevent_redirect ptr */
	NETEVENT_DELAY_PROBE_TIME_UPDATE, /* arg is struct neigh_parms ptr */
	NETEVENT_IPV4_MPATH_HASH_UPDATE, /* arg is struct net ptr */
	NETEVENT_IPV6_MPATH_HASH_UPDATE, /* arg is struct net ptr */
};

int register_netevent_notifier(struct notifier_block *nb);
+1 −0
Original line number Diff line number Diff line
@@ -28,6 +28,7 @@ struct netns_sysctl_ipv6 {
	int ip6_rt_gc_elasticity;
	int ip6_rt_mtu_expires;
	int ip6_rt_min_advmss;
	int multipath_hash_policy;
	int flowlabel_consistency;
	int auto_flowlabels;
	int icmpv6_time;
+1 −1
Original line number Diff line number Diff line
@@ -522,7 +522,7 @@ static void icmp6_send(struct sk_buff *skb, u8 type, u8 code, __u32 info,
	fl6.fl6_icmp_type = type;
	fl6.fl6_icmp_code = code;
	fl6.flowi6_uid = sock_net_uid(net, NULL);
	fl6.mp_hash = rt6_multipath_hash(&fl6, skb, NULL);
	fl6.mp_hash = rt6_multipath_hash(net, &fl6, skb, NULL);
	security_skb_classify_flow(skb, flowi6_to_flowi(&fl6));

	sk = icmpv6_xmit_lock(net);
Loading