From: Alexander Lobakin <alobakin@pm.me>
To: "David S. Miller" <davem@davemloft.net>,
Jakub Kicinski <kuba@kernel.org>
Cc: Alexei Starovoitov <ast@kernel.org>,
Daniel Borkmann <daniel@iogearbox.net>,
Andrii Nakryiko <andrii@kernel.org>,
Martin KaFai Lau <kafai@fb.com>, Song Liu <songliubraving@fb.com>,
Yonghong Song <yhs@fb.com>,
John Fastabend <john.fastabend@gmail.com>,
KP Singh <kpsingh@kernel.org>,
Jonathan Lemon <jonathan.lemon@gmail.com>,
Alexander Lobakin <alobakin@pm.me>,
Eric Dumazet <edumazet@google.com>,
Willem de Bruijn <willemb@google.com>,
Kevin Hao <haokexin@gmail.com>,
Pablo Neira Ayuso <pablo@netfilter.org>,
Jakub Sitnicki <jakub@cloudflare.com>,
Marco Elver <elver@google.com>, Dexuan Cui <decui@microsoft.com>,
Vladimir Oltean <vladimir.oltean@nxp.com>,
Ariel Levkovich <lariel@mellanox.com>,
Wang Qing <wangqing@vivo.com>,
Davide Caratti <dcaratti@redhat.com>,
Guillaume Nault <gnault@redhat.com>,
Eran Ben Elisha <eranbe@nvidia.com>,
Mauro Carvalho Chehab <mchehab+huawei@kernel.org>,
Kirill Tkhai <ktkhai@virtuozzo.com>,
Bartosz Golaszewski <bgolaszewski@baylibre.com>,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
bpf@vger.kernel.org
Subject: [PATCH v2 net-next 0/6] skbuff: micro-optimize flow dissection
Date: Sat, 13 Mar 2021 11:37:03 +0000 [thread overview]
Message-ID: <20210313113645.5949-1-alobakin@pm.me> (raw)
This little number makes all of the flow dissection functions take
raw input data pointer as const (1-5) and shuffles the branches in
__skb_header_pointer() according to their hit probability.
The result is +20 Mbps per flow/core with one Flow Dissector pass
per packet. This affects RPS (with software hashing), drivers that
use eth_get_headlen() on their Rx path and so on.
Since v1 [0]:
- rebase on top of the latest net-next. This was super-weird, but
I double-checked that the series applies with no conflicts, and
then on Patchwork it didn't;
- no other changes.
[0] https://lore.kernel.org/netdev/20210312194538.337504-1-alobakin@pm.me
Alexander Lobakin (6):
flow_dissector: constify bpf_flow_dissector's data pointers
skbuff: make __skb_header_pointer()'s data argument const
flow_dissector: constify raw input @data argument
linux/etherdevice.h: misc trailing whitespace cleanup
ethernet: constify eth_get_headlen()'s @data argument
skbuff: micro-optimize {,__}skb_header_pointer()
include/linux/etherdevice.h | 4 ++--
include/linux/skbuff.h | 26 +++++++++++------------
include/net/flow_dissector.h | 6 +++---
net/core/flow_dissector.c | 41 +++++++++++++++++++-----------------
net/ethernet/eth.c | 2 +-
5 files changed, 40 insertions(+), 39 deletions(-)
--
2.30.2
next reply other threads:[~2021-03-13 11:38 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-13 11:37 Alexander Lobakin [this message]
2021-03-13 11:37 ` [PATCH v2 net-next 1/6] flow_dissector: constify bpf_flow_dissector's data pointers Alexander Lobakin
2021-03-13 11:37 ` [PATCH v2 net-next 2/6] skbuff: make __skb_header_pointer()'s data argument const Alexander Lobakin
2021-03-13 11:37 ` [PATCH v2 net-next 3/6] flow_dissector: constify raw input @data argument Alexander Lobakin
2021-03-13 11:37 ` [PATCH v2 net-next 4/6] linux/etherdevice.h: misc trailing whitespace cleanup Alexander Lobakin
2021-03-13 11:37 ` [PATCH v2 net-next 5/6] ethernet: constify eth_get_headlen()'s @data argument Alexander Lobakin
2021-03-13 11:38 ` [PATCH v2 net-next 6/6] skbuff: micro-optimize {,__}skb_header_pointer() Alexander Lobakin
2021-03-13 13:30 ` [PATCH v2 net-next 0/6] skbuff: micro-optimize flow dissection Alexander Lobakin
2021-03-14 2:10 ` David Miller
2021-03-14 10:15 ` Alexander Lobakin
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=20210313113645.5949-1-alobakin@pm.me \
--to=alobakin@pm.me \
--cc=andrii@kernel.org \
--cc=ast@kernel.org \
--cc=bgolaszewski@baylibre.com \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=davem@davemloft.net \
--cc=dcaratti@redhat.com \
--cc=decui@microsoft.com \
--cc=edumazet@google.com \
--cc=elver@google.com \
--cc=eranbe@nvidia.com \
--cc=gnault@redhat.com \
--cc=haokexin@gmail.com \
--cc=jakub@cloudflare.com \
--cc=john.fastabend@gmail.com \
--cc=jonathan.lemon@gmail.com \
--cc=kafai@fb.com \
--cc=kpsingh@kernel.org \
--cc=ktkhai@virtuozzo.com \
--cc=kuba@kernel.org \
--cc=lariel@mellanox.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mchehab+huawei@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pablo@netfilter.org \
--cc=songliubraving@fb.com \
--cc=vladimir.oltean@nxp.com \
--cc=wangqing@vivo.com \
--cc=willemb@google.com \
--cc=yhs@fb.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;
as well as URLs for NNTP newsgroup(s).