Re: [PATCH v2 net-next 3/3] tcp: make tcp_v{4,6}_send_check() static: manual merge
From: Matthieu Baerts <matttbe@kernel.org>
Date: 2026-02-25 11:57:26
Hi Eric, Thank you for the patch! On 23/02/2026 11:07, Eric Dumazet wrote:
tcp_v{4,6}_send_check() are only called from tcp_output.c
and should be made static so that the compiler does not need
to put an out of line copy of them.
Remove (struct inet_connection_sock_af_ops) send_check field
and use instead @net_header_len.
Move @net_header_len close to @queue_xmit for data locality
as both are used in TCP tx fast path.(...)
quoted hunk ↗ jump to hunk
diff --git a/include/net/inet_connection_sock.h b/include/net/inet_connection_sock.h index ecb362025c4e5183ec78aef4b45c249da87c19ea..bbc9355871c767b51e3d1a4d2436022a8556416c 100644 --- a/include/net/inet_connection_sock.h +++ b/include/net/inet_connection_sock.h@@ -34,7 +34,7 @@ struct tcp_congestion_ops; */ struct inet_connection_sock_af_ops { int (*queue_xmit)(struct sock *sk, struct sk_buff *skb, struct flowi *fl); - void (*send_check)(struct sock *sk, struct sk_buff *skb); + u16 net_header_len; int (*rebuild_header)(struct sock *sk); void (*sk_rx_dst_set)(struct sock *sk, const struct sk_buff *skb); int (*conn_request)(struct sock *sk, struct sk_buff *skb);@@ -43,7 +43,6 @@ struct inet_connection_sock_af_ops { struct dst_entry *dst, struct request_sock *req_unhash, bool *own_req); - u16 net_header_len;
FYI, I got a small conflict when merging 'net' in 'net-next' in the
MPTCP tree due to this patch applied in 'net':
858d2a4f67ff ("tcp: fix potential race in tcp_v6_syn_recv_sock()")
and this one from 'net-next':
fcd3d039fab6 ("tcp: make tcp_v{4,6}_send_check() static")
The conflict was in the context: here 'net_header_len' has been moved,
while in net-next, the line above has been modified. I'm sharing the 3w
patch resolving the conflict, just in case it can help others. Rerere
cache is available as well:
https://github.com/multipath-tcp/mptcp-upstream-rr-cache/commit/d58bc4b
Cheers,
Matt
--
Sponsored by the NGI0 Core fund.
------------------------ 8< ------------------------
diff --cc include/net/inet_connection_sock.h
index 5cb3056d6ddc,bbc9355871c7..433c2df23076--- a/include/net/inet_connection_sock.h
+++ b/include/net/inet_connection_sock.h@@@ -42,10 -42,7 +42,9 @@@ struct inet_connection_sock_af_ops struct request_sock *req, struct dst_entry *dst, struct request_sock *req_unhash, - bool *own_req); + bool *own_req, + void (*opt_child_init)(struct sock *newsk, + const struct sock *sk)); - u16 net_header_len; int (*setsockopt)(struct sock *sk, int level, int optname, sockptr_t optval, unsigned int optlen); int (*getsockopt)(struct sock *sk, int level, int optname, ------------------------ 8< ------------------------