summaryrefslogtreecommitdiff
path: root/include/linux/tcp.h
diff options
context:
space:
mode:
authorEric Dumazet <edumazet@google.com>2026-03-10 15:44:51 +0300
committerPaolo Abeni <pabeni@redhat.com>2026-03-12 15:22:03 +0300
commit6f459eda8b60382efa0da2ca025c26a2018adc87 (patch)
tree7b41e552f198f061413c3a28fe33b4d80bdac215 /include/linux/tcp.h
parent4320f1f111c587b8c6c9abc06f43e25bc10b670c (diff)
downloadlinux-6f459eda8b60382efa0da2ca025c26a2018adc87.tar.xz
tcp: add tcp_release_cb_cond() helper
Majority of tcp_release_cb() calls do nothing at all. Provide tcp_release_cb_cond() helper so that release_sock() can avoid these calls. Also hint the compiler that __release_sock() and wake_up() are rarely called. $ scripts/bloat-o-meter -t vmlinux.old vmlinux.new add/remove: 0/0 grow/shrink: 0/1 up/down: 0/-77 (-77) Function old new delta release_sock 258 181 -77 Total: Before=25235790, After=25235713, chg -0.00% Signed-off-by: Eric Dumazet <edumazet@google.com> Reviewed-by: Kuniyuki Iwashima <kuniyu@google.com> Link: https://patch.msgid.link/20260310124451.2280968-1-edumazet@google.com Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Diffstat (limited to 'include/linux/tcp.h')
-rw-r--r--include/linux/tcp.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/include/linux/tcp.h b/include/linux/tcp.h
index c44cf9ae8d16..bcebc4f07532 100644
--- a/include/linux/tcp.h
+++ b/include/linux/tcp.h
@@ -548,6 +548,13 @@ enum tsq_flags {
TCPF_ACK_DEFERRED = BIT(TCP_ACK_DEFERRED),
};
+/* Flags of interest for tcp_release_cb() */
+#define TCP_DEFERRED_ALL (TCPF_TSQ_DEFERRED | \
+ TCPF_WRITE_TIMER_DEFERRED | \
+ TCPF_DELACK_TIMER_DEFERRED | \
+ TCPF_MTU_REDUCED_DEFERRED | \
+ TCPF_ACK_DEFERRED)
+
#define tcp_sk(ptr) container_of_const(ptr, struct tcp_sock, inet_conn.icsk_inet.sk)
/* Variant of tcp_sk() upgrading a const sock to a read/write tcp socket.