bpf.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 net-next 0/6] skbuff: micro-optimize flow dissection
@ 2021-03-14 11:10 Alexander Lobakin
  2021-03-14 11:11 ` [PATCH v3 net-next 1/6] flow_dissector: constify bpf_flow_dissector's data pointers Alexander Lobakin
                   ` (5 more replies)
  0 siblings, 6 replies; 11+ messages in thread
From: Alexander Lobakin @ 2021-03-14 11:10 UTC (permalink / raw)
  To: David S. Miller, Jakub Kicinski
  Cc: Alexei Starovoitov, Daniel Borkmann, Andrii Nakryiko,
	Martin KaFai Lau, Song Liu, Yonghong Song, John Fastabend,
	KP Singh, Jonathan Lemon, Alexander Lobakin, Eric Dumazet,
	Willem de Bruijn, Kevin Hao, Pablo Neira Ayuso, Jakub Sitnicki,
	Marco Elver, Dexuan Cui, Vladimir Oltean, Ariel Levkovich,
	Wang Qing, Davide Caratti, Guillaume Nault, Eran Ben Elisha,
	Mauro Carvalho Chehab, Kirill Tkhai, Bartosz Golaszewski, netdev,
	linux-kernel, bpf

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.

From v2 [1]:
 - reword some commit messages as a potential fix for NIPA;
 - no functional changes.

From 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
[1] https://lore.kernel.org/netdev/20210313113645.5949-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



^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2021-03-17 11:03 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-14 11:10 [PATCH v3 net-next 0/6] skbuff: micro-optimize flow dissection Alexander Lobakin
2021-03-14 11:11 ` [PATCH v3 net-next 1/6] flow_dissector: constify bpf_flow_dissector's data pointers Alexander Lobakin
2021-03-14 11:11 ` [PATCH v3 net-next 2/6] skbuff: make __skb_header_pointer()'s data argument const Alexander Lobakin
2021-03-14 11:11 ` [PATCH v3 net-next 3/6] flow_dissector: constify raw input data argument Alexander Lobakin
2021-03-14 11:11 ` [PATCH v3 net-next 4/6] linux/etherdevice.h: misc trailing whitespace cleanup Alexander Lobakin
2021-03-14 21:04   ` Vladimir Oltean
2021-03-15  9:38     ` Alexander Lobakin
2021-03-15 19:00       ` Jakub Kicinski
2021-03-17 11:02         ` Alexander Lobakin
2021-03-14 11:11 ` [PATCH v3 net-next 5/6] ethernet: constify eth_get_headlen()'s data argument Alexander Lobakin
2021-03-14 11:11 ` [PATCH v3 net-next 6/6] skbuff: micro-optimize {,__}skb_header_pointer() Alexander Lobakin

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).