From: Flavio Leitner <fbl@redhat.com>
To: netdev@vger.kernel.org
Cc: Eric Dumazet <eric.dumazet@gmail.com>,
Paolo Abeni <pabeni@redhat.com>,
David Miller <davem@davemloft.net>,
Florian Westphal <fw@strlen.de>,
netfilter-devel@vger.kernel.org, Flavio Leitner <fbl@redhat.com>
Subject: [PATCH v2 net-next 0/2] net: preserve sock reference when scrubbing the skb.
Date: Wed, 27 Jun 2018 10:34:24 -0300 [thread overview]
Message-ID: <20180627133426.3858-1-fbl@redhat.com> (raw)
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,
but the transmit side needs some extra checking included in the
first patch.
The first patch will update netfilter to check if the socket
netns is local before use it.
The second patch removes the skb_orphan() from the skb_scrub_packet()
and improve the documentation.
ChangeLog:
- split into two (Eric)
- addressed Paolo's offline feedback to swap the checks in xt_socket.c
to preserve original behavior.
- improved ip-sysctl.txt (reported by Cong)
Flavio Leitner (2):
netfilter: check if the socket netns is correct.
skbuff: preserve sock reference when scrubbing the skb.
Documentation/networking/ip-sysctl.txt | 10 +++++-----
include/net/netfilter/nf_log.h | 3 ++-
net/core/skbuff.c | 1 -
net/ipv4/netfilter/nf_log_ipv4.c | 8 ++++----
net/ipv6/netfilter/nf_log_ipv6.c | 8 ++++----
net/netfilter/nf_conntrack_broadcast.c | 2 +-
net/netfilter/nf_log_common.c | 5 +++--
net/netfilter/nf_nat_core.c | 6 +++++-
net/netfilter/nft_meta.c | 9 ++++++---
net/netfilter/nft_socket.c | 5 ++++-
net/netfilter/xt_cgroup.c | 6 ++++--
net/netfilter/xt_owner.c | 2 +-
net/netfilter/xt_recent.c | 3 ++-
net/netfilter/xt_socket.c | 8 ++++++++
14 files changed, 49 insertions(+), 27 deletions(-)
--
2.14.3
next reply other threads:[~2018-06-27 13:34 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-27 13:34 Flavio Leitner [this message]
2018-06-27 13:34 ` [PATCH v2 net-next 1/2] netfilter: check if the socket netns is correct Flavio Leitner
2018-06-27 14:22 ` Florian Westphal
2018-06-27 13:34 ` [PATCH v2 net-next 2/2] skbuff: preserve sock reference when scrubbing the skb Flavio Leitner
2018-06-27 13:56 ` Eric Dumazet
2018-06-27 19:39 ` [PATCH v2 net-next 0/2] net: " Cong Wang
2018-06-28 13:20 ` David Miller
2018-06-28 21:41 ` Cong Wang
2018-06-29 2:20 ` David Miller
2018-06-28 21:53 ` Cong Wang
2018-06-29 2:22 ` David Miller
2018-06-30 0:15 ` Cong Wang
2018-06-28 13:21 ` David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180627133426.3858-1-fbl@redhat.com \
--to=fbl@redhat.com \
--cc=davem@davemloft.net \
--cc=eric.dumazet@gmail.com \
--cc=fw@strlen.de \
--cc=netdev@vger.kernel.org \
--cc=netfilter-devel@vger.kernel.org \
--cc=pabeni@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox