Commit ae9b3c0e authored by Paolo Abeni's avatar Paolo Abeni
Browse files

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: default avatarPaolo Abeni <pabeni@redhat.com>
parents 81212278 1280c262
Loading
Loading
Loading
Loading
+13 −0
Original line number Diff line number Diff line
@@ -705,6 +705,8 @@ tcp_retries2 - INTEGER
	seconds and is a lower bound for the effective timeout.
	TCP will effectively time out at the first RTO which exceeds the
	hypothetical timeout.
	If tcp_rto_max_ms is decreased, it is recommended to also
	change tcp_retries2.

	RFC 1122 recommends at least 100 seconds for the timeout,
	which corresponds to a value of at least 8.
@@ -1237,6 +1239,17 @@ tcp_rto_min_us - INTEGER

	Default: 200000

tcp_rto_max_ms - INTEGER
	Maximal TCP retransmission timeout (in ms).
	Note that TCP_RTO_MAX_MS socket option has higher precedence.

	When changing tcp_rto_max_ms, it is important to understand
	that tcp_retries2 might need a change.

	Possible Values: 1000 - 120,000

	Default: 120,000

UDP variables
=============

+1 −0
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@ struct timer_list icsk_retransmit_timer read_mostly
struct timer_list                   icsk_delack_timer      read_mostly                             inet_csk_reset_xmit_timer,tcp_connect
u32                                 icsk_rto               read_write                              tcp_cwnd_validate,tcp_schedule_loss_probe,tcp_connect_init,tcp_connect,tcp_write_xmit,tcp_push_one
u32                                 icsk_rto_min
u32                                 icsk_rto_max           read_mostly                             tcp_reset_xmit_timer
u32                                 icsk_delack_max
u32                                 icsk_pmtu_cookie       read_write                              tcp_sync_mss,tcp_current_mss,tcp_send_syn_data,tcp_connect_init,tcp_connect
struct tcp_congestion_ops           icsk_ca_ops            read_write                              tcp_cwnd_validate,tcp_tso_segs,tcp_ca_dst_init,tcp_connect_init,tcp_connect,tcp_write_xmit
+1 −0
Original line number Diff line number Diff line
@@ -86,6 +86,7 @@ u8 sysctl_tcp_sack
u8                              sysctl_tcp_window_scaling                                                            tcp_syn_options,tcp_parse_options
u8                              sysctl_tcp_timestamps
u8                              sysctl_tcp_early_retrans                     read_mostly                             tcp_schedule_loss_probe(tcp_write_xmit)
u32                             sysctl_tcp_rto_max_ms
u8                              sysctl_tcp_recovery                                                                  tcp_fastretrans_alert
u8                              sysctl_tcp_thin_linear_timeouts                                                      tcp_retrans_timer(on_thin_streams)
u8                              sysctl_tcp_slow_start_after_idle                                                     unlikely(tcp_cwnd_validate-network-not-starved)
+1 −0
Original line number Diff line number Diff line
@@ -90,6 +90,7 @@ struct inet_connection_sock {
 	struct timer_list	  icsk_delack_timer;
	__u32			  icsk_rto;
	__u32                     icsk_rto_min;
	u32			  icsk_rto_max;
	__u32                     icsk_delack_max;
	__u32			  icsk_pmtu_cookie;
	const struct tcp_congestion_ops *icsk_ca_ops;
+1 −0
Original line number Diff line number Diff line
@@ -181,6 +181,7 @@ struct netns_ipv4 {
	u8 sysctl_tcp_window_scaling;
	u8 sysctl_tcp_timestamps;
	int sysctl_tcp_rto_min_us;
	int sysctl_tcp_rto_max_ms;
	u8 sysctl_tcp_recovery;
	u8 sysctl_tcp_thin_linear_timeouts;
	u8 sysctl_tcp_slow_start_after_idle;
Loading