netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next 0/2] tcp: remove rtx_syn_ack and inet_rtx_syn_ack()
@ 2025-06-26 15:30 Eric Dumazet
  2025-06-26 15:30 ` [PATCH net-next 1/2] tcp: remove rtx_syn_ack field Eric Dumazet
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Eric Dumazet @ 2025-06-26 15:30 UTC (permalink / raw)
  To: David S . Miller, Jakub Kicinski, Paolo Abeni, Neal Cardwell
  Cc: Simon Horman, Kuniyuki Iwashima, netdev, eric.dumazet,
	Eric Dumazet

After DCCP removal, we can cleanup SYNACK retransmits a bit.

Eric Dumazet (2):
  tcp: remove rtx_syn_ack field
  tcp: remove inet_rtx_syn_ack()

 include/net/request_sock.h      |  4 ----
 net/ipv4/inet_connection_sock.c | 11 +----------
 net/ipv4/tcp_ipv4.c             |  1 -
 net/ipv4/tcp_minisocks.c        |  2 +-
 net/ipv4/tcp_output.c           |  1 +
 net/ipv4/tcp_timer.c            |  2 +-
 net/ipv6/tcp_ipv6.c             |  1 -
 7 files changed, 4 insertions(+), 18 deletions(-)

-- 
2.50.0.727.gbf7dc18ff4-goog


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

* [PATCH net-next 1/2] tcp: remove rtx_syn_ack field
  2025-06-26 15:30 [PATCH net-next 0/2] tcp: remove rtx_syn_ack and inet_rtx_syn_ack() Eric Dumazet
@ 2025-06-26 15:30 ` Eric Dumazet
  2025-06-26 15:40   ` Neal Cardwell
  2025-06-27 21:33   ` Kuniyuki Iwashima
  2025-06-26 15:30 ` [PATCH net-next 2/2] tcp: remove inet_rtx_syn_ack() Eric Dumazet
  2025-06-27 22:50 ` [PATCH net-next 0/2] tcp: remove rtx_syn_ack and inet_rtx_syn_ack() patchwork-bot+netdevbpf
  2 siblings, 2 replies; 8+ messages in thread
From: Eric Dumazet @ 2025-06-26 15:30 UTC (permalink / raw)
  To: David S . Miller, Jakub Kicinski, Paolo Abeni, Neal Cardwell
  Cc: Simon Horman, Kuniyuki Iwashima, netdev, eric.dumazet,
	Eric Dumazet

Now inet_rtx_syn_ack() is only used by TCP, it can directly
call tcp_rtx_synack() instead of using an indirect call
to req->rsk_ops->rtx_syn_ack().

Signed-off-by: Eric Dumazet <edumazet@google.com>
---
 include/net/request_sock.h      | 2 --
 net/ipv4/inet_connection_sock.c | 2 +-
 net/ipv4/tcp_ipv4.c             | 1 -
 net/ipv6/tcp_ipv6.c             | 1 -
 4 files changed, 1 insertion(+), 5 deletions(-)

