From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5874013AA2D for ; Tue, 3 Feb 2026 20:14:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770149674; cv=none; b=FH+kpiMKrveO28RJvQ33XPkJMtcowiFJo1uoHemIbBMGcg4gkRFQE86/l6V0b2hm3gqhEqwDI7CFoNQog/FNjtVTtBgOD622dvCA3qWCE9ub5zbEhQIQgBdsvQbORg84/CQ/RfAuFVH5h/bvISIk/jLr6DknM+8N9K7UNFBbeO0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770149674; c=relaxed/simple; bh=j2QlwUFj/m7Pram0Ddqvuqer/FkX/MBZFmS6zUZSYmI=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=LcnotG7V/VM2R8y3gyIhdmunPpP3dfOvHxfxoRRQq5C/93xYa3rvmLWMpctIBflbxoiGYZHINLN+50sxPVVGlqPqCZ+d6HFqdphaL6E/IDC70b/i1B4zcE2+hpVAlKgOb/O3Kcnh3UQTD35Pa6cPnl5XI6cbKQZugt3rJQB1ayg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=JKW24yyV; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="JKW24yyV" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 72F97C116D0; Tue, 3 Feb 2026 20:14:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1770149673; bh=j2QlwUFj/m7Pram0Ddqvuqer/FkX/MBZFmS6zUZSYmI=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=JKW24yyVisjOu9ZtpiAcSY0M4GQIuX0lPe8dJ/StWSlLQjb+QMbjDwBdFWybR+gsB 118ctYuzOco7JKamndbPsE9RU3coDFb/rSQffiErOkVRBln80z4Eu6hU0Dnbf2PnWq QdN/FvU/mlWkUXteSLTw+qK9hJiDCNTsMpnKWW7Y3AeudRdiCsrEHffTH1kzZ25nou rmkE7rkkGUcDK7jedg4LXm2M2Gl3xsXmEFvrUKshDmP2BmNqvDYY6Oj5+qq3Pa+Cdf BqFgxdzr8mvFxcf5DVmYJtxPjquXeyG0S+WU9NouSzl67I2xyFmA0GFzjSSSICrsbr cDK5ubgCY3YRQ== Date: Tue, 3 Feb 2026 20:14:30 +0000 From: Simon Horman To: Eric Dumazet Cc: "David S. Miller" , Jakub Kicinski , Paolo Abeni , Willem de Bruijn , netdev@vger.kernel.org, eric.dumazet@gmail.com Subject: Re: [PATCH net-next] net: add vlan_get_protocol_offset_inline() helper Message-ID: References: <20260202082200.650516-1-edumazet@google.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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 Reviewed-by: Simon Horman