public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Simon Horman <horms@kernel.org>
To: Eric Dumazet <edumazet@google.com>
Cc: "David S. Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Willem de Bruijn <willemb@google.com>,
	netdev@vger.kernel.org, eric.dumazet@gmail.com
Subject: Re: [PATCH net-next] net: add vlan_get_protocol_offset_inline() helper
Date: Tue, 3 Feb 2026 20:14:30 +0000	[thread overview]
Message-ID: <aYJXJp-hFOyG1tBz@horms.kernel.org> (raw)
In-Reply-To: <20260202082200.650516-1-edumazet@google.com>

On Mon, Feb 02, 2026 at 08:22:00AM +0000, Eric Dumazet wrote:
> skb_protocol() is bloated, and forces slow stack canaries in many
> fast paths.
> 
> Add vlan_get_protocol_offset_inline() which deals with the non-vlan
> common cases.
> 
> __vlan_get_protocol_offset() is now out of line.
> 
> It returns a type_depth struct to avoid stack canaries in callers.
> 
> struct type_depth {
>        __be16 type;
>        u16 depth;
> };
> 
> $ scripts/bloat-o-meter -t vmlinux.0 vmlinux.1
> add/remove: 0/2 grow/shrink: 0/22 up/down: 0/-6320 (-6320)
> Function                                     old     new   delta
> vlan_get_protocol_dgram                       61      59      -2
> __pfx_skb_protocol                            16       -     -16
> __vlan_get_protocol_offset                   307     273     -34
> tap_get_user                                1374    1207    -167
> ip_md_tunnel_xmit                           1625    1452    -173
> tap_sendmsg                                  940     753    -187
> netif_skb_features                          1079     866    -213
> netem_enqueue                               3017    2800    -217
> vlan_parse_protocol                          271      50    -221
> tso_start                                    567     344    -223
> fq_dequeue                                  1908    1685    -223
> skb_network_protocol                         434     205    -229
> ip6_tnl_xmit                                2639    2409    -230
> br_dev_queue_push_xmit                       474     236    -238
> skb_protocol                                 258       -    -258
> packet_parse_headers                         621     357    -264
> __ip6_tnl_rcv                               1306    1039    -267
> skb_csum_hwoffload_help                      515     224    -291
> ip_tunnel_xmit                              2635    2339    -296
> sch_frag_xmit_hook                          1582    1233    -349
> bpf_skb_ecn_set_ce                           868     457    -411
> IP6_ECN_decapsulate                         1297     768    -529
> ip_tunnel_rcv                               2121    1489    -632
> ipip6_rcv                                   2572    1922    -650
> Total: Before=24892803, After=24886483, chg -0.03%
> 
> Signed-off-by: Eric Dumazet <edumazet@google.com>

Reviewed-by: Simon Horman <horms@kernel.org>


  reply	other threads:[~2026-02-03 20:14 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-02  8:22 [PATCH net-next] net: add vlan_get_protocol_offset_inline() helper Eric Dumazet
2026-02-03 20:14 ` Simon Horman [this message]
2026-02-04  3:17 ` Jakub Kicinski
2026-02-04  5:06   ` Eric Dumazet

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=aYJXJp-hFOyG1tBz@horms.kernel.org \
    --to=horms@kernel.org \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=eric.dumazet@gmail.com \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=willemb@google.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