Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 05cbc0db authored by Fan Du's avatar Fan Du Committed by David S. Miller
Browse files

ipv4: Create probe timer for tcp PMTU as per RFC4821



As per RFC4821 7.3.  Selecting Probe Size, a probe timer should
be armed once probing has converged. Once this timer expired,
probing again to take advantage of any path PMTU change. The
recommended probing interval is 10 minutes per RFC1981. Probing
interval could be sysctled by sysctl_tcp_probe_interval.

Eric Dumazet suggested to implement pseudo timer based on 32bits
jiffies tcp_time_stamp instead of using classic timer for such
rare event.

Signed-off-by: default avatarFan Du <fan.du@intel.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 6b58e0a5
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -126,6 +126,8 @@ struct inet_connection_sock {

		/* Information on the current probe. */
		int		  probe_size;

		u32		  probe_timestamp;
	} icsk_mtup;
	u32			  icsk_ca_priv[16];
	u32			  icsk_user_timeout;
+1 −0
Original line number Diff line number Diff line
@@ -88,6 +88,7 @@ struct netns_ipv4 {
	int sysctl_tcp_mtu_probing;
	int sysctl_tcp_base_mss;
	int sysctl_tcp_probe_threshold;
	u32 sysctl_tcp_probe_interval;

	struct ping_group_range ping_group_range;

+3 −0
Original line number Diff line number Diff line
@@ -67,6 +67,9 @@ void tcp_time_wait(struct sock *sk, int state, int timeo);
/* The least MTU to use for probing */
#define TCP_BASE_MSS		1024

/* probing interval, default to 10 minutes as per RFC4821 */
#define TCP_PROBE_INTERVAL	600

/* Specify interval when tcp mtu probing will stop */
#define TCP_PROBE_THRESHOLD	8

+7 −0
Original line number Diff line number Diff line
@@ -890,6 +890,13 @@ static struct ctl_table ipv4_net_table[] = {
		.mode		= 0644,
		.proc_handler	= proc_dointvec,
	},
	{
		.procname	= "tcp_probe_interval",
		.data		= &init_net.ipv4.sysctl_tcp_probe_interval,
		.maxlen		= sizeof(int),
		.mode		= 0644,
		.proc_handler	= proc_dointvec,
	},
	{ }
};

+1 −0
Original line number Diff line number Diff line
@@ -2461,6 +2461,7 @@ static int __net_init tcp_sk_init(struct net *net)
	net->ipv4.sysctl_tcp_ecn = 2;
	net->ipv4.sysctl_tcp_base_mss = TCP_BASE_MSS;
	net->ipv4.sysctl_tcp_probe_threshold = TCP_PROBE_THRESHOLD;
	net->ipv4.sysctl_tcp_probe_interval = TCP_PROBE_INTERVAL;
	return 0;

fail:
Loading