netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] gro: optimise redundant parsing of packets
@ 2023-01-30 13:00 Richard Gobert
  2023-01-30 13:05 ` [PATCH 1/2] gro: decrease size of CB Richard Gobert
  2023-01-30 13:07 ` [PATCH 2/2] gro: optimise redundant parsing of packets Richard Gobert
  0 siblings, 2 replies; 7+ messages in thread
From: Richard Gobert @ 2023-01-30 13:00 UTC (permalink / raw)
  To: davem, edumazet, kuba, pabeni, yoshfuji, dsahern,
	steffen.klassert, lixiaoyan, alexanderduyck, leon, ye.xingchen,
	iwienand, netdev, linux-kernel

Currently, the IPv6 extension headers are parsed twice: first in
ipv6_gro_receive, and then again in ipv6_gro_complete.

The field NAPI_GRO_CB(skb)->proto is used by GRO to hold the layer 4
protocol type that comes after the IPv6 layer. I noticed that it is set
in ipv6_gro_receive, but isn't used anywhere. By using this field, and
also storing the size of the network header, we can avoid parsing
extension headers a second time in ipv6_gro_complete.

The first commit frees up space in the GRO CB. The second commit reduces
the redundant parsing during the complete phase, using the freed CB
space.

I've applied this optimisation to all base protocols (IPv6, IPv4,
Ethernet). Then, I benchmarked this patch on my machine, using ftrace to
measure ipv6_gro_complete's performance, and there was an improvement.

Richard Gobert (2):
  gro: decrease size of CB
  gro: optimise redundant parsing of packets

 include/net/gro.h      | 32 +++++++++++++++++++++-----------
 net/core/gro.c         | 18 +++++++++++-------
 net/ethernet/eth.c     | 11 +++++++++--
 net/ipv4/af_inet.c     |  8 +++++++-
 net/ipv6/ip6_offload.c | 15 ++++++++++++---
 5 files changed, 60 insertions(+), 24 deletions(-)

-- 
2.36.1


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

end of thread, other threads:[~2023-02-22 14:49 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-01-30 13:00 [PATCH 0/2] gro: optimise redundant parsing of packets Richard Gobert
2023-01-30 13:05 ` [PATCH 1/2] gro: decrease size of CB Richard Gobert
2023-01-30 13:07 ` [PATCH 2/2] gro: optimise redundant parsing of packets Richard Gobert
2023-01-30 15:40   ` Alexander Lobakin
2023-02-22 14:47     ` Richard Gobert
2023-01-30 17:39   ` Eric Dumazet
2023-02-22 14:35     ` Richard Gobert

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