summaryrefslogtreecommitdiff
path: root/include/net/tcp.h
diff options
context:
space:
mode:
authorEric Dumazet <edumazet@google.com>2025-02-07 15:28:27 +0000
committerPaolo Abeni <pabeni@redhat.com>2025-02-11 13:07:59 +0100
commit7baa030155e8fa2a1bd9ea6425083c3b16787636 (patch)
tree2ae1d1e78d6b4eff32060ba2125dffe8c5f28763 /include/net/tcp.h
parent0fed463777b83abe6410a8073de3f997c29afe18 (diff)
tcp: add a @pace_delay parameter to tcp_reset_xmit_timer()
We want to factorize calls to inet_csk_reset_xmit_timer(), to ease TCP_RTO_MAX change. Current users want to add tcp_pacing_delay(sk) to the timeout. Remaining calls to inet_csk_reset_xmit_timer() do not add the pacing delay. Following patch will convert them, passing false for @pace_delay. 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>
Diffstat (limited to 'include/net/tcp.h')
-rw-r--r--include/net/tcp.h10
1 files changed, 6 insertions, 4 deletions
diff --git a/include/net/tcp.h b/include/net/tcp.h
index 8678a2d37ef8..56557b0104e3 100644
--- a/include/net/tcp.h
+++ b/include/net/tcp.h
@@ -1423,10 +1423,12 @@ static inline unsigned long tcp_pacing_delay(const struct sock *sk)
static inline void tcp_reset_xmit_timer(struct sock *sk,
const int what,
- unsigned long when)
+ unsigned long when,
+ bool pace_delay)
{
- inet_csk_reset_xmit_timer(sk, what, when + tcp_pacing_delay(sk),
- TCP_RTO_MAX);
+ if (pace_delay)
+ when += tcp_pacing_delay(sk);
+ inet_csk_reset_xmit_timer(sk, what, when, TCP_RTO_MAX);
}
/* Something is really bad, we could not queue an additional packet,
@@ -1455,7 +1457,7 @@ static inline void tcp_check_probe_timer(struct sock *sk)
{
if (!tcp_sk(sk)->packets_out && !inet_csk(sk)->icsk_pending)
tcp_reset_xmit_timer(sk, ICSK_TIME_PROBE0,
- tcp_probe0_base(sk));
+ tcp_probe0_base(sk), true);
}
static inline void tcp_init_wl(struct tcp_sock *tp, u32 seq)