• Flavio Leitner's avatar
    skbuff: preserve sock reference when scrubbing the skb. · 9c4c3252
    Flavio Leitner authored
    The sock reference is lost when scrubbing the packet and that breaks
    TSQ (TCP Small Queues) and XPS (Transmit Packet Steering) causing
    performance impacts of about 50% in a single TCP stream when crossing
    network namespaces.
    
    XPS breaks because the queue mapping stored in the socket is not
    available, so another random queue might be selected when the stack
    needs to transmit something like a TCP ACK, or TCP Retransmissions.
    That causes packet re-ordering and/or performance issues.
    
    TSQ breaks because it orphans the packet while it is still in the
    host, so packets are queued contributing to the buffer bloat problem.
    
    Preserving the sock reference fixes both issues. The socket is
    orphaned anyways in the receiving path before any relevant action
    and on TX side the netfilter checks if the reference is local before
    use it.
    Signed-off-by: default avatarFlavio Leitner <fbl@redhat.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    9c4c3252
skbuff.c 137 KB