Skip to content

Commit dba39f5

Browse files
committed
tcp: remove tcp_reset_xmit_timer() @max_when argument
JIRA: https://issues.redhat.com/browse/RHEL-115191 Upstream Status: linux.git commit 0fed463 Author: Eric Dumazet <edumazet@google.com> Date: Fri Feb 7 15:28:26 2025 +0000 tcp: remove tcp_reset_xmit_timer() @max_when argument All callers use TCP_RTO_MAX, we can factorize this constant, becoming a variable soon. Signed-off-by: Eric Dumazet <edumazet@google.com> Reviewed-by: Jason Xing <kerneljasonxing@gmail.com> Reviewed-by: Neal Cardwell <ncardwell@google.com> Reviewed-by: Kuniyuki Iwashima <kuniyu@amazon.com> Signed-off-by: Paolo Abeni <pabeni@redhat.com> Signed-off-by: Antoine Tenart <atenart@redhat.com>
1 parent d143c3a commit dba39f5

File tree

3 files changed

+8
-11
lines changed

3 files changed

+8
-11
lines changed

include/net/tcp.h

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1354,11 +1354,10 @@ static inline unsigned long tcp_pacing_delay(const struct sock *sk)
13541354

13551355
static inline void tcp_reset_xmit_timer(struct sock *sk,
13561356
const int what,
1357-
unsigned long when,
1358-
const unsigned long max_when)
1357+
unsigned long when)
13591358
{
13601359
inet_csk_reset_xmit_timer(sk, what, when + tcp_pacing_delay(sk),
1361-
max_when);
1360+
TCP_RTO_MAX);
13621361
}
13631362

13641363
/* Something is really bad, we could not queue an additional packet,
@@ -1387,7 +1386,7 @@ static inline void tcp_check_probe_timer(struct sock *sk)
13871386
{
13881387
if (!tcp_sk(sk)->packets_out && !inet_csk(sk)->icsk_pending)
13891388
tcp_reset_xmit_timer(sk, ICSK_TIME_PROBE0,
1390-
tcp_probe0_base(sk), TCP_RTO_MAX);
1389+
tcp_probe0_base(sk));
13911390
}
13921391

13931392
static inline void tcp_init_wl(struct tcp_sock *tp, u32 seq)

net/ipv4/tcp_input.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3231,8 +3231,7 @@ void tcp_rearm_rto(struct sock *sk)
32313231
*/
32323232
rto = usecs_to_jiffies(max_t(int, delta_us, 1));
32333233
}
3234-
tcp_reset_xmit_timer(sk, ICSK_TIME_RETRANS, rto,
3235-
TCP_RTO_MAX);
3234+
tcp_reset_xmit_timer(sk, ICSK_TIME_RETRANS, rto);
32363235
}
32373236
}
32383237

@@ -3513,7 +3512,7 @@ static void tcp_ack_probe(struct sock *sk)
35133512
unsigned long when = tcp_probe0_when(sk, TCP_RTO_MAX);
35143513

35153514
when = tcp_clamp_probe0_to_user_timeout(sk, when);
3516-
tcp_reset_xmit_timer(sk, ICSK_TIME_PROBE0, when, TCP_RTO_MAX);
3515+
tcp_reset_xmit_timer(sk, ICSK_TIME_PROBE0, when);
35173516
}
35183517
}
35193518

net/ipv4/tcp_output.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2787,7 +2787,7 @@ bool tcp_schedule_loss_probe(struct sock *sk, bool advancing_rto)
27872787
if (rto_delta_us > 0)
27882788
timeout = min_t(u32, timeout, usecs_to_jiffies(rto_delta_us));
27892789

2790-
tcp_reset_xmit_timer(sk, ICSK_TIME_LOSS_PROBE, timeout, TCP_RTO_MAX);
2790+
tcp_reset_xmit_timer(sk, ICSK_TIME_LOSS_PROBE, timeout);
27912791
return true;
27922792
}
27932793

@@ -3424,8 +3424,7 @@ void tcp_xmit_retransmit_queue(struct sock *sk)
34243424
}
34253425
if (rearm_timer)
34263426
tcp_reset_xmit_timer(sk, ICSK_TIME_RETRANS,
3427-
inet_csk(sk)->icsk_rto,
3428-
TCP_RTO_MAX);
3427+
inet_csk(sk)->icsk_rto);
34293428
}
34303429

34313430
/* We allow to exceed memory limits for FIN packets to expedite
@@ -4177,7 +4176,7 @@ void tcp_send_probe0(struct sock *sk)
41774176
}
41784177

41794178
timeout = tcp_clamp_probe0_to_user_timeout(sk, timeout);
4180-
tcp_reset_xmit_timer(sk, ICSK_TIME_PROBE0, timeout, TCP_RTO_MAX);
4179+
tcp_reset_xmit_timer(sk, ICSK_TIME_PROBE0, timeout);
41814180
}
41824181

41834182
int tcp_rtx_synack(const struct sock *sk, struct request_sock *req)

0 commit comments

Comments
 (0)