• Eric Dumazet's avatar
    net: skb_tx_hash() fix relative to skb_orphan_try() · 87fd308c
    Eric Dumazet authored
    commit fc6055a5 (net: Introduce skb_orphan_try()) added early
    orphaning of skbs.
    
    This unfortunately added a performance regression in skb_tx_hash() in
    case of stacked devices (bonding, vlans, ...)
    
    Since skb->sk is now NULL, we cannot access sk->sk_hash anymore to
    spread tx packets to multiple NIC queues on multiqueue devices.
    
    skb_tx_hash() in this case only uses skb->protocol, same value for all
    flows.
    
    skb_orphan_try() can copy sk->sk_hash into skb->rxhash and skb_tx_hash()
    can use this saved sk_hash value to compute its internal hash value.
    Signed-off-by: default avatarEric Dumazet <eric.dumazet@gmail.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    87fd308c
dev.c 144 KB