Skip to content

Commit 9c4c325

Browse files
fleitnerdavem330
authored andcommitted
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 <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent f564650 commit 9c4c325

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

Documentation/networking/ip-sysctl.txt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -733,11 +733,11 @@ tcp_limit_output_bytes - INTEGER
733733
Controls TCP Small Queue limit per tcp socket.
734734
TCP bulk sender tends to increase packets in flight until it
735735
gets losses notifications. With SNDBUF autotuning, this can
736-
result in a large amount of packets queued in qdisc/device
737-
on the local machine, hurting latency of other flows, for
738-
typical pfifo_fast qdiscs.
739-
tcp_limit_output_bytes limits the number of bytes on qdisc
740-
or device to reduce artificial RTT/cwnd and reduce bufferbloat.
736+
result in a large amount of packets queued on the local machine
737+
(e.g.: qdiscs, CPU backlog, or device) hurting latency of other
738+
flows, for typical pfifo_fast qdiscs. tcp_limit_output_bytes
739+
limits the number of bytes on qdisc or device to reduce artificial
740+
RTT/cwnd and reduce bufferbloat.
741741
Default: 262144
742742

743743
tcp_challenge_ack_limit - INTEGER

net/core/skbuff.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4911,7 +4911,6 @@ void skb_scrub_packet(struct sk_buff *skb, bool xnet)
49114911
return;
49124912

49134913
ipvs_reset(skb);
4914-
skb_orphan(skb);
49154914
skb->mark = 0;
49164915
}
49174916
EXPORT_SYMBOL_GPL(skb_scrub_packet);

0 commit comments

Comments
 (0)