public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next 0/3] tcp: rework tcp_v{4,6}_send_check()
@ 2026-02-03 14:40 Eric Dumazet
  2026-02-03 14:40 ` [PATCH net-next 1/3] tcp: inline __tcp_v4_send_check() Eric Dumazet
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Eric Dumazet @ 2026-02-03 14:40 UTC (permalink / raw)
  To: David S . Miller, Jakub Kicinski, Paolo Abeni
  Cc: Simon Horman, Neal Cardwell, Kuniyuki Iwashima, netdev,
	eric.dumazet, Eric Dumazet

tcp_v{4,6}_send_check() are only called from __tcp_transmit_skb()

They currently are in different files (tcp_ipv4.c and tcp_ipv6.c)
thus out of line.

This series move them close to their caller so that compiler
can inline them.

We save ~200 bytes of text with this series.

Eric Dumazet (3):
  tcp: inline __tcp_v4_send_check()
  tcp: move tcp_v6_send_check() to tcp_output.c
  tcp: make tcp_v{4,6}_send_check() static

 include/net/inet_connection_sock.h |  3 +--
 include/net/tcp.h                  | 12 +++++++++---
 net/ipv4/tcp_ipv4.c                | 19 -------------------
 net/ipv4/tcp_output.c              | 28 ++++++++++++++++++++++++----
 net/ipv6/tcp_ipv6.c                |  7 -------
 net/mptcp/subflow.c                |  1 -
 net/tls/tls_device_fallback.c      |  3 ---
 7 files changed, 34 insertions(+), 39 deletions(-)

-- 
2.53.0.rc1.225.gd81095ad13-goog


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH net-next 1/3] tcp: inline __tcp_v4_send_check()
  2026-02-03 14:40 [PATCH net-next 0/3] tcp: rework tcp_v{4,6}_send_check() Eric Dumazet
@ 2026-02-03 14:40 ` Eric Dumazet
  2026-02-03 14:40 ` [PATCH net-next 2/3] tcp: move tcp_v6_send_check() to tcp_output.c Eric Dumazet
  2026-02-03 14:40 ` [PATCH net-next 3/3] tcp: make tcp_v{4,6}_send_check() static Eric Dumazet
  2 siblings, 0 replies; 9+ messages in thread
From: Eric Dumazet @ 2026-02-03 14:40 UTC (permalink / raw)
  To: David S . Miller, Jakub Kicinski, Paolo Abeni
  Cc: Simon Horman, Neal Cardwell, Kuniyuki Iwashima, netdev,
	eric.dumazet, Eric Dumazet

Inline __tcp_v4_send_check(), like __tcp_v6_send_check().

Move tcp_v4_send_check() to tcp_output.c close to
its fast path caller (__tcp_transmit_skb()).

Signed-off-by: Eric Dumazet <edumazet@google.com>
---
 include/net/tcp.h     | 10 +++++++++-
 net/ipv4/tcp_ipv4.c   | 18 ------------------
 net/ipv4/tcp_output.c | 10 +++++++++-
 3 files changed, 18 insertions(+), 20 deletions(-)

diff --git a/include/net/tcp.h b/include/net/tcp.h
index 6c12be2cdd4d49360a6d43caa56f2fb327163033..80f84564cb3d2b100e46f85fd9ee33d2c6ffe3c2 100644
--- a/include/net/tcp.h
+++ b/include/net/tcp.h
@@ -2368,7 +2368,15 @@ void tcp_gro_complete(struct sk_buff *skb);
 static inline void tcp_gro_complete(struct sk_buff *skb) { }
 #endif
 
-void __tcp_v4_send_check(struct sk_buff *skb, __be32 saddr, __be32 daddr);
+static inline void __tcp_v4_send_check(struct sk_buff *skb, __be32 saddr,
+				       __be32 daddr)
+{
+	struct tcphdr *th = tcp_hdr(skb);
+
+	th->check = ~tcp_v4_check(skb->len, saddr, daddr, 0);
+	skb->csum_start = skb_transport_header(skb) - skb->head;
+	skb->csum_offset = offsetof(struct tcphdr, check);
+}
 
 static inline u32 tcp_notsent_lowat(const struct tcp_sock *tp)
 {
diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c
index 01fd563472608cc10744d3a5d4fb998b83c4be97..7537adf0846f4fe7e0a1dd1cdec559a982329cc1 100644
--- a/net/ipv4/tcp_ipv4.c
+++ b/net/ipv4/tcp_ipv4.c
@@ -661,24 +661,6 @@ int tcp_v4_err(struct sk_buff *skb, u32 info)
 	return 0;
 }
 
