tcp: move tcp_rate_skb_delivered() to tcp_input.c
Subsystems (3)
PATCH 1/1 tcp: move tcp_rate_skb_delivered() to tcp_input.c
tcp_rate_skb_delivered() is only called from tcp_input.c. Move it there and make it static.
Both gcc and clang are (auto)inlining it, TCP performance is increased at a small space cost.
$ scripts/bloat-o-meter -t vmlinux.old vmlinux.new add/remove: 0/2 grow/shrink: 3/0 up/down: 509/-187 (322) Function old new delta tcp_sacktag_walk 1682 1867 +185 tcp_ack 5230 5405 +175 tcp_shifted_skb 437 586 +149 __pfx_tcp_rate_skb_delivered 16 - -16 tcp_rate_skb_delivered 171 - -171 Total: Before=22566192, After=22566514, chg +0.00%
--- include/net/tcp.h | 2 -- net/ipv4/tcp_input.c | 44 ++++++++++++++++++++++++++++++++++++++++++++ net/ipv4/tcp_rate.c | 44 -------------------------------------------- 3 files changed, 44 insertions(+), 46 deletions(-)
include/net/tcp.h +0 -2
@@ -1356,8 +1356,6 @@ static inline void tcp_ca_event(struct sock *sk, const enum tcp_ca_event event)void tcp_set_ca_state (struct sock *sk,const u8 ca_state);/* From tcp_rate.c */ -void tcp_rate_skb_delivered (struct sock *sk,struct sk_buff *skb, -struct rate_sample *rs);void tcp_rate_gen (struct sock *sk,u32 delivered,u32 lost,bool is_sack_reneg,struct rate_sample *rs);void tcp_rate_check_app_limited (struct sock *sk);
net/ipv4/tcp_input.c +44 -0
50 lines not on this page · raw message
net/ipv4/tcp_rate.c +0 -44
50 lines not on this page · raw message
Signature · 1 line
2.52.0.457.g6b5491de43-goog
Quoted 17 lines · Eric Dumazet
tcp_rate_skb_delivered()is only called fromtcp_input.c. Move it there and make it static.Both gcc and clang are (auto)inlining it, TCP performance is increased at a small space cost.
$ scripts/bloat-o-meter -t vmlinux.old vmlinux.new add/remove: 0/2 grow/shrink: 3/0 up/down: 509/-187 (322) Function old new delta tcp_sacktag_walk 1682 1867 +185 tcp_ack 5230 5405 +175 tcp_shifted_skb 437 586 +149 __pfx_tcp_rate_skb_delivered 16 - -16 tcp_rate_skb_delivered 171 - -171 Total: Before=22566192, After=22566514, chg +0.00%
Quoted 2 lines
Signed-off-by Eric Dumazet <[email protected]>---
Thanks, Eric!
neal
This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:
Hello:
This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:
Quoted 16 lines · On Sun, 18 Jan 2026 12:32:04 +0000 you wrote:
tcp_rate_skb_delivered()is only called fromtcp_input.c. Move it there and make it static.Both gcc and clang are (auto)inlining it, TCP performance is increased at a small space cost.
$ scripts/bloat-o-meter -t vmlinux.old vmlinux.new add/remove: 0/2 grow/shrink: 3/0 up/down: 509/-187 (322) Function old new delta tcp_sacktag_walk 1682 1867 +185 tcp_ack 5230 5405 +175 tcp_shifted_skb 437 586 +149 __pfx_tcp_rate_skb_delivered 16 - -16 tcp_rate_skb_delivered 171 - -171 Total: Before=22566192, After=22566514, chg +0.00%
Quoted 1 line
[...]
Here is the summary with links:
- [net-next] tcp: move tcp_rate_skb_delivered() to tcp_input.c
https://git.kernel.org/netdev/net-next/c/670ade3bfae6
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html