diff options
author | Paolo Abeni <pabeni@redhat.com> | 2025-02-11 13:08:02 +0100 |
---|---|---|
committer | Paolo Abeni <pabeni@redhat.com> | 2025-02-11 13:08:02 +0100 |
commit | ae9b3c0e79bcc154f80f6e862d3085de31bcb3ce (patch) | |
tree | a30101f515f68abb751a449a79570c0458059f11 /net/ipv4/tcp_ipv4.c | |
parent | 812122783ae8b347633b7359a71cfba28ffdb66b (diff) | |
parent | 1280c26228bd7eb14bdecd67dedbdd871f8fdda5 (diff) |
Merge branch 'tcp-allow-to-reduce-max-rto'
Eric Dumazet says:
====================
tcp: allow to reduce max RTO
This is a followup of a discussion started 6 months ago
by Jason Xing.
Some applications want to lower the time between each
retransmit attempts.
TCP_KEEPINTVL and TCP_KEEPCNT socket options don't
work around the issue.
This series adds:
- a new TCP level socket option (TCP_RTO_MAX_MS)
- a new sysctl (/proc/sys/net/ipv4/tcp_rto_max_ms)
Admins and/or applications can now change the max rto value
at their own risk.
Link: https://lore.kernel.org/netdev/20240715033118.32322-1-kerneljasonxing@gmail.com/T/
====================
Link: https://patch.msgid.link/20250207152830.2527578-1-edumazet@google.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Diffstat (limited to 'net/ipv4/tcp_ipv4.c')
-rw-r--r-- | net/ipv4/tcp_ipv4.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c index cc2b5194a18d..d1fd2128ac6c 100644 --- a/net/ipv4/tcp_ipv4.c +++ b/net/ipv4/tcp_ipv4.c @@ -458,15 +458,14 @@ void tcp_ld_RTO_revert(struct sock *sk, u32 seq) icsk->icsk_backoff--; icsk->icsk_rto = tp->srtt_us ? __tcp_set_rto(tp) : TCP_TIMEOUT_INIT; - icsk->icsk_rto = inet_csk_rto_backoff(icsk, TCP_RTO_MAX); + icsk->icsk_rto = inet_csk_rto_backoff(icsk, tcp_rto_max(sk)); tcp_mstamp_refresh(tp); delta_us = (u32)(tp->tcp_mstamp - tcp_skb_timestamp_us(skb)); remaining = icsk->icsk_rto - usecs_to_jiffies(delta_us); if (remaining > 0) { - inet_csk_reset_xmit_timer(sk, ICSK_TIME_RETRANS, - remaining, TCP_RTO_MAX); + tcp_reset_xmit_timer(sk, ICSK_TIME_RETRANS, remaining, false); } else { /* RTO revert clocked out retransmission. * Will retransmit now. @@ -3533,6 +3532,7 @@ static int __net_init tcp_sk_init(struct net *net) net->ipv4.sysctl_tcp_pingpong_thresh = 1; net->ipv4.sysctl_tcp_rto_min_us = jiffies_to_usecs(TCP_RTO_MIN); + net->ipv4.sysctl_tcp_rto_max_ms = TCP_RTO_MAX_SEC * MSEC_PER_SEC; return 0; } |