Skip to content

Commit cf56a98

Browse files
edumazetkuba-moo
authored andcommitted
tcp: remove inet_rtx_syn_ack()
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> Reviewed-by: Kuniyuki Iwashima <kuniyu@google.com> Link: https://patch.msgid.link/20250626153017.2156274-3-edumazet@google.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
1 parent 8d68411 commit cf56a98

File tree

5 files changed

+4
-14
lines changed

5 files changed

+4
-14
lines changed

include/net/request_sock.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,6 @@ struct request_sock_ops {
3939
void (*syn_ack_timeout)(const struct request_sock *req);
4040
};
4141

42-
int inet_rtx_syn_ack(const struct sock *parent, struct request_sock *req);
43-
4442
struct saved_syn {
4543
u32 mac_hdrlen;
4644
u32 network_hdrlen;

net/ipv4/inet_connection_sock.c

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -884,15 +884,6 @@ static void syn_ack_recalc(struct request_sock *req,
884884
req->num_timeout >= rskq_defer_accept - 1;
885885
}
886886

887-
int inet_rtx_syn_ack(const struct sock *parent, struct request_sock *req)
888-
{
889-
int err = tcp_rtx_synack(parent, req);
890-
891-
if (!err)
892-
req->num_retrans++;
893-
return err;
894-
}
895-
896887
static struct request_sock *
897888
reqsk_alloc_noprof(const struct request_sock_ops *ops, struct sock *sk_listener,
898889
bool attach_listener)
@@ -1132,7 +1123,7 @@ static void reqsk_timer_handler(struct timer_list *t)
11321123
req->rsk_ops->syn_ack_timeout(req);
11331124
if (!expire &&
11341125
(!resend ||
1135-
!inet_rtx_syn_ack(sk_listener, req) ||
1126+
!tcp_rtx_synack(sk_listener, req) ||
11361127
inet_rsk(req)->acked)) {
11371128
if (req->num_timeout++ == 0)
11381129
atomic_dec(&queue->young);

net/ipv4/tcp_minisocks.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -726,7 +726,7 @@ struct sock *tcp_check_req(struct sock *sk, struct sk_buff *skb,
726726
LINUX_MIB_TCPACKSKIPPEDSYNRECV,
727727
&tcp_rsk(req)->last_oow_ack_time) &&
728728

729-
!inet_rtx_syn_ack(sk, req)) {
729+
!tcp_rtx_synack(sk, req)) {
730730
unsigned long expires = jiffies;
731731

732732
expires += reqsk_timeout(req, TCP_RTO_MAX);

net/ipv4/tcp_output.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4425,6 +4425,7 @@ int tcp_rtx_synack(const struct sock *sk, struct request_sock *req)
44254425
tcp_sk_rw(sk)->total_retrans++;
44264426
}
44274427
trace_tcp_retransmit_synack(sk, req);
4428+
req->num_retrans++;
44284429
}
44294430
return res;
44304431
}

net/ipv4/tcp_timer.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -478,7 +478,7 @@ static void tcp_fastopen_synack_timer(struct sock *sk, struct request_sock *req)
478478
* regular retransmit because if the child socket has been accepted
479479
* it's not good to give up too easily.
480480
*/
481-
inet_rtx_syn_ack(sk, req);
481+
tcp_rtx_synack(sk, req);
482482
req->num_timeout++;
483483
tcp_update_rto_stats(sk);
484484
if (!tp->retrans_stamp)

0 commit comments

Comments
 (0)