]> www.infradead.org Git - users/jedix/linux-maple.git/commit
net: ipv4: add support for ECMP hash policy choice
authorVenkat Venkatsubra <venkat.x.venkatsubra@oracle.com>
Wed, 16 May 2018 21:08:50 +0000 (14:08 -0700)
committerBrian Maly <brian.maly@oracle.com>
Mon, 21 May 2018 21:05:45 +0000 (17:05 -0400)
commita424ef52f0bfd75bb1f566cfcf1fe1dac39d85e8
tree140af5d3b2e23108aa52d5656ecdf4d7b031b575
parent0fbdc0df27ab2fc6828279be8954af45793ea9d9
net: ipv4: add support for ECMP hash policy choice

This patch adds support for ECMP hash policy choice via a new sysctl
called fib_multipath_hash_policy and also adds support for L4 hashes.
The current values for fib_multipath_hash_policy are:
 0 - layer 3 (default)
 1 - layer 4
If there's an skb hash already set and it matches the chosen policy then it
will be used instead of being calculated (currently only for L4).
In L3 mode we always calculate the hash due to the ICMP error special
case, the flow dissector's field consistentification should handle the
address order thus we can remove the address reversals.
If the skb is provided we always use it for the hash calculation,
otherwise we fallback to fl4, that is if skb is NULL fl4 has to be set.

Orabug: 27547114

Signed-off-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit bf4e0a3db97eb882368fd82980b3b1fa0b5b9778)

Reviewed-by: Zhu Yanjun <yanjun.zhu@oracle.com>
Signed-off-by: Venkat Venkatsubra <venkat.x.venkatsubra@oracle.com>
Signed-off-by: Brian Maly <brian.maly@oracle.com>
Conflicts:
include/net/ip_fib.h
include/net/netns/ipv4.h
include/net/route.h
net/ipv4/fib_semantics.c
net/ipv4/icmp.c
net/ipv4/route.c
net/ipv4/sysctl_net_ipv4.c

Signed-off-by: Brian Maly <brian.maly@oracle.com>
Documentation/networking/ip-sysctl.txt
include/net/ip_fib.h
include/net/route.h
net/ipv4/fib_semantics.c
net/ipv4/route.c
net/ipv4/sysctl_net_ipv4.c