-void __tcp_v4_send_check(struct sk_buff *skb, __be32 saddr, __be32 daddr)
-{
-	struct tcphdr *th = tcp_hdr(skb);
-
-	th->check = ~tcp_v4_check(skb->len, saddr, daddr, 0);
-	skb->csum_start = skb_transport_header(skb) - skb->head;
-	skb->csum_offset = offsetof(struct tcphdr, check);
-}
-
-/* This routine computes an IPv4 TCP checksum. */
-void tcp_v4_send_check(struct sock *sk, struct sk_buff *skb)
-{
-	const struct inet_sock *inet = inet_sk(sk);
-
-	__tcp_v4_send_check(skb, inet->inet_saddr, inet->inet_daddr);
-}
-EXPORT_IPV6_MOD(tcp_v4_send_check);
-
 #define REPLY_OPTIONS_LEN      (MAX_TCP_OPTION_SPACE / sizeof(__be32))
 
 static bool tcp_v4_ao_sign_reset(const struct sock *sk, struct sk_buff *skb,
diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c
index f44d60d13b9ff4d59b05be76c4c3001142451df7..cc398b7fdcba9ffddf2e43179b89fc5d14be51d7 100644
--- a/net/ipv4/tcp_output.c
+++ b/net/ipv4/tcp_output.c
@@ -1477,7 +1477,15 @@ static void tcp_rate_skb_sent(struct sock *sk, struct sk_buff *skb)
 
 INDIRECT_CALLABLE_DECLARE(int ip_queue_xmit(struct sock *sk, struct sk_buff *skb, struct flowi *fl));
 INDIRECT_CALLABLE_DECLARE(int inet6_csk_xmit(struct sock *sk, struct sk_buff *skb, struct flowi *fl));
-INDIRECT_CALLABLE_DECLARE(void tcp_v4_send_check(struct sock *sk, struct sk_buff *skb));
+
+/* This routine computes an IPv4 TCP checksum. */
+void tcp_v4_send_check(struct sock *sk, struct sk_buff *skb)
+{
+	const struct inet_sock *inet = inet_sk(sk);
+
+	__tcp_v4_send_check(skb, inet->inet_saddr, inet->inet_daddr);
+}
+EXPORT_IPV6_MOD(tcp_v4_send_check);
 
 /* This routine actually transmits TCP packets queued in by
  * tcp_do_sendmsg().  This is used by both the initial
-- 
2.53.0.rc1.225.gd81095ad13-goog


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH net-next 2/3] tcp: move tcp_v6_send_check() to tcp_output.c
  2026-02-03 14:40 [PATCH net-next 0/3] tcp: rework tcp_v{4,6}_send_check() Eric Dumazet
  2026-02-03 14:40 ` [PATCH net-next 1/3] tcp: inline __tcp_v4_send_check() Eric Dumazet
@ 2026-02-03 14:40 ` Eric Dumazet
  2026-02-09  5:10   ` kernel test robot
  2026-02-03 14:40 ` [PATCH net-next 3/3] tcp: make tcp_v{4,6}_send_check() static Eric Dumazet
  2 siblings, 1 reply; 9+ messages in thread
From: Eric Dumazet @ 2026-02-03 14:40 UTC (permalink / raw)
  To: David S . Miller, Jakub Kicinski, Paolo Abeni
  Cc: Simon Horman, Neal Cardwell, Kuniyuki Iwashima, netdev,
	eric.dumazet, Eric Dumazet

Move tcp_v6_send_check() so that __tcp_transmit_skb() can inline it.

Signed-off-by: Eric Dumazet <edumazet@google.com>
---
 include/net/tcp.h     |  3 ++-
 net/ipv4/tcp_output.c | 20 +++++++++++++++++---
 net/ipv6/tcp_ipv6.c   |  5 -----
 3 files changed, 19 insertions(+), 9 deletions(-)

diff --git a/include/net/tcp.h b/include/net/tcp.h
index 80f84564cb3d2b100e46f85fd9ee33d2c6ffe3c2..b9bebf5df4aa6ecf6f421400fb93cefb4104e5aa 100644
--- a/include/net/tcp.h
+++ b/include/net/tcp.h
@@ -1124,7 +1124,8 @@ static inline int tcp_v6_sdif(const struct sk_buff *skb)
 
 extern const struct inet_connection_sock_af_ops ipv6_specific;
 
-INDIRECT_CALLABLE_DECLARE(void tcp_v6_send_check(struct sock *sk, struct sk_buff *skb));
+void tcp_v6_send_check(struct sock *sk, struct sk_buff *skb);
+
 INDIRECT_CALLABLE_DECLARE(int tcp_v6_rcv(struct sk_buff *skb));
 void tcp_v6_early_demux(struct sk_buff *skb);
 
diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c
index cc398b7fdcba9ffddf2e43179b89fc5d14be51d7..8c1731b544f42cfa1e7629dde128e969b60d2343 100644
--- a/net/ipv4/tcp_output.c
+++ b/net/ipv4/tcp_output.c
@@ -1487,6 +1487,16 @@ void tcp_v4_send_check(struct sock *sk, struct sk_buff *skb)
 }
 EXPORT_IPV6_MOD(tcp_v4_send_check);
 
+#if IS_ENABLED(CONFIG_IPV6)
+#include <net/ip6_checksum.h>
+
+void tcp_v6_send_check(struct sock *sk, struct sk_buff *skb)
+{
+	__tcp_v6_send_check(skb, &sk->sk_v6_rcv_saddr, &sk->sk_v6_daddr);
+}
+EXPORT_IPV6_MOD(tcp_v6_send_check);
+#endif
+
 /* This routine actually transmits TCP packets queued in by
  * tcp_do_sendmsg().  This is used by both the initial
  * transmission and possible later retransmissions.
@@ -1648,9 +1658,13 @@ static int __tcp_transmit_skb(struct sock *sk, struct sk_buff *skb,
 	/* BPF prog is the last one writing header option */
 	bpf_skops_write_hdr_opt(sk, skb, NULL, NULL, 0, &opts);
 
-	INDIRECT_CALL_INET(icsk->icsk_af_ops->send_check,
-			   tcp_v6_send_check, tcp_v4_send_check,
-			   sk, skb);
+#if IS_ENABLED(CONFIG_IPV6)
+	if (likely(icsk->icsk_af_ops->send_check == tcp_v6_send_check))
+		tcp_v6_send_check(sk, skb);
+	else
+#else
+		tcp_v4_send_check(sk, skb);
+#endif
 
 	if (likely(tcb->tcp_flags & TCPHDR_ACK))
 		tcp_event_ack_sent(sk, rcv_nxt);
diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c
index c65a5bfd322a1db5dc3fbc406e577f0ccb044c23..ca01b11c0ac959e4ee18dd388c3d17e8a4c88761 100644
--- a/net/ipv6/tcp_ipv6.c
+++ b/net/ipv6/tcp_ipv6.c
@@ -2015,11 +2015,6 @@ static struct timewait_sock_ops tcp6_timewait_sock_ops = {
 	.twsk_obj_size	= sizeof(struct tcp6_timewait_sock),
 };
 
-INDIRECT_CALLABLE_SCOPE void tcp_v6_send_check(struct sock *sk, struct sk_buff *skb)
-{
-	__tcp_v6_send_check(skb, &sk->sk_v6_rcv_saddr, &sk->sk_v6_daddr);
-}
-
 const struct inet_connection_sock_af_ops ipv6_specific = {
 	.queue_xmit	   = inet6_csk_xmit,
 	.send_check	   = tcp_v6_send_check,
-- 
2.53.0.rc1.225.gd81095ad13-goog


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH net-next 3/3] tcp: make tcp_v{4,6}_send_check() static
  2026-02-03 14:40 [PATCH net-next 0/3] tcp: rework tcp_v{4,6}_send_check() Eric Dumazet
  2026-02-03 14:40 ` [PATCH net-next 1/3] tcp: inline __tcp_v4_send_check() Eric Dumazet
  2026-02-03 14:40 ` [PATCH net-next 2/3] tcp: move tcp_v6_send_check() to tcp_output.c Eric Dumazet
@ 2026-02-03 14:40 ` Eric Dumazet
  2026-02-03 17:26   ` Jakub Kicinski
  2026-02-03 19:55   ` kernel test robot
  2 siblings, 2 replies; 9+ messages in thread
From: Eric Dumazet @ 2026-02-03 14:40 UTC (permalink / raw)
  To: David S . Miller, Jakub Kicinski, Paolo Abeni
  Cc: Simon Horman, Neal Cardwell, Kuniyuki Iwashima, netdev,
	eric.dumazet, Eric Dumazet

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.

$ scripts/bloat-o-meter -t vmlinux.2 vmlinux.3
add/remove: 0/4 grow/shrink: 0/2 up/down: 0/-320 (-320)
Function                                     old     new   delta
__tcp_transmit_skb                          3075    3072      -3
mptcp_subflow_init                           777     763     -14
__pfx_tcp_v6_send_check                       16       -     -16
__pfx_tcp_v4_send_check                       16       -     -16
tcp_v6_send_check                            135       -    -135
tcp_v4_send_check                            136       -    -136
Total: Before=24893840, After=24893520, chg -0.00%

Signed-off-by: Eric Dumazet <edumazet@google.com>
---
 include/net/inet_connection_sock.h | 3 +--
 include/net/tcp.h                  | 3 ---
 net/ipv4/tcp_ipv4.c                | 1 -
 net/ipv4/tcp_output.c              | 8 +++-----
 net/ipv6/tcp_ipv6.c                | 2 --
 net/mptcp/subflow.c                | 1 -
 net/tls/tls_device_fallback.c      | 3 ---
 7 files changed, 4 insertions(+), 17 deletions(-)

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;
 	int	    (*setsockopt)(struct sock *sk, int level, int optname,
 				  sockptr_t optval, unsigned int optlen);
 	int	    (*getsockopt)(struct sock *sk, int level, int optname,
diff --git a/include/net/tcp.h b/include/net/tcp.h
index b9bebf5df4aa6ecf6f421400fb93cefb4104e5aa..339378be8276af2d293f7f52d1aa506e369c5f8d 100644
--- a/include/net/tcp.h
+++ b/include/net/tcp.h
@@ -531,7 +531,6 @@ u16 tcp_get_syncookie_mss(struct request_sock_ops *rsk_ops,
  *	TCP v4 functions exported for the inet6 API
  */
 
-void tcp_v4_send_check(struct sock *sk, struct sk_buff *skb);
 void tcp_v4_mtu_reduced(struct sock *sk);
 void tcp_req_err(struct sock *sk, u32 seq, bool abort);
 void tcp_ld_RTO_revert(struct sock *sk, u32 seq);
@@ -1124,8 +1123,6 @@ static inline int tcp_v6_sdif(const struct sk_buff *skb)
 
 extern const struct inet_connection_sock_af_ops ipv6_specific;
 
-void tcp_v6_send_check(struct sock *sk, struct sk_buff *skb);
-
 INDIRECT_CALLABLE_DECLARE(int tcp_v6_rcv(struct sk_buff *skb));
 void tcp_v6_early_demux(struct sk_buff *skb);
 
diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c
index 7537adf0846f4fe7e0a1dd1cdec559a982329cc1..c7dcacf418380a70d37e3c6005c2202495c74f8e 100644
--- a/net/ipv4/tcp_ipv4.c
+++ b/net/ipv4/tcp_ipv4.c
@@ -2413,7 +2413,6 @@ EXPORT_IPV6_MOD(inet_sk_rx_dst_set);
 
 const struct inet_connection_sock_af_ops ipv4_specific = {
 	.queue_xmit	   = ip_queue_xmit,
-	.send_check	   = tcp_v4_send_check,
 	.rebuild_header	   = inet_sk_rebuild_header,
 	.sk_rx_dst_set	   = inet_sk_rx_dst_set,
 	.conn_request	   = tcp_v4_conn_request,
diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c
index 8c1731b544f42cfa1e7629dde128e969b60d2343..7748cee03e87d74b1bf40e60c6458717c6225a36 100644
--- a/net/ipv4/tcp_output.c
+++ b/net/ipv4/tcp_output.c
@@ -1479,22 +1479,20 @@ INDIRECT_CALLABLE_DECLARE(int ip_queue_xmit(struct sock *sk, struct sk_buff *skb
 INDIRECT_CALLABLE_DECLARE(int inet6_csk_xmit(struct sock *sk, struct sk_buff *skb, struct flowi *fl));
 
 /* This routine computes an IPv4 TCP checksum. */
-void tcp_v4_send_check(struct sock *sk, struct sk_buff *skb)
+static void tcp_v4_send_check(struct sock *sk, struct sk_buff *skb)
 {
 	const struct inet_sock *inet = inet_sk(sk);
 
 	__tcp_v4_send_check(skb, inet->inet_saddr, inet->inet_daddr);
 }
-EXPORT_IPV6_MOD(tcp_v4_send_check);
 
 #if IS_ENABLED(CONFIG_IPV6)
 #include <net/ip6_checksum.h>
 
-void tcp_v6_send_check(struct sock *sk, struct sk_buff *skb)
+static void tcp_v6_send_check(struct sock *sk, struct sk_buff *skb)
 {
 	__tcp_v6_send_check(skb, &sk->sk_v6_rcv_saddr, &sk->sk_v6_daddr);
 }
-EXPORT_IPV6_MOD(tcp_v6_send_check);
 #endif
 
 /* This routine actually transmits TCP packets queued in by
@@ -1659,7 +1657,7 @@ static int __tcp_transmit_skb(struct sock *sk, struct sk_buff *skb,
 	bpf_skops_write_hdr_opt(sk, skb, NULL, NULL, 0, &opts);
 
 #if IS_ENABLED(CONFIG_IPV6)
-	if (likely(icsk->icsk_af_ops->send_check == tcp_v6_send_check))
+	if (likely(icsk->icsk_af_ops->net_header_len == sizeof(struct ipv6hdr)))
 		tcp_v6_send_check(sk, skb);
 	else
 #else
diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c
index ca01b11c0ac959e4ee18dd388c3d17e8a4c88761..11a055f4863a383df5105303cb181e11614b262d 100644
--- a/net/ipv6/tcp_ipv6.c
+++ b/net/ipv6/tcp_ipv6.c
@@ -2017,7 +2017,6 @@ static struct timewait_sock_ops tcp6_timewait_sock_ops = {
 
 const struct inet_connection_sock_af_ops ipv6_specific = {
 	.queue_xmit	   = inet6_csk_xmit,
-	.send_check	   = tcp_v6_send_check,
 	.rebuild_header	   = inet6_sk_rebuild_header,
 	.sk_rx_dst_set	   = inet6_sk_rx_dst_set,
 	.conn_request	   = tcp_v6_conn_request,
@@ -2049,7 +2048,6 @@ static const struct tcp_sock_af_ops tcp_sock_ipv6_specific = {
  */
 static const struct inet_connection_sock_af_ops ipv6_mapped = {
 	.queue_xmit	   = ip_queue_xmit,
-	.send_check	   = tcp_v4_send_check,
 	.rebuild_header	   = inet_sk_rebuild_header,
 	.sk_rx_dst_set	   = inet_sk_rx_dst_set,
 	.conn_request	   = tcp_v6_conn_request,
diff --git a/net/mptcp/subflow.c b/net/mptcp/subflow.c
index 96d54cb2cd93f447e0e04c53d8eaceaa7de3e9c8..e9f91ce43ffc1f5b76f9042a3b20fa34e5b0b453 100644
--- a/net/mptcp/subflow.c
+++ b/net/mptcp/subflow.c
@@ -2192,7 +2192,6 @@ void __init mptcp_subflow_init(void)
 
 	subflow_v6m_specific = subflow_v6_specific;
 	subflow_v6m_specific.queue_xmit = ipv4_specific.queue_xmit;
-	subflow_v6m_specific.send_check = ipv4_specific.send_check;
 	subflow_v6m_specific.net_header_len = ipv4_specific.net_header_len;
 	subflow_v6m_specific.mtu_reduced = ipv4_specific.mtu_reduced;
 	subflow_v6m_specific.rebuild_header = subflow_rebuild_header;
diff --git a/net/tls/tls_device_fallback.c b/net/tls/tls_device_fallback.c
index 03d508a45aaee9218bb2deed542534785f2019d6..de7d86bdd7ec99df5be4215ff79dbd5e86e49934 100644
--- a/net/tls/tls_device_fallback.c
+++ b/net/tls/tls_device_fallback.c
@@ -149,9 +149,6 @@ static int tls_enc_records(struct aead_request *aead_req,
 	return rc;
 }
 
-/* Can't use icsk->icsk_af_ops->send_check here because the ip addresses
- * might have been changed by NAT.
- */
 static void update_chksum(struct sk_buff *skb, int headln)
 {
 	struct tcphdr *th = tcp_hdr(skb);
-- 
2.53.0.rc1.225.gd81095ad13-goog


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH net-next 3/3] tcp: make tcp_v{4,6}_send_check() static
  2026-02-03 14:40 ` [PATCH net-next 3/3] tcp: make tcp_v{4,6}_send_check() static Eric Dumazet
@ 2026-02-03 17:26   ` Jakub Kicinski
  2026-02-03 18:18     ` Eric Dumazet
  2026-02-03 19:55   ` kernel test robot
  1 sibling, 1 reply; 9+ messages in thread
From: Jakub Kicinski @ 2026-02-03 17:26 UTC (permalink / raw)
  To: Eric Dumazet
  Cc: David S . Miller, Paolo Abeni, Simon Horman, Neal Cardwell,
	Kuniyuki Iwashima, netdev, eric.dumazet

On Tue,  3 Feb 2026 14:40:53 +0000 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.

Seeing this in allmodconfig:

net/ipv4/tcp_output.c:1482:13: warning: unused function 'tcp_v4_send_check' [-Wunused-function]
 1482 | static void tcp_v4_send_check(struct sock *sk, struct sk_buff *skb)
      |             ^~~~~~~~~~~~~~~~~
-- 
pw-bot: cr

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH net-next 3/3] tcp: make tcp_v{4,6}_send_check() static
  2026-02-03 17:26   ` Jakub Kicinski
@ 2026-02-03 18:18     ` Eric Dumazet
  2026-02-10 14:09       ` Eric Dumazet
  0 siblings, 1 reply; 9+ messages in thread
From: Eric Dumazet @ 2026-02-03 18:18 UTC (permalink / raw)
  To: Jakub Kicinski
  Cc: David S . Miller, Paolo Abeni, Simon Horman, Neal Cardwell,
	Kuniyuki Iwashima, netdev, eric.dumazet

On Tue, Feb 3, 2026 at 6:26 PM Jakub Kicinski <kuba@kernel.org> wrote:
>
> On Tue,  3 Feb 2026 14:40:53 +0000 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.
>
> Seeing this in allmodconfig:
>
> net/ipv4/tcp_output.c:1482:13: warning: unused function 'tcp_v4_send_check' [-Wunused-function]
>  1482 | static void tcp_v4_send_check(struct sock *sk, struct sk_buff *skb)
>       |             ^~~~~~~~~~~~~~~~~

Silly me, I will squash this in V2 tomorrow, thanks.

diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c
index fc9f096dff313d14b96a4d7d2724f9740aa55d61..0381112f05e6d48f70f4941abc3af6e9b6b148d9
100644
--- a/net/ipv4/tcp_output.c
+++ b/net/ipv4/tcp_output.c
@@ -1617,9 +1617,8 @@ static int __tcp_transmit_skb(struct sock *sk,
struct sk_buff *skb,
        if (likely(icsk->icsk_af_ops->net_header_len == sizeof(struct ipv6hdr)))
                tcp_v6_send_check(sk, skb);
        else
-#else
-               tcp_v4_send_check(sk, skb);
 #endif
+               tcp_v4_send_check(sk, skb);

        if (likely(tcb->tcp_flags & TCPHDR_ACK))
                tcp_event_ack_sent(sk, rcv_nxt);

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH net-next 3/3] tcp: make tcp_v{4,6}_send_check() static
  2026-02-03 14:40 ` [PATCH net-next 3/3] tcp: make tcp_v{4,6}_send_check() static Eric Dumazet
  2026-02-03 17:26   ` Jakub Kicinski
@ 2026-02-03 19:55   ` kernel test robot
  1 sibling, 0 replies; 9+ messages in thread
From: kernel test robot @ 2026-02-03 19:55 UTC (permalink / raw)
  To: Eric Dumazet, David S . Miller, Jakub Kicinski, Paolo Abeni
  Cc: oe-kbuild-all, Simon Horman, Neal Cardwell, Kuniyuki Iwashima,
	netdev, eric.dumazet, Eric Dumazet

Hi Eric,

kernel test robot noticed the following build warnings:

[auto build test WARNING on net-next/main]

url:    https://github.com/intel-lab-lkp/linux/commits/Eric-Dumazet/tcp-inline-__tcp_v4_send_check/20260203-224938
base:   net-next/main
patch link:    https://lore.kernel.org/r/20260203144053.83193-4-edumazet%40google.com
patch subject: [PATCH net-next 3/3] tcp: make tcp_v{4,6}_send_check() static
config: parisc-defconfig (https://download.01.org/0day-ci/archive/20260204/202602040323.jUZrgY0y-lkp@intel.com/config)
compiler: hppa-linux-gcc (GCC) 15.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260204/202602040323.jUZrgY0y-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202602040323.jUZrgY0y-lkp@intel.com/

All warnings (new ones prefixed by >>):

>> net/ipv4/tcp_output.c:1482:13: warning: 'tcp_v4_send_check' defined but not used [-Wunused-function]
    1482 | static void tcp_v4_send_check(struct sock *sk, struct sk_buff *skb)
         |             ^~~~~~~~~~~~~~~~~


vim +/tcp_v4_send_check +1482 net/ipv4/tcp_output.c

  1480	
  1481	/* This routine computes an IPv4 TCP checksum. */
> 1482	static void tcp_v4_send_check(struct sock *sk, struct sk_buff *skb)
  1483	{
  1484		const struct inet_sock *inet = inet_sk(sk);
  1485	
  1486		__tcp_v4_send_check(skb, inet->inet_saddr, inet->inet_daddr);
  1487	}
  1488	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH net-next 2/3] tcp: move tcp_v6_send_check() to tcp_output.c
  2026-02-03 14:40 ` [PATCH net-next 2/3] tcp: move tcp_v6_send_check() to tcp_output.c Eric Dumazet
@ 2026-02-09  5:10   ` kernel test robot
  0 siblings, 0 replies; 9+ messages in thread
From: kernel test robot @ 2026-02-09  5:10 UTC (permalink / raw)
  To: Eric Dumazet
  Cc: oe-lkp, lkp, netdev, David S . Miller, Jakub Kicinski,
	Paolo Abeni, Simon Horman, Neal Cardwell, Kuniyuki Iwashima,
	eric.dumazet, Eric Dumazet, oliver.sang



Hello,

kernel test robot noticed "RIP:skb_checksum_help" on:

commit: e0b782187c458dac827263181b85fed32e3e0faa ("[PATCH net-next 2/3] tcp: move tcp_v6_send_check() to tcp_output.c")
url: https://github.com/intel-lab-lkp/linux/commits/Eric-Dumazet/tcp-inline-__tcp_v4_send_check/20260203-224938
base: https://git.kernel.org/cgit/linux/kernel/git/davem/net-next.git 667539f6dce27aa7db0a711375f94e14e714a698
patch link: https://lore.kernel.org/all/20260203144053.83193-3-edumazet@google.com/
patch subject: [PATCH net-next 2/3] tcp: move tcp_v6_send_check() to tcp_output.c

in testcase: kernel-selftests
version: kernel-selftests-x86_64-9f2693489ef8-1_20260201
with following parameters:

	group: sgx



config: x86_64-rhel-9.4-kselftests
compiler: gcc-14
test machine: 16 threads 1 sockets Intel(R) Xeon(R) E-2278G CPU @ 3.40GHz (Coffee Lake-E) with 32G memory

(please refer to attached dmesg/kmsg for entire log/backtrace)



If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <oliver.sang@intel.com>
| Closes: https://lore.kernel.org/oe-lkp/202602091222.231689fb-lkp@intel.com



[   58.597580][ T2071] ------------[ cut here ]------------
[   58.597581][ T2071] offset (-246) >= skb_headlen() (74)
[   58.597583][ T2071] WARNING: net/core/dev.c:3591 at skb_checksum_help+0x3fc/0x6b0, CPU#9: wget/2071
[   58.597589][ T2071] Modules linked in: btrfs blake2b libblake2b xor zstd_compress raid6_pq intel_rapl_msr intel_rapl_common intel_uncore_frequency intel_uncore_frequency_common x86_pkg_temp_thermal intel_powerclamp coretemp kvm_intel sd_mod kvm sg snd_pcm irqbypass ghash_clmulni_intel ast snd_timer i2c_designware_platform rapl drm_client_lib i2c_designware_core snd intel_cstate drm_shmem_helper ppdev ahci soundcore wmi_bmof intel_wmi_thunderbolt libahci intel_uncore i2c_i801 drm_kms_helper intel_lpss_pci mei_me intel_pmc_core intel_lpss intel_ish_ipc pcspkr i2c_smbus libata idma64 mei intel_ishtp intel_pch_thermal ie31200_edac parport_pc pmt_telemetry video acpi_power_meter parport pmt_discovery pmt_class acpi_ipmi wmi ipmi_devintf pinctrl_cannonlake intel_pmc_ssram_telemetry intel_vsec ipmi_msghandler acpi_pad acpi_tad binfmt_misc fuse drm nfnetlink sch_fq_codel
[   58.597670][ T2071] CPU: 9 UID: 0 PID: 2071 Comm: wget Tainted: G S                  6.19.0-rc7-01160-ge0b782187c45 #1 PREEMPT(voluntary)
[   58.597674][ T2071] Tainted: [S]=CPU_OUT_OF_SPEC
[   58.597676][ T2071] Hardware name: Intel Corporation Mehlow UP Server Platform/Moss Beach Server, BIOS CNLSE2R1.R00.X188.B13.1903250419 03/25/2019
[   58.597678][ T2071] RIP: 0010:skb_checksum_help (net/core/dev.c:3591 (discriminator 1))
[   58.597681][ T2071] Code: ff ff 5b 5d 41 5c 41 5d 41 5e 41 5f c3 cc cc cc cc 80 3d 38 9f e0 02 00 0f 84 13 01 00 00 48 8d 3d b4 86 ea 02 89 c2 44 89 c6 <67> 48 0f b9 3a eb c8 80 3d 17 9f e0 02 00 0f 84 69 01 00 00 48 8d
All code
========
   0:	ff                   	(bad)
   1:	ff 5b 5d             	lcall  *0x5d(%rbx)
   4:	41 5c                	pop    %r12
   6:	41 5d                	pop    %r13
   8:	41 5e                	pop    %r14
   a:	41 5f                	pop    %r15
   c:	c3                   	ret
   d:	cc                   	int3
   e:	cc                   	int3
   f:	cc                   	int3
  10:	cc                   	int3
  11:	80 3d 38 9f e0 02 00 	cmpb   $0x0,0x2e09f38(%rip)        # 0x2e09f50
  18:	0f 84 13 01 00 00    	je     0x131
  1e:	48 8d 3d b4 86 ea 02 	lea    0x2ea86b4(%rip),%rdi        # 0x2ea86d9
  25:	89 c2                	mov    %eax,%edx
  27:	44 89 c6             	mov    %r8d,%esi
  2a:*	67 48 0f b9 3a       	ud1    (%edx),%rdi		<-- trapping instruction
  2f:	eb c8                	jmp    0xfffffffffffffff9
  31:	80 3d 17 9f e0 02 00 	cmpb   $0x0,0x2e09f17(%rip)        # 0x2e09f4f
  38:	0f 84 69 01 00 00    	je     0x1a7
  3e:	48                   	rex.W
  3f:	8d                   	.byte 0x8d

Code starting with the faulting instruction
===========================================
   0:	67 48 0f b9 3a       	ud1    (%edx),%rdi
   5:	eb c8                	jmp    0xffffffffffffffcf
   7:	80 3d 17 9f e0 02 00 	cmpb   $0x0,0x2e09f17(%rip)        # 0x2e09f25
   e:	0f 84 69 01 00 00    	je     0x17d
  14:	48                   	rex.W
  15:	8d                   	.byte 0x8d
[   58.597684][ T2071] RSP: 0018:ffffc900078feeb8 EFLAGS: 00010202
[   58.597687][ T2071] RAX: 000000000000004a RBX: ffff88885161cd68 RCX: 0000000000000000
[   58.597689][ T2071] RDX: 000000000000004a RSI: 00000000ffffff0a RDI: ffffffff8669e580
[   58.597690][ T2071] RBP: ffff88885161ce38 R08: 00000000ffffff0a R09: 0000000000000000
[   58.597692][ T2071] R10: ffff8887d84ac7cb R11: ffffffff85611318 R12: ffff88885161cddc
[   58.597694][ T2071] R13: 00000000000000f6 R14: ffff88885161cdd8 R15: 0000000000000000
[   58.597696][ T2071] FS:  00007f92ce5929c0(0000) GS:ffff888850da1000(0000) knlGS:0000000000000000
[   58.597698][ T2071] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[   58.597699][ T2071] CR2: 00007f820b871060 CR3: 0000000320a0a006 CR4: 00000000003726f0
[   58.597701][ T2071] Call Trace:
[   58.597703][ T2071]  <TASK>
[   58.597708][ T2071]  skb_csum_hwoffload_help (net/core/dev.c:3910)
[   58.597714][ T2071]  ? __pfx_skb_csum_hwoffload_help (net/core/dev.c:3910)
[   58.597722][ T2071]  validate_xmit_skb (net/core/dev.c:4040 (discriminator 1))
[   58.597728][ T2071]  validate_xmit_skb_list (net/core/dev.c:4068)
[   58.597733][ T2071]  sch_direct_xmit (net/sched/sch_generic.c:335 (discriminator 1))
[   58.597740][ T2071]  ? __pfx_sch_direct_xmit (net/sched/sch_generic.c:322)
[   58.597742][ T2071]  ? do_raw_spin_lock (arch/x86/include/asm/atomic.h:107 include/linux/atomic/atomic-arch-fallback.h:2170 include/linux/atomic/atomic-instrumented.h:1302 include/asm-generic/qspinlock.h:111 kernel/locking/spinlock_debug.c:116)
[   58.597746][ T2071]  ? __pfx_do_raw_spin_lock (kernel/locking/spinlock_debug.c:114)
[   58.597750][ T2071]  ? lock_acquire (include/trace/events/lock.h:24 (discriminator 2) kernel/locking/lockdep.c:5831 (discriminator 2))
[   58.597755][ T2071]  __dev_xmit_skb (net/core/dev.c:4248 (discriminator 1))
[   58.597761][ T2071]  ? __pfx___dev_xmit_skb (net/core/dev.c:4155)
[   58.597765][ T2071]  ? netdev_pick_tx (net/core/dev.c:4673)
[   58.597772][ T2071]  __dev_queue_xmit (net/core/dev.c:4797 (discriminator 1))
[   58.597776][ T2071]  ? check_prev_add (kernel/locking/lockdep.c:3245)
[   58.597779][ T2071]  ? look_up_lock_class (kernel/locking/lockdep.c:933 (discriminator 28))
[   58.597784][ T2071]  ? validate_chain (kernel/locking/lockdep.c:192 kernel/locking/lockdep.c:3912)
[   58.597787][ T2071]  ? lock_release (kernel/locking/lockdep.c:470 (discriminator 4) kernel/locking/lockdep.c:5891 (discriminator 4) kernel/locking/lockdep.c:5875 (discriminator 4))
[   58.604179][  T427]
[   58.609631][ T2071]  ? __pfx___dev_queue_xmit (net/core/dev.c:4739)
[   58.614759][  T427] Setting up libperl5.40:amd64 (5.40.1-6) ...
[   58.622521][ T2071]  ? __lock_acquire (kernel/locking/lockdep.c:5598 (discriminator 1) kernel/locking/lockdep.c:5227 (discriminator 1))
[   58.622528][ T2071]  ? find_held_lock (kernel/locking/lockdep.c:5350 (discriminator 1))
[   58.630933][  T427]
[   58.639329][ T2071]  ? ip_finish_output2 (include/net/neighbour.h:554 net/ipv4/ip_output.c:237)
[   58.639350][ T2071]  ? mark_held_locks (kernel/locking/lockdep.c:4325 (discriminator 1))
[   58.648209][  T427] Setting up perl (5.40.1-6) ...
[   58.654544][ T2071]  ? neigh_hh_output (arch/x86/include/asm/irqflags.h:42 arch/x86/include/asm/irqflags.h:119 arch/x86/include/asm/irqflags.h:159 include/linux/seqlock.h:74 include/linux/seqlock.h:836 include/net/neighbour.h:510)
[   58.654549][ T2071]  ? __asan_memcpy (mm/kasan/shadow.c:105 (discriminator 1))
[   58.659944][  T427]
[   58.665171][ T2071]  ? neigh_hh_output (include/net/neighbour.h:521 (discriminator 6))
[   58.665177][ T2071]  ip_finish_output2 (include/net/neighbour.h:554 net/ipv4/ip_output.c:237)
[   58.674975][  T427] Setting up libgcc-14-dev:amd64 (14.2.0-19) ...
[   58.750584][ T2071]  ? __pfx_ip_finish_output2 (net/ipv4/ip_output.c:201)
[   58.763043][  T427]
[   58.767700][ T2071]  ? __ip_finish_output (include/net/ip.h:518 net/ipv4/ip_output.c:308 net/ipv4/ip_output.c:297)
[   58.781614][  T427] Setting up gcc-14-x86-64-linux-gnu (14.2.0-19) ...
[   58.786471][ T2071]  ip_output (include/linux/netfilter.h:307 net/ipv4/ip_output.c:438)
[   58.805959][  T427]
[   58.811915][ T2071]  ? __pfx_ip_output (net/ipv4/ip_output.c:429)
[   58.811918][ T2071]  ? lock_acquire (include/linux/preempt.h:469 (discriminator 2) include/trace/events/lock.h:24 (discriminator 2) include/trace/events/lock.h:24 (discriminator 2) kernel/locking/lockdep.c:5831 (discriminator 2))
[   58.820369][  T427] Setting up gcc-14 (14.2.0-19) ...
[   58.827634][ T2071]  ? find_held_lock (kernel/locking/lockdep.c:5350 (discriminator 1))
[   58.835497][  T427]
[   58.843338][ T2071]  ? ip4_dst_hoplimit (include/linux/rcupdate.h:341 include/linux/rcupdate.h:897 include/net/route.h:395)
[   58.851846][  T427] Setting up gcc-x86-64-linux-gnu (4:14.2.0-1) ...
[   58.860005][ T2071]  ? ip4_dst_hoplimit (include/linux/rcupdate.h:341 include/linux/rcupdate.h:897 include/net/route.h:395)
[   58.866491][  T427]
[   58.874333][ T2071]  ? __lock_release+0x5d/0x1b0
[   58.878004][  T427] Setting up gcc (4:14.2.0-1) ...
[   58.880336][ T2071]  __ip_queue_xmit (include/net/dst.h:470 (discriminator 8) net/ipv4/ip_output.c:131 (discriminator 8) net/ipv4/ip_output.c:534 (discriminator 8))
[   58.885595][  T427]
[   58.891439][ T2071]  __tcp_transmit_skb (net/ipv4/tcp_output.c:1696 (discriminator 4))
[   58.896997][  T427] Setting up g++-14-x86-64-linux-gnu (14.2.0-19) ...
[   58.901427][ T2071]  ? __pfx___tcp_transmit_skb (net/ipv4/tcp_output.c:1513)
[   58.906158][  T427]
[   58.911321][ T2071]  ? lockdep_hardirqs_on_prepare (kernel/locking/lockdep.c:4629 (discriminator 4))
[   58.916669][  T427] Setting up g++-14 (14.2.0-19) ...
[   58.921472][ T2071]  tcp_connect (net/ipv4/tcp_output.c:1714 net/ipv4/tcp_output.c:4380)
[   58.925973][  T427]
[   58.930620][ T2071]  ? __pfx_tcp_connect (net/ipv4/tcp_output.c:4300)
[   58.936411][  T427] Setting up g++-x86-64-linux-gnu (4:14.2.0-1) ...
[   58.940337][ T2071]  ? get_net_ns_by_id (include/linux/rcupdate.h:895 (discriminator 5) net/core/net_namespace.c:383 (discriminator 5))
[   58.945154][  T427]
[   58.949884][ T2071]  ? lock_release (kernel/locking/lockdep.c:470 (discriminator 4) kernel/locking/lockdep.c:5891 (discriminator 4) kernel/locking/lockdep.c:5875 (discriminator 4))
[   58.949914][ T2071]  tcp_v4_connect (net/ipv4/tcp_ipv4.c:347 (discriminator 1))
[   58.955368][  T427] Setting up g++ (4:14.2.0-1) ...
[   58.959662][ T2071]  ? __pfx_tcp_v4_connect (net/ipv4/tcp_ipv4.c:225)
[   58.964136][  T427]
[   58.966346][ T2071]  ? do_raw_spin_lock (arch/x86/include/asm/atomic.h:107 include/linux/atomic/atomic-arch-fallback.h:2170 include/linux/atomic/atomic-instrumented.h:1302 include/asm-generic/qspinlock.h:111 kernel/locking/spinlock_debug.c:116)
[   58.972814][  T427] update-alternatives: using /usr/bin/g++ to provide /usr/bin/c++ (c++) in auto mode
[   58.977548][ T2071]  ? find_held_lock (kernel/locking/lockdep.c:5350 (discriminator 1))
[   58.982282][  T427]
[   58.986831][ T2071]  ? inet_stream_connect (net/ipv4/af_inet.c:750)
[   58.989558][  T427] Setting up libdpkg-perl (1.22.21) ...
[   58.994118][ T2071]  __inet_stream_connect (net/ipv4/af_inet.c:679)
[   58.998769][  T427]
[   59.003583][ T2071]  inet_stream_connect (net/ipv4/af_inet.c:751)
[   59.008877][  T427] Setting up dropwatch (1.5.4-4) ...
[   59.012874][ T2071]  __sys_connect (include/linux/file.h:62 (discriminator 1) include/linux/file.h:83 (discriminator 1) net/socket.c:2098 (discriminator 1))
[   59.015120][  T427]
[   59.019936][ T2071]  ? __pfx___sys_connect (net/socket.c:2096)
[   59.025375][  T427] Setting up ebtables (2.0.11-6) ...
[   59.031064][ T2071]  ? _copy_to_user (arch/x86/include/asm/uaccess_64.h:126 arch/x86/include/asm/uaccess_64.h:147 include/linux/uaccess.h:206 lib/usercopy.c:26)
[   59.036408][  T427]
[   59.038621][ T2071]  ? __x64_sys_rt_sigaction (kernel/signal.c:4646 (discriminator 1) kernel/signal.c:4627 (discriminator 1) kernel/signal.c:4627 (discriminator 1))
[   59.045289][  T427] update-alternatives: using /usr/sbin/ebtables-legacy to provide /usr/sbin/ebtables (ebtables) in auto mode
[   59.050243][ T2071]  ? __pfx___x64_sys_rt_sigaction (kernel/signal.c:4627)
[   59.054368][  T427]
[   59.056585][ T2071]  __x64_sys_connect (net/socket.c:2111)
[   59.061751][  T427] Setting up lib32gcc-s1 (14.2.0-19) ...
[   59.066293][ T2071]  do_syscall_64 (arch/x86/entry/syscall_64.c:63 (discriminator 1) arch/x86/entry/syscall_64.c:94 (discriminator 1))
[   59.066299][ T2071]  ? lock_acquire (include/linux/preempt.h:469 (discriminator 2) include/trace/events/lock.h:24 (discriminator 2) include/trace/events/lock.h:24 (discriminator 2) kernel/locking/lockdep.c:5831 (discriminator 2))
[   59.071388][  T427]
[   59.075940][ T2071]  ? __might_fault (mm/memory.c:7177 (discriminator 1))
[   59.078713][  T427] Setting up libx32gcc-s1 (14.2.0-19) ...
[   59.083070][ T2071]  ? find_held_lock (kernel/locking/lockdep.c:5350 (discriminator 1))
[   59.089460][  T427]
[   59.094354][ T2071]  ? __might_fault (mm/memory.c:7177 (discriminator 1))
[   59.097161][  T427] Setting up lib32atomic1 (14.2.0-19) ...
[   59.101827][ T2071]  ? __might_fault (mm/memory.c:7177 (discriminator 1))


The kernel config and materials to reproduce are available at:
https://download.01.org/0day-ci/archive/20260209/202602091222.231689fb-lkp@intel.com



-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH net-next 3/3] tcp: make tcp_v{4,6}_send_check() static
  2026-02-03 18:18     ` Eric Dumazet
@ 2026-02-10 14:09       ` Eric Dumazet
  0 siblings, 0 replies; 9+ messages in thread
From: Eric Dumazet @ 2026-02-10 14:09 UTC (permalink / raw)
  To: Jakub Kicinski
  Cc: David S . Miller, Paolo Abeni, Simon Horman, Neal Cardwell,
	Kuniyuki Iwashima, netdev, eric.dumazet

On Tue, Feb 3, 2026 at 7:18 PM Eric Dumazet <edumazet@google.com> wrote:
>
> On Tue, Feb 3, 2026 at 6:26 PM Jakub Kicinski <kuba@kernel.org> wrote:
> >
> > On Tue,  3 Feb 2026 14:40:53 +0000 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.
> >
> > Seeing this in allmodconfig:
> >
> > net/ipv4/tcp_output.c:1482:13: warning: unused function 'tcp_v4_send_check' [-Wunused-function]
> >  1482 | static void tcp_v4_send_check(struct sock *sk, struct sk_buff *skb)
> >       |             ^~~~~~~~~~~~~~~~~
>
> Silly me, I will squash this in V2 tomorrow, thanks.
>
> diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c
> index fc9f096dff313d14b96a4d7d2724f9740aa55d61..0381112f05e6d48f70f4941abc3af6e9b6b148d9
> 100644
> --- a/net/ipv4/tcp_output.c
> +++ b/net/ipv4/tcp_output.c
> @@ -1617,9 +1617,8 @@ static int __tcp_transmit_skb(struct sock *sk,
> struct sk_buff *skb,
>         if (likely(icsk->icsk_af_ops->net_header_len == sizeof(struct ipv6hdr)))
>                 tcp_v6_send_check(sk, skb);
>         else
> -#else
> -               tcp_v4_send_check(sk, skb);
>  #endif
> +               tcp_v4_send_check(sk, skb);
>
>         if (likely(tcb->tcp_flags & TCPHDR_ACK))
>                 tcp_event_ack_sent(sk, rcv_nxt);

It seems I forgot to send a V2, this will wait ~2 weeks ;)

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2026-02-10 14:09 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-02-03 14:40 [PATCH net-next 0/3] tcp: rework tcp_v{4,6}_send_check() Eric Dumazet
2026-02-03 14:40 ` [PATCH net-next 1/3] tcp: inline __tcp_v4_send_check() Eric Dumazet
2026-02-03 14:40 ` [PATCH net-next 2/3] tcp: move tcp_v6_send_check() to tcp_output.c Eric Dumazet
2026-02-09  5:10   ` kernel test robot
2026-02-03 14:40 ` [PATCH net-next 3/3] tcp: make tcp_v{4,6}_send_check() static Eric Dumazet
2026-02-03 17:26   ` Jakub Kicinski
2026-02-03 18:18     ` Eric Dumazet
2026-02-10 14:09       ` Eric Dumazet
2026-02-03 19:55   ` kernel test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox