aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/fib_semantics.c
diff options
context:
space:
mode:
authorPaolo Abeni <pabeni@redhat.com>2015-10-29 17:20:40 -0400
committerDavid S. Miller <davem@davemloft.net>2015-11-02 14:38:43 -0500
commit9920e48b830a0f4ec06bcbf0ec3147c88ae72bac (patch)
treeffc26343183c1249bc2456622bf733e6ca66bbcf /net/ipv4/fib_semantics.c
parent1032a6687168af9509615879d513f77e4049062e (diff)
ipv4: use l4 hash for locally generated multipath flows
This patch changes how the multipath hash is computed for locally generated flows: now the hash comprises l4 information. This allows better utilization of the available paths when the existing flows have the same source IP and the same destination IP: with l3 hash, even when multiple connections are in place simultaneously, a single path will be used, while with l4 hash we can use all the available paths. v2 changes: - use get_hash_from_flowi4() instead of implementing just another l4 hash function Signed-off-by: Paolo Abeni <pabeni@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/fib_semantics.c')
-rw-r--r--net/ipv4/fib_semantics.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/net/ipv4/fib_semantics.c b/net/ipv4/fib_semantics.c
index 42778d9d71e5..f30df0ee4f4d 100644
--- a/net/ipv4/fib_semantics.c
+++ b/net/ipv4/fib_semantics.c
@@ -1564,7 +1564,8 @@ void fib_select_path(struct net *net, struct fib_result *res,
1564#ifdef CONFIG_IP_ROUTE_MULTIPATH 1564#ifdef CONFIG_IP_ROUTE_MULTIPATH
1565 if (res->fi->fib_nhs > 1 && fl4->flowi4_oif == 0) { 1565 if (res->fi->fib_nhs > 1 && fl4->flowi4_oif == 0) {
1566 if (mp_hash < 0) 1566 if (mp_hash < 0)
1567 mp_hash = fib_multipath_hash(fl4->saddr, fl4->daddr); 1567 mp_hash = get_hash_from_flowi4(fl4) >> 1;
1568
1568 fib_select_multipath(res, mp_hash); 1569 fib_select_multipath(res, mp_hash);
1569 } 1570 }
1570 else 1571 else