public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Eric Dumazet <edumazet@google.com>
To: "David S . Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>,
	 Paolo Abeni <pabeni@redhat.com>
Cc: Simon Horman <horms@kernel.org>,
	netdev@vger.kernel.org, eric.dumazet@gmail.com,
	 Eric Dumazet <edumazet@google.com>
Subject: [PATCH net-next 0/5] net: reduce sk_filter() (and friends) bloat
Date: Thu,  9 Apr 2026 14:56:19 +0000	[thread overview]
Message-ID: <20260409145625.2306224-1-edumazet@google.com> (raw)

Some functions return an error by value, and a drop_reason
by an output parameter. This extra parameter can force stack canaries.

A drop_reason is enough and more efficient.

This series reduces bloat by 678 bytes on x86_64:

$ scripts/bloat-o-meter -t vmlinux.old vmlinux.final
add/remove: 0/0 grow/shrink: 3/18 up/down: 79/-757 (-678)
Function                                     old     new   delta
vsock_queue_rcv_skb                           50      79     +29
ipmr_cache_report                           1290    1315     +25
ip6mr_cache_report                          1322    1347     +25
tcp_v6_rcv                                  3169    3167      -2
packet_rcv_spkt                              329     327      -2
unix_dgram_sendmsg                          1731    1726      -5
netlink_unicast                              957     945     -12
netlink_dump                                1372    1359     -13
sk_filter_trim_cap                           889     858     -31
netlink_broadcast_filtered                  1633    1595     -38
tcp_v4_rcv                                  3152    3111     -41
raw_rcv_skb                                  122      80     -42
ping_queue_rcv_skb                           109      61     -48
ping_rcv                                     215     162     -53
rawv6_rcv_skb                                278     224     -54
__sk_receive_skb                             690     632     -58
raw_rcv                                      591     527     -64
udpv6_queue_rcv_one_skb                      935     869     -66
udp_queue_rcv_one_skb                        919     853     -66
tun_net_xmit                                1146    1074     -72
sock_queue_rcv_skb_reason                    166      76     -90
Total: Before=29722890, After=29722212, chg -0.00%

Future conversions from sock_queue_rcv_skb() to sock_queue_rcv_skb_reason()
can be done later.

Eric Dumazet (5):
  net: change sock_queue_rcv_skb_reason() to return a drop_reason
  net: always set reason in sk_filter_trim_cap()
  net: change sk_filter_reason() to return the reason by value
  tcp: change tcp_filter() to return the reason by value
  net: change sk_filter_trim_cap() to return a drop_reason by value

 drivers/net/tun.c      |  8 +++++---
 include/linux/filter.h | 15 ++++++++-------
 include/net/sock.h     | 17 ++++++++++++++---
 include/net/tcp.h      |  6 +++---
 net/can/bcm.c          |  5 ++---
 net/can/isotp.c        |  3 ++-
 net/can/j1939/socket.c |  3 ++-
 net/can/raw.c          |  3 ++-
 net/core/filter.c      | 30 +++++++++++++-----------------
 net/core/sock.c        | 29 +++++++++++------------------
 net/ipv4/ping.c        |  3 ++-
 net/ipv4/raw.c         |  3 ++-
 net/ipv4/tcp_ipv4.c    |  6 ++++--
 net/ipv4/udp.c         |  3 ++-
 net/ipv6/raw.c         |  3 ++-
 net/ipv6/tcp_ipv6.c    |  6 ++++--
 net/ipv6/udp.c         |  3 ++-
 net/rose/rose_in.c     |  3 +--
 18 files changed, 81 insertions(+), 68 deletions(-)

-- 
2.53.0.1213.gd9a14994de-goog


             reply	other threads:[~2026-04-09 14:56 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-09 14:56 Eric Dumazet [this message]
2026-04-09 14:56 ` [PATCH net-next 1/5] net: change sock_queue_rcv_skb_reason() to return a drop_reason Eric Dumazet
2026-04-09 14:56 ` [PATCH net-next 2/5] net: always set reason in sk_filter_trim_cap() Eric Dumazet
2026-04-09 14:56 ` [PATCH net-next 3/5] net: change sk_filter_reason() to return the reason by value Eric Dumazet
2026-04-09 14:56 ` [PATCH net-next 4/5] tcp: change tcp_filter() " Eric Dumazet
2026-04-09 14:56 ` [PATCH net-next 5/5] net: change sk_filter_trim_cap() to return a drop_reason " 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=20260409145625.2306224-1-edumazet@google.com \
    --to=edumazet@google.com \
    --cc=davem@davemloft.net \
    --cc=eric.dumazet@gmail.com \
    --cc=horms@kernel.org \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.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