Skip to content

Commit 27bee10

Browse files
committed
tcp: remove tcp_reset_xmit_timer() @max_when argument
JIRA: https://issues.redhat.com/browse/RHEL-115393 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 09d0790 commit 27bee10

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
@@ -1439,11 +1439,10 @@ static inline unsigned long tcp_pacing_delay(const struct sock *sk)
14391439

14401440
static inline void tcp_reset_xmit_timer(struct sock *sk,
14411441
const int what,
1442-
unsigned long when,
1443-
const unsigned long max_when)
1442+
unsigned long when)
14441443
{
14451444
inet_csk_reset_xmit_timer(sk, what, when + tcp_pacing_delay(sk),
1446-
max_when);
1445+
TCP_RTO_MAX);
14471446
}
14481447

14491448
/* Something is really bad, we could not queue an additional packet,
@@ -1472,7 +1471,7 @@ static inline void tcp_check_probe_timer(struct sock *sk)
14721471
{
14731472
if (!tcp_sk(sk)->packets_out && !inet_csk(sk)->icsk_pending)
14741473
tcp_reset_xmit_timer(sk, ICSK_TIME_PROBE0,
1475-
tcp_probe0_base(sk), TCP_RTO_MAX);
1474+
tcp_probe0_base(sk));
14761475
}
14771476

14781477
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
@@ -3290,8 +3290,7 @@ void tcp_rearm_rto(struct sock *sk)
32903290
*/
32913291
rto = usecs_to_jiffies(max_t(int, delta_us, 1));
32923292
}
3293-
tcp_reset_xmit_timer(sk, ICSK_TIME_RETRANS, rto,
3294-
TCP_RTO_MAX);
3293+
tcp_reset_xmit_timer(sk, ICSK_TIME_RETRANS, rto);
32953294
}
32963295
}
32973296

@@ -3571,7 +3570,7 @@ static void tcp_ack_probe(struct sock *sk)
35713570
unsigned long when = tcp_probe0_when(sk, TCP_RTO_MAX);
35723571

35733572
when = tcp_clamp_probe0_to_user_timeout(sk, when);
3574-
tcp_reset_xmit_timer(sk, ICSK_TIME_PROBE0, when, TCP_RTO_MAX);
3573+
tcp_reset_xmit_timer(sk, ICSK_TIME_PROBE0, when);
35753574
}
35763575
}
35773576

net/ipv4/tcp_output.c

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

2916-
tcp_reset_xmit_timer(sk, ICSK_TIME_LOSS_PROBE, timeout, TCP_RTO_MAX);
2916+
tcp_reset_xmit_timer(sk, ICSK_TIME_LOSS_PROBE, timeout);
29172917
return true;
29182918
}
29192919

@@ -3549,8 +3549,7 @@ void tcp_xmit_retransmit_queue(struct sock *sk)
35493549
}
35503550
if (rearm_timer)
35513551
tcp_reset_xmit_timer(sk, ICSK_TIME_RETRANS,
3552-
inet_csk(sk)->icsk_rto,
3553-
TCP_RTO_MAX);
3552+
inet_csk(sk)->icsk_rto);
35543553
}
35553554

35563555
/* We allow to exceed memory limits for FIN packets to expedite
@@ -4402,7 +4401,7 @@ void tcp_send_probe0(struct sock *sk)
44024401
}
44034402

44044403
timeout = tcp_clamp_probe0_to_user_timeout(sk, timeout);
4405-
tcp_reset_xmit_timer(sk, ICSK_TIME_PROBE0, timeout, TCP_RTO_MAX);
4404+
tcp_reset_xmit_timer(sk, ICSK_TIME_PROBE0, timeout);
44064405
}
44074406

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

0 commit comments

Comments
 (0)