Commit 424be00c authored by Stephen Hemminger's avatar Stephen Hemminger Committed by David S. Miller

[TCP]: Add sysctl to turn off matrics caching.

parent 719c06b8
...@@ -326,6 +326,7 @@ enum ...@@ -326,6 +326,7 @@ enum
NET_IPV4_IPFRAG_SECRET_INTERVAL=94, NET_IPV4_IPFRAG_SECRET_INTERVAL=94,
NET_TCP_WESTWOOD=95, NET_TCP_WESTWOOD=95,
NET_IPV4_IGMP_MAX_MSF=96, NET_IPV4_IGMP_MAX_MSF=96,
NET_TCP_NO_METRICS_SAVE=97,
}; };
enum { enum {
......
...@@ -583,6 +583,7 @@ extern int sysctl_tcp_tw_reuse; ...@@ -583,6 +583,7 @@ extern int sysctl_tcp_tw_reuse;
extern int sysctl_tcp_frto; extern int sysctl_tcp_frto;
extern int sysctl_tcp_low_latency; extern int sysctl_tcp_low_latency;
extern int sysctl_tcp_westwood; extern int sysctl_tcp_westwood;
extern int sysctl_tcp_nometrics_save;
extern atomic_t tcp_memory_allocated; extern atomic_t tcp_memory_allocated;
extern atomic_t tcp_sockets_allocated; extern atomic_t tcp_sockets_allocated;
......
...@@ -593,6 +593,14 @@ ctl_table ipv4_table[] = { ...@@ -593,6 +593,14 @@ ctl_table ipv4_table[] = {
.proc_handler = &proc_dointvec_jiffies, .proc_handler = &proc_dointvec_jiffies,
.strategy = &sysctl_jiffies .strategy = &sysctl_jiffies
}, },
{
.ctl_name = NET_TCP_NO_METRICS_SAVE,
.procname = "tcp_no_metrics_save",
.data = &sysctl_tcp_nometrics_save,
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = &proc_dointvec,
},
{ {
.ctl_name = NET_TCP_WESTWOOD, .ctl_name = NET_TCP_WESTWOOD,
.procname = "tcp_westwood", .procname = "tcp_westwood",
...@@ -601,6 +609,7 @@ ctl_table ipv4_table[] = { ...@@ -601,6 +609,7 @@ ctl_table ipv4_table[] = {
.mode = 0644, .mode = 0644,
.proc_handler = &proc_dointvec, .proc_handler = &proc_dointvec,
}, },
{ .ctl_name = 0 } { .ctl_name = 0 }
}; };
......
...@@ -87,6 +87,7 @@ int sysctl_tcp_rfc1337; ...@@ -87,6 +87,7 @@ int sysctl_tcp_rfc1337;
int sysctl_tcp_max_orphans = NR_FILE; int sysctl_tcp_max_orphans = NR_FILE;
int sysctl_tcp_frto; int sysctl_tcp_frto;
int sysctl_tcp_westwood; int sysctl_tcp_westwood;
int sysctl_tcp_nometrics_save;
#define FLAG_DATA 0x01 /* Incoming frame contained data. */ #define FLAG_DATA 0x01 /* Incoming frame contained data. */
#define FLAG_WIN_UPDATE 0x02 /* Incoming ACK was a window update. */ #define FLAG_WIN_UPDATE 0x02 /* Incoming ACK was a window update. */
...@@ -518,6 +519,9 @@ void tcp_update_metrics(struct sock *sk) ...@@ -518,6 +519,9 @@ void tcp_update_metrics(struct sock *sk)
struct tcp_opt *tp = tcp_sk(sk); struct tcp_opt *tp = tcp_sk(sk);
struct dst_entry *dst = __sk_dst_get(sk); struct dst_entry *dst = __sk_dst_get(sk);
if (sysctl_tcp_nometrics_save)
return;
dst_confirm(dst); dst_confirm(dst);
if (dst && (dst->flags&DST_HOST)) { if (dst && (dst->flags&DST_HOST)) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment