diff options
author | Flavio Leitner <fbl@redhat.com> | 2018-06-27 15:34:26 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-06-28 15:21:32 +0200 |
commit | 9c4c325252c54b34d53b3d0ffd535182b744e03d (patch) | |
tree | f692ec93f735a81396e68840004926ac8e0d7184 /net | |
parent | netfilter: check if the socket netns is correct. (diff) | |
download | linux-9c4c325252c54b34d53b3d0ffd535182b744e03d.tar.xz linux-9c4c325252c54b34d53b3d0ffd535182b744e03d.zip |
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>
Diffstat (limited to 'net')
-rw-r--r-- | net/core/skbuff.c | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/net/core/skbuff.c b/net/core/skbuff.c index b1f274f22d85..f59e98ca72c5 100644 --- a/net/core/skbuff.c +++ b/net/core/skbuff.c @@ -4911,7 +4911,6 @@ void skb_scrub_packet(struct sk_buff *skb, bool xnet) return; ipvs_reset(skb); - skb_orphan(skb); skb->mark = 0; } EXPORT_SYMBOL_GPL(skb_scrub_packet); |