diff options
author | Eric Dumazet <edumazet@google.com> | 2015-09-15 18:24:20 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-09-18 00:01:04 -0400 |
commit | 58d607d3e52f2b15902f58a1161da9fb3b0f6d47 (patch) | |
tree | 1949d88eb7d541878079ddafa607c31017099349 /net/ipv4/tcp_input.c | |
parent | bbe8373138a1fe92160a18418e7298b4c0128ff1 (diff) |
tcp: provide skb->hash to synack packets
In commit b73c3d0e4f0e ("net: Save TX flow hash in sock and set in skbuf
on xmit"), Tom provided a l4 hash to most outgoing TCP packets.
We'd like to provide one as well for SYNACK packets, so that all packets
of a given flow share same txhash, to later enable bonding driver to
also use skb->hash to perform slave selection.
Note that a SYNACK retransmit shuffles the tx hash, as Tom did
in commit 265f94ff54d62 ("net: Recompute sk_txhash on negative routing
advice") for established sockets.
This has nice effect making TCP flows resilient to some kind of black
holes, even at connection establish phase.
Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Tom Herbert <tom@herbertland.com>
Cc: Mahesh Bandewar <maheshb@google.com>
Acked-by: Tom Herbert <tom@herbertland.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/tcp_input.c')
-rw-r--r-- | net/ipv4/tcp_input.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c index a8f515bb19c4..a62e9c76d485 100644 --- a/net/ipv4/tcp_input.c +++ b/net/ipv4/tcp_input.c | |||
@@ -6228,6 +6228,7 @@ int tcp_conn_request(struct request_sock_ops *rsk_ops, | |||
6228 | } | 6228 | } |
6229 | 6229 | ||
6230 | tcp_rsk(req)->snt_isn = isn; | 6230 | tcp_rsk(req)->snt_isn = isn; |
6231 | tcp_rsk(req)->txhash = net_tx_rndhash(); | ||
6231 | tcp_openreq_init_rwin(req, sk, dst); | 6232 | tcp_openreq_init_rwin(req, sk, dst); |
6232 | fastopen = !want_cookie && | 6233 | fastopen = !want_cookie && |
6233 | tcp_try_fastopen(sk, skb, req, &foc, dst); | 6234 | tcp_try_fastopen(sk, skb, req, &foc, dst); |