]> git.baikalelectronics.ru Git - kernel.git/commit
net: fix saving TX flow hash in sock for outgoing connections
authorSathya Perla <sathya.perla@emulex.com>
Wed, 22 Oct 2014 16:12:01 +0000 (21:42 +0530)
committerDavid S. Miller <davem@davemloft.net>
Wed, 22 Oct 2014 20:14:29 +0000 (16:14 -0400)
commite8fad8331ca1bbae1922fe9524ac02d2f0217e5a
treeb94b6da692403861e4adc2835b994699beaa9a2b
parent537ecf537810d024c14875bcccfd2d05955220ec
net: fix saving TX flow hash in sock for outgoing connections

The commit "net: Save TX flow hash in sock and set in skbuf on xmit"
introduced the inet_set_txhash() and ip6_set_txhash() routines to calculate
and record flow hash(sk_txhash) in the socket structure. sk_txhash is used
to set skb->hash which is used to spread flows across multiple TXQs.

But, the above routines are invoked before the source port of the connection
is created. Because of this all outgoing connections that just differ in the
source port get hashed into the same TXQ.

This patch fixes this problem for IPv4/6 by invoking the the above routines
after the source port is available for the socket.

Fixes: 7ca6a9f13("net: Save TX flow hash in sock and set in skbuf on xmit")
Signed-off-by: Sathya Perla <sathya.perla@emulex.com>
Acked-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv4/tcp_ipv4.c
net/ipv6/tcp_ipv6.c