]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
tcp: add cwnd_event_tx_start to tcp_congestion_ops
authorEric Dumazet <edumazet@google.com>
Mon, 23 Mar 2026 23:49:20 +0000 (23:49 +0000)
committerJakub Kicinski <kuba@kernel.org>
Wed, 25 Mar 2026 04:00:38 +0000 (21:00 -0700)
commitd1e59a46973719e458bec78d00dd767d7a7ba71f
tree43fa8dcafd5334b6373a93d77d56ee0f2a1e464f
parent112f4c6320070b19e7d49cba758400adc279e377
tcp: add cwnd_event_tx_start to tcp_congestion_ops

(tcp_congestion_ops)->cwnd_event() is called very often, with
@event oscillating between CA_EVENT_TX_START and other values.

This is not branch prediction friendly.

Provide a new cwnd_event_tx_start pointer dedicated for CA_EVENT_TX_START.

Both BBR and CUBIC benefit from this change, since they only care
about CA_EVENT_TX_START.

No change in kernel size:

$ scripts/bloat-o-meter -t vmlinux.0 vmlinux
add/remove: 4/4 grow/shrink: 3/1 up/down: 564/-568 (-4)
Function                                     old     new   delta
bbr_cwnd_event_tx_start                        -     450    +450
cubictcp_cwnd_event_tx_start                   -      70     +70
__pfx_cubictcp_cwnd_event_tx_start             -      16     +16
__pfx_bbr_cwnd_event_tx_start                  -      16     +16
tcp_unregister_congestion_control             93      99      +6
tcp_update_congestion_control                518     521      +3
tcp_register_congestion_control              422     425      +3
__tcp_transmit_skb                          3308    3306      -2
__pfx_cubictcp_cwnd_event                     16       -     -16
__pfx_bbr_cwnd_event                          16       -     -16
cubictcp_cwnd_event                           80       -     -80
bbr_cwnd_event                               454       -    -454
Total: Before=25240512, After=25240508, chg -0.00%

Signed-off-by: Eric Dumazet <edumazet@google.com>
Link: https://patch.msgid.link/20260323234920.1097858-1-edumazet@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
12 files changed:
include/net/tcp.h
net/ipv4/bpf_tcp_ca.c
net/ipv4/tcp_bbr.c
net/ipv4/tcp_cubic.c
net/ipv4/tcp_dctcp.c
net/ipv4/tcp_vegas.c
net/ipv4/tcp_vegas.h
net/ipv4/tcp_veno.c
net/ipv4/tcp_yeah.c
tools/testing/selftests/bpf/progs/bpf_cc_cubic.c
tools/testing/selftests/bpf/progs/bpf_cubic.c
tools/testing/selftests/bpf/progs/tcp_ca_kfunc.c