diff --git a/include/net/request_sock.h b/include/net/request_sock.h
index b07b1cd14e9f4d41d2b4fbad6015bbfae4190636..bad7d16a5515beec7375bddbb74fdb8a6d0b4726 100644
--- a/include/net/request_sock.h
+++ b/include/net/request_sock.h
@@ -30,8 +30,6 @@ struct request_sock_ops {
 	unsigned int	obj_size;
 	struct kmem_cache	*slab;
 	char		*slab_name;
-	int		(*rtx_syn_ack)(const struct sock *sk,
-				       struct request_sock *req);
 	void		(*send_ack)(const struct sock *sk, struct sk_buff *skb,
 				    struct request_sock *req);
 	void		(*send_reset)(const struct sock *sk,
diff --git a/net/ipv4/inet_connection_sock.c b/net/ipv4/inet_connection_sock.c
index f4157d26ec9e41eb2650b4d0155f796d2d535766..d61eef748851796f53592ca6781428266bdaca26 100644
--- a/net/ipv4/inet_connection_sock.c
+++ b/net/ipv4/inet_connection_sock.c
@@ -886,7 +886,7 @@ static void syn_ack_recalc(struct request_sock *req,
 
 int inet_rtx_syn_ack(const struct sock *parent, struct request_sock *req)
 {
-	int err = req->rsk_ops->rtx_syn_ack(parent, req);
+	int err = tcp_rtx_synack(parent, req);
 
 	if (!err)
 		req->num_retrans++;
diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c
index 429fb34b075e0bdad0e1c55dd6b1101b3dfe78dd..56223338bc0f070179efb2ce9996fa7146782adc 100644
--- a/net/ipv4/tcp_ipv4.c
+++ b/net/ipv4/tcp_ipv4.c
@@ -1703,7 +1703,6 @@ static struct dst_entry *tcp_v4_route_req(const struct sock *sk,
 struct request_sock_ops tcp_request_sock_ops __read_mostly = {
 	.family		=	PF_INET,
 	.obj_size	=	sizeof(struct tcp_request_sock),
-	.rtx_syn_ack	=	tcp_rtx_synack,
 	.send_ack	=	tcp_v4_reqsk_send_ack,
 	.destructor	=	tcp_v4_reqsk_destructor,
 	.send_reset	=	tcp_v4_send_reset,
diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c
index f0ce62549d90d6492b8ab139640cca91e4a9c2c7..9fb614e17bde99e5806cd56fdbc4d0b0b74a3f57 100644
--- a/net/ipv6/tcp_ipv6.c
+++ b/net/ipv6/tcp_ipv6.c
@@ -835,7 +835,6 @@ static struct dst_entry *tcp_v6_route_req(const struct sock *sk,
 struct request_sock_ops tcp6_request_sock_ops __read_mostly = {
 	.family		=	AF_INET6,
 	.obj_size	=	sizeof(struct tcp6_request_sock),
-	.rtx_syn_ack	=	tcp_rtx_synack,
 	.send_ack	=	tcp_v6_reqsk_send_ack,
 	.destructor	=	tcp_v6_reqsk_destructor,
 	.send_reset	=	tcp_v6_send_reset,
-- 
2.50.0.727.gbf7dc18ff4-goog


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

* [PATCH net-next 2/2] tcp: remove inet_rtx_syn_ack()
  2025-06-26 15:30 [PATCH net-next 0/2] tcp: remove rtx_syn_ack and inet_rtx_syn_ack() Eric Dumazet
  2025-06-26 15:30 ` [PATCH net-next 1/2] tcp: remove rtx_syn_ack field Eric Dumazet
@ 2025-06-26 15:30 ` Eric Dumazet
  2025-06-26 15:40   ` Neal Cardwell
  2025-06-27 21:35   ` Kuniyuki Iwashima
  2025-06-27 22:50 ` [PATCH net-next 0/2] tcp: remove rtx_syn_ack and inet_rtx_syn_ack() patchwork-bot+netdevbpf
  2 siblings, 2 replies; 8+ messages in thread
From: Eric Dumazet @ 2025-06-26 15:30 UTC (permalink / raw)
  To: David S . Miller, Jakub Kicinski, Paolo Abeni, Neal Cardwell
  Cc: Simon Horman, Kuniyuki Iwashima, netdev, eric.dumazet,
	Eric Dumazet

inet_rtx_syn_ack() is a simple wrapper around tcp_rtx_synack(),
if we move req->num_retrans update.

Signed-off-by: Eric Dumazet <edumazet@google.com>
---
 include/net/request_sock.h      |  2 --
 net/ipv4/inet_connection_sock.c | 11 +----------
 net/ipv4/tcp_minisocks.c        |  2 +-
 net/ipv4/tcp_output.c           |  1 +
 net/ipv4/tcp_timer.c            |  2 +-
 5 files changed, 4 insertions(+), 14 deletions(-)

diff --git a/include/net/request_sock.h b/include/net/request_sock.h
index bad7d16a5515beec7375bddbb74fdb8a6d0b4726..6a5ec1418e8552b4aa9d25d61afa5376187b569d 100644
--- a/include/net/request_sock.h
+++ b/include/net/request_sock.h
@@ -39,8 +39,6 @@ struct request_sock_ops {
 	void		(*syn_ack_timeout)(const struct request_sock *req);
 };
 
-int inet_rtx_syn_ack(const struct sock *parent, struct request_sock *req);
-
 struct saved_syn {
 	u32 mac_hdrlen;
 	u32 network_hdrlen;
diff --git a/net/ipv4/inet_connection_sock.c b/net/ipv4/inet_connection_sock.c
index d61eef748851796f53592ca6781428266bdaca26..1e2df51427fed88d8a18a61b030f5e6234dadd8f 100644
--- a/net/ipv4/inet_connection_sock.c
+++ b/net/ipv4/inet_connection_sock.c
@@ -884,15 +884,6 @@ static void syn_ack_recalc(struct request_sock *req,
 		  req->num_timeout >= rskq_defer_accept - 1;
 }
 
-int inet_rtx_syn_ack(const struct sock *parent, struct request_sock *req)
-{
-	int err = tcp_rtx_synack(parent, req);
-
-	if (!err)
-		req->num_retrans++;
-	return err;
-}
-
 static struct request_sock *
 reqsk_alloc_noprof(const struct request_sock_ops *ops, struct sock *sk_listener,
 		   bool attach_listener)
@@ -1132,7 +1123,7 @@ static void reqsk_timer_handler(struct timer_list *t)
 	req->rsk_ops->syn_ack_timeout(req);
 	if (!expire &&
 	    (!resend ||
-	     !inet_rtx_syn_ack(sk_listener, req) ||
+	     !tcp_rtx_synack(sk_listener, req) ||
 	     inet_rsk(req)->acked)) {
 		if (req->num_timeout++ == 0)
 			atomic_dec(&queue->young);
diff --git a/net/ipv4/tcp_minisocks.c b/net/ipv4/tcp_minisocks.c
index 43d7852ce07e0440c7f43b7509df9229e666fd19..2994c9222c9cb5ee86b60bdb553f92130e52c70e 100644
--- a/net/ipv4/tcp_minisocks.c
+++ b/net/ipv4/tcp_minisocks.c
@@ -726,7 +726,7 @@ struct sock *tcp_check_req(struct sock *sk, struct sk_buff *skb,
 					  LINUX_MIB_TCPACKSKIPPEDSYNRECV,
 					  &tcp_rsk(req)->last_oow_ack_time) &&
 
-		    !inet_rtx_syn_ack(sk, req)) {
+		    !tcp_rtx_synack(sk, req)) {
 			unsigned long expires = jiffies;
 
 			expires += reqsk_timeout(req, TCP_RTO_MAX);
diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c
index 28f840724fe833d594e1b151f8e130d2d54fd766..b616776e3354c7df23890100def1df729fd33d12 100644
--- a/net/ipv4/tcp_output.c
+++ b/net/ipv4/tcp_output.c
@@ -4425,6 +4425,7 @@ int tcp_rtx_synack(const struct sock *sk, struct request_sock *req)
 			tcp_sk_rw(sk)->total_retrans++;
 		}
 		trace_tcp_retransmit_synack(sk, req);
+		req->num_retrans++;
 	}
 	return res;
 }
diff --git a/net/ipv4/tcp_timer.c b/net/ipv4/tcp_timer.c
index bb37e24b97a78de581e8192b52b78f83ba747446..a207877270fbdef6f86f61093aa476b6cd6f8706 100644
--- a/net/ipv4/tcp_timer.c
+++ b/net/ipv4/tcp_timer.c
@@ -478,7 +478,7 @@ static void tcp_fastopen_synack_timer(struct sock *sk, struct request_sock *req)
 	 * regular retransmit because if the child socket has been accepted
 	 * it's not good to give up too easily.
 	 */
-	inet_rtx_syn_ack(sk, req);
+	tcp_rtx_synack(sk, req);
 	req->num_timeout++;
 	tcp_update_rto_stats(sk);
 	if (!tp->retrans_stamp)
-- 
2.50.0.727.gbf7dc18ff4-goog


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

* Re: [PATCH net-next 1/2] tcp: remove rtx_syn_ack field
  2025-06-26 15:30 ` [PATCH net-next 1/2] tcp: remove rtx_syn_ack field Eric Dumazet
@ 2025-06-26 15:40   ` Neal Cardwell
  2025-06-27 21:33   ` Kuniyuki Iwashima
  1 sibling, 0 replies; 8+ messages in thread
From: Neal Cardwell @ 2025-06-26 15:40 UTC (permalink / raw)
  To: Eric Dumazet
  Cc: David S . Miller, Jakub Kicinski, Paolo Abeni, Simon Horman,
	Kuniyuki Iwashima, netdev, eric.dumazet

On Thu, Jun 26, 2025 at 11:30 AM Eric Dumazet <edumazet@google.com> wrote:
>
> Now inet_rtx_syn_ack() is only used by TCP, it can directly
> call tcp_rtx_synack() instead of using an indirect call
> to req->rsk_ops->rtx_syn_ack().
>
> Signed-off-by: Eric Dumazet <edumazet@google.com>

Reviewed-by: Neal Cardwell <ncardwell@google.com>

Thanks, Eric!

neal

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

* Re: [PATCH net-next 2/2] tcp: remove inet_rtx_syn_ack()
  2025-06-26 15:30 ` [PATCH net-next 2/2] tcp: remove inet_rtx_syn_ack() Eric Dumazet
@ 2025-06-26 15:40   ` Neal Cardwell
  2025-06-27 21:35   ` Kuniyuki Iwashima
  1 sibling, 0 replies; 8+ messages in thread
From: Neal Cardwell @ 2025-06-26 15:40 UTC (permalink / raw)
  To: Eric Dumazet
  Cc: David S . Miller, Jakub Kicinski, Paolo Abeni, Simon Horman,
	Kuniyuki Iwashima, netdev, eric.dumazet

On Thu, Jun 26, 2025 at 11:30 AM Eric Dumazet <edumazet@google.com> wrote:
>
> inet_rtx_syn_ack() is a simple wrapper around tcp_rtx_synack(),
> if we move req->num_retrans update.
>
> Signed-off-by: Eric Dumazet <edumazet@google.com>
> ---

Reviewed-by: Neal Cardwell <ncardwell@google.com>

Thanks, Eric!

neal

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

* Re: [PATCH net-next 1/2] tcp: remove rtx_syn_ack field
  2025-06-26 15:30 ` [PATCH net-next 1/2] tcp: remove rtx_syn_ack field Eric Dumazet
  2025-06-26 15:40   ` Neal Cardwell
@ 2025-06-27 21:33   ` Kuniyuki Iwashima
  1 sibling, 0 replies; 8+ messages in thread
From: Kuniyuki Iwashima @ 2025-06-27 21:33 UTC (permalink / raw)
  To: Eric Dumazet
  Cc: David S . Miller, Jakub Kicinski, Paolo Abeni, Neal Cardwell,
	Simon Horman, netdev, eric.dumazet

On Thu, Jun 26, 2025 at 8:30 AM Eric Dumazet <edumazet@google.com> wrote:
>
> Now inet_rtx_syn_ack() is only used by TCP, it can directly
> call tcp_rtx_synack() instead of using an indirect call
> to req->rsk_ops->rtx_syn_ack().
>
> Signed-off-by: Eric Dumazet <edumazet@google.com>

Reviewed-by: Kuniyuki Iwashima <kuniyu@google.com>

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

* Re: [PATCH net-next 2/2] tcp: remove inet_rtx_syn_ack()
  2025-06-26 15:30 ` [PATCH net-next 2/2] tcp: remove inet_rtx_syn_ack() Eric Dumazet
  2025-06-26 15:40   ` Neal Cardwell
@ 2025-06-27 21:35   ` Kuniyuki Iwashima
  1 sibling, 0 replies; 8+ messages in thread
From: Kuniyuki Iwashima @ 2025-06-27 21:35 UTC (permalink / raw)
  To: Eric Dumazet
  Cc: David S . Miller, Jakub Kicinski, Paolo Abeni, Neal Cardwell,
	Simon Horman, netdev, eric.dumazet

On Thu, Jun 26, 2025 at 8:30 AM Eric Dumazet <edumazet@google.com> wrote:
>
> inet_rtx_syn_ack() is a simple wrapper around tcp_rtx_synack(),
> if we move req->num_retrans update.
>
> Signed-off-by: Eric Dumazet <edumazet@google.com>

Reviewed-by: Kuniyuki Iwashima <kuniyu@google.com>

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

* Re: [PATCH net-next 0/2] tcp: remove rtx_syn_ack and inet_rtx_syn_ack()
  2025-06-26 15:30 [PATCH net-next 0/2] tcp: remove rtx_syn_ack and inet_rtx_syn_ack() Eric Dumazet
  2025-06-26 15:30 ` [PATCH net-next 1/2] tcp: remove rtx_syn_ack field Eric Dumazet
  2025-06-26 15:30 ` [PATCH net-next 2/2] tcp: remove inet_rtx_syn_ack() Eric Dumazet
@ 2025-06-27 22:50 ` patchwork-bot+netdevbpf
  2 siblings, 0 replies; 8+ messages in thread
From: patchwork-bot+netdevbpf @ 2025-06-27 22:50 UTC (permalink / raw)
  To: Eric Dumazet
  Cc: davem, kuba, pabeni, ncardwell, horms, kuniyu, netdev,
	eric.dumazet

Hello:

This series was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:

On Thu, 26 Jun 2025 15:30:15 +0000 you wrote:
> After DCCP removal, we can cleanup SYNACK retransmits a bit.
> 
> Eric Dumazet (2):
>   tcp: remove rtx_syn_ack field
>   tcp: remove inet_rtx_syn_ack()
> 
>  include/net/request_sock.h      |  4 ----
>  net/ipv4/inet_connection_sock.c | 11 +----------
>  net/ipv4/tcp_ipv4.c             |  1 -
>  net/ipv4/tcp_minisocks.c        |  2 +-
>  net/ipv4/tcp_output.c           |  1 +
>  net/ipv4/tcp_timer.c            |  2 +-
>  net/ipv6/tcp_ipv6.c             |  1 -
>  7 files changed, 4 insertions(+), 18 deletions(-)

Here is the summary with links:
  - [net-next,1/2] tcp: remove rtx_syn_ack field
    https://git.kernel.org/netdev/net-next/c/8d68411a1287
  - [net-next,2/2] tcp: remove inet_rtx_syn_ack()
    https://git.kernel.org/netdev/net-next/c/cf56a9820297

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



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

end of thread, other threads:[~2025-06-27 22:49 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-26 15:30 [PATCH net-next 0/2] tcp: remove rtx_syn_ack and inet_rtx_syn_ack() Eric Dumazet
2025-06-26 15:30 ` [PATCH net-next 1/2] tcp: remove rtx_syn_ack field Eric Dumazet
2025-06-26 15:40   ` Neal Cardwell
2025-06-27 21:33   ` Kuniyuki Iwashima
2025-06-26 15:30 ` [PATCH net-next 2/2] tcp: remove inet_rtx_syn_ack() Eric Dumazet
2025-06-26 15:40   ` Neal Cardwell
2025-06-27 21:35   ` Kuniyuki Iwashima
2025-06-27 22:50 ` [PATCH net-next 0/2] tcp: remove rtx_syn_ack and inet_rtx_syn_ack() patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).