Eric Dumazet
7a4cd71fa4
net: add vlan_get_protocol_offset_inline() helper
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 vlan_type_depth struct to avoid stack canaries in callers.
struct vlan_type_depth {
__be16 type;
u16 depth;
};
$ scripts/bloat-o-meter -t vmlinux.old vmlinux.new
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>
Link: https://patch.msgid.link/20260204053023.1622775-1-edumazet@google.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
2026-02-05 16:33:52 +01:00
..
2026-01-10 15:19:50 -08:00
2026-02-05 11:58:40 +01:00
2026-01-16 01:17:29 +01:00
2025-12-08 09:38:52 +09:00
2026-01-08 08:15:03 -08:00
2025-12-12 23:59:39 +01:00
2025-12-27 14:56:33 +00:00
2025-12-05 17:01:20 -08:00
2025-12-04 12:19:49 -08:00
2026-02-04 21:16:05 -08:00
2026-01-27 13:42:20 +01:00
2026-01-11 06:09:11 -10:00
2026-01-20 16:23:37 +01:00
2026-01-21 19:46:58 -08:00
2026-01-14 18:16:05 +05:30
2025-12-10 06:38:17 +09:00
2026-01-14 22:16:19 -08:00
2026-01-12 19:17:24 -08:00
2025-12-12 21:52:42 +12:00
2026-02-03 19:41:19 -08:00
2025-12-06 11:13:50 -08:00
2025-12-05 21:29:02 -08:00
2025-12-10 16:07:42 -08:00
2025-12-05 20:41:20 -08:00
2026-01-20 16:23:37 +01:00
2025-12-03 19:26:18 -08:00
2025-12-12 12:36:44 -07:00
2025-12-04 15:43:28 -07:00
2025-12-04 07:19:26 -07:00
2025-12-09 23:29:42 -08:00
2026-01-07 15:11:03 -10:00
2025-12-08 15:32:14 -08:00
2026-01-21 18:57:07 -08:00
2025-12-20 14:47:05 -08:00
2025-12-20 14:47:05 -08:00
2025-12-08 15:32:14 -08:00
2025-12-03 12:42:36 -08:00
2025-12-06 09:01:27 -08:00
2025-12-05 15:25:13 -08:00
2025-12-08 09:40:57 +01:00
2026-02-05 15:57:46 +01:00
2025-12-04 17:10:08 -08:00
2026-01-08 16:52:31 +01:00
2026-01-13 18:52:34 -08:00
2025-12-04 02:00:04 +00:00
2025-12-13 20:04:32 +12:00
2025-12-15 15:20:33 +01:00
2025-12-03 17:24:33 -08:00
2026-01-12 10:57:34 +01:00
2026-01-07 14:52:22 -05:00
2025-12-23 11:23:10 -08:00
2026-01-11 06:09:11 -10:00
2025-12-13 20:35:41 +12:00
2026-01-20 09:34:26 -08:00
2026-02-02 10:11:18 +01:00
2026-02-02 10:01:44 +01:00
2026-02-02 10:11:07 +01:00
2026-02-02 10:11:18 +01:00
2026-02-05 16:33:52 +01:00
2026-01-25 14:45:14 -08:00
2025-12-17 17:24:28 +01:00
2025-12-22 16:19:53 +02:00
2026-01-01 08:16:40 -07:00
2025-12-15 15:17:44 +01:00
2025-12-05 13:52:43 -08:00
2026-02-02 17:49:30 -08:00
2025-12-18 10:43:52 +01:00
2025-12-07 16:15:22 +01:00
2025-12-10 11:16:50 +09:00
2025-12-23 11:23:11 -08:00
2025-12-23 11:23:13 -08:00
2026-01-14 22:16:20 -08:00
2026-01-11 06:09:11 -10:00
2025-12-23 11:23:12 -08:00
2025-12-05 20:41:20 -08:00
2025-12-10 05:58:51 +09:00
2026-02-03 12:46:55 +01:00
2025-12-23 11:23:15 -08:00
2025-12-05 13:52:43 -08:00
2025-12-05 13:52:43 -08:00
2025-12-08 15:32:14 -08:00
2026-01-20 09:34:26 -08:00
2026-01-20 09:34:26 -08:00
2026-01-14 11:00:00 +01:00
2026-02-03 12:46:55 +01:00
2026-01-25 13:20:46 -08:00
2026-01-04 23:03:24 -05:00
2026-01-14 22:16:22 -08:00
2025-12-13 16:26:55 +12:00
2026-01-19 12:30:01 -08:00
2026-01-20 19:12:06 -08:00
2026-01-12 10:45:31 -06:00
2026-01-11 06:09:11 -10:00
2025-12-05 13:52:43 -08:00
2026-01-13 18:52:35 -08:00
2026-01-22 18:27:32 -08:00
2026-01-21 19:50:54 -08:00
2025-12-05 21:29:02 -08:00
2026-01-11 06:09:11 -10:00
2025-12-04 20:38:13 +01:00
2025-12-04 13:50:39 -08:00
2025-12-22 13:32:22 +01:00
2025-12-06 10:15:41 -08:00
2025-12-03 17:24:33 -08:00
2025-12-04 11:16:44 -08:00
2025-12-10 17:21:30 +09:00
2025-12-12 10:26:26 +01:00
2026-01-11 06:09:11 -10:00
2026-01-13 11:37:52 +01:00
2025-12-05 14:36:21 -08:00
2025-12-06 09:53:05 +01:00
2025-12-06 14:01:20 -08:00
2026-01-25 13:18:52 -08:00
2026-02-05 11:58:39 +01:00
2025-12-07 18:09:54 +01:00
2025-12-03 18:58:57 -08:00
2026-02-04 20:55:48 -08:00
2025-12-05 09:11:02 -08:00
2026-02-03 15:13:25 +01:00
2026-01-14 22:16:19 -08:00
2025-12-05 06:42:51 +02:00
2025-12-05 15:17:56 -05:00
2026-01-07 14:52:22 -05:00
2026-01-25 13:14:11 -08:00
2025-12-06 14:01:20 -08:00
2026-01-06 17:06:03 -08:00
2026-01-11 06:09:11 -10:00
2025-12-23 14:07:08 -07:00
2025-12-24 08:02:56 -05:00
2026-01-27 10:45:38 +01:00
2025-12-24 08:02:55 -05:00
2026-01-30 18:26:59 -08:00