]> git.baikalelectronics.ru Git - kernel.git/commit
skbuff: preserve sock reference when scrubbing the skb.
authorFlavio Leitner <fbl@redhat.com>
Wed, 27 Jun 2018 13:34:26 +0000 (10:34 -0300)
committerDavid S. Miller <davem@davemloft.net>
Thu, 28 Jun 2018 13:21:32 +0000 (22:21 +0900)
commitad414b1000c3229edf1e123ae1da7dceed165473
treef692ec93f735a81396e68840004926ac8e0d7184
parent45b00f6a8b3ca6599968f9e149925aa0d48c9286
skbuff: preserve sock reference when scrubbing the skb.

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: Flavio Leitner <fbl@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Documentation/networking/ip-sysctl.txt
net/core/skbuff.c