• Sathya Perla's avatar
    net: fix saving TX flow hash in sock for outgoing connections · 9e7ceb06
    Sathya Perla authored
    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: b73c3d0e("net: Save TX flow hash in sock and set in skbuf on xmit")
    Signed-off-by: default avatarSathya Perla <sathya.perla@emulex.com>
    Acked-by: default avatarEric Dumazet <edumazet@google.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    9e7ceb06
tcp_ipv4.c 62.3 KB