Commit 9874b620 authored by David S. Miller's avatar David S. Miller

Merge branch 'sysctl-less-storage'

Eric Dumazet says:

====================
net: use less storage for most sysctl

This patch series adds a new sysctl type, to allow using u8 instead of
"int" or "long int" types.

Then we convert mosts sysctls found in struct netns_ipv4
to shrink it by three cache lines.
====================
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents d54e1348 4ecc1baf
...@@ -1108,6 +1108,11 @@ static int sysctl_check_table_array(const char *path, struct ctl_table *table) ...@@ -1108,6 +1108,11 @@ static int sysctl_check_table_array(const char *path, struct ctl_table *table)
err |= sysctl_err(path, table, "array not allowed"); err |= sysctl_err(path, table, "array not allowed");
} }
if (table->proc_handler == proc_dou8vec_minmax) {
if (table->maxlen != sizeof(u8))
err |= sysctl_err(path, table, "array not allowed");
}
return err; return err;
} }
...@@ -1123,6 +1128,7 @@ static int sysctl_check_table(const char *path, struct ctl_table *table) ...@@ -1123,6 +1128,7 @@ static int sysctl_check_table(const char *path, struct ctl_table *table)
(table->proc_handler == proc_douintvec) || (table->proc_handler == proc_douintvec) ||
(table->proc_handler == proc_douintvec_minmax) || (table->proc_handler == proc_douintvec_minmax) ||
(table->proc_handler == proc_dointvec_minmax) || (table->proc_handler == proc_dointvec_minmax) ||
(table->proc_handler == proc_dou8vec_minmax) ||
(table->proc_handler == proc_dointvec_jiffies) || (table->proc_handler == proc_dointvec_jiffies) ||
(table->proc_handler == proc_dointvec_userhz_jiffies) || (table->proc_handler == proc_dointvec_userhz_jiffies) ||
(table->proc_handler == proc_dointvec_ms_jiffies) || (table->proc_handler == proc_dointvec_ms_jiffies) ||
......
...@@ -53,6 +53,8 @@ int proc_douintvec(struct ctl_table *, int, void *, size_t *, loff_t *); ...@@ -53,6 +53,8 @@ int proc_douintvec(struct ctl_table *, int, void *, size_t *, loff_t *);
int proc_dointvec_minmax(struct ctl_table *, int, void *, size_t *, loff_t *); int proc_dointvec_minmax(struct ctl_table *, int, void *, size_t *, loff_t *);
int proc_douintvec_minmax(struct ctl_table *table, int write, void *buffer, int proc_douintvec_minmax(struct ctl_table *table, int write, void *buffer,
size_t *lenp, loff_t *ppos); size_t *lenp, loff_t *ppos);
int proc_dou8vec_minmax(struct ctl_table *table, int write, void *buffer,
size_t *lenp, loff_t *ppos);
int proc_dointvec_jiffies(struct ctl_table *, int, void *, size_t *, loff_t *); int proc_dointvec_jiffies(struct ctl_table *, int, void *, size_t *, loff_t *);
int proc_dointvec_userhz_jiffies(struct ctl_table *, int, void *, size_t *, int proc_dointvec_userhz_jiffies(struct ctl_table *, int, void *, size_t *,
loff_t *); loff_t *);
......
...@@ -83,41 +83,41 @@ struct netns_ipv4 { ...@@ -83,41 +83,41 @@ struct netns_ipv4 {
struct xt_table *nat_table; struct xt_table *nat_table;
#endif #endif
int sysctl_icmp_echo_ignore_all; u8 sysctl_icmp_echo_ignore_all;
int sysctl_icmp_echo_ignore_broadcasts; u8 sysctl_icmp_echo_ignore_broadcasts;
int sysctl_icmp_ignore_bogus_error_responses; u8 sysctl_icmp_ignore_bogus_error_responses;
u8 sysctl_icmp_errors_use_inbound_ifaddr;
int sysctl_icmp_ratelimit; int sysctl_icmp_ratelimit;
int sysctl_icmp_ratemask; int sysctl_icmp_ratemask;
int sysctl_icmp_errors_use_inbound_ifaddr;
struct local_ports ip_local_ports; struct local_ports ip_local_ports;
int sysctl_tcp_ecn; u8 sysctl_tcp_ecn;
int sysctl_tcp_ecn_fallback; u8 sysctl_tcp_ecn_fallback;
int sysctl_ip_default_ttl; u8 sysctl_ip_default_ttl;
int sysctl_ip_no_pmtu_disc; u8 sysctl_ip_no_pmtu_disc;
int sysctl_ip_fwd_use_pmtu; u8 sysctl_ip_fwd_use_pmtu;
int sysctl_ip_fwd_update_priority; u8 sysctl_ip_fwd_update_priority;
int sysctl_ip_nonlocal_bind; u8 sysctl_ip_nonlocal_bind;
int sysctl_ip_autobind_reuse; u8 sysctl_ip_autobind_reuse;
/* Shall we try to damage output packets if routing dev changes? */ /* Shall we try to damage output packets if routing dev changes? */
int sysctl_ip_dynaddr; u8 sysctl_ip_dynaddr;
int sysctl_ip_early_demux; u8 sysctl_ip_early_demux;
#ifdef CONFIG_NET_L3_MASTER_DEV #ifdef CONFIG_NET_L3_MASTER_DEV
int sysctl_raw_l3mdev_accept; u8 sysctl_raw_l3mdev_accept;
#endif #endif
int sysctl_tcp_early_demux; u8 sysctl_tcp_early_demux;
int sysctl_udp_early_demux; u8 sysctl_udp_early_demux;
int sysctl_nexthop_compat_mode; u8 sysctl_nexthop_compat_mode;
int sysctl_fwmark_reflect; u8 sysctl_fwmark_reflect;
int sysctl_tcp_fwmark_accept; u8 sysctl_tcp_fwmark_accept;
#ifdef CONFIG_NET_L3_MASTER_DEV #ifdef CONFIG_NET_L3_MASTER_DEV
int sysctl_tcp_l3mdev_accept; u8 sysctl_tcp_l3mdev_accept;
#endif #endif
int sysctl_tcp_mtu_probing; u8 sysctl_tcp_mtu_probing;
int sysctl_tcp_mtu_probe_floor; int sysctl_tcp_mtu_probe_floor;
int sysctl_tcp_base_mss; int sysctl_tcp_base_mss;
int sysctl_tcp_min_snd_mss; int sysctl_tcp_min_snd_mss;
...@@ -125,46 +125,47 @@ struct netns_ipv4 { ...@@ -125,46 +125,47 @@ struct netns_ipv4 {
u32 sysctl_tcp_probe_interval; u32 sysctl_tcp_probe_interval;
int sysctl_tcp_keepalive_time; int sysctl_tcp_keepalive_time;
int sysctl_tcp_keepalive_probes;
int sysctl_tcp_keepalive_intvl; int sysctl_tcp_keepalive_intvl;
u8 sysctl_tcp_keepalive_probes;
int sysctl_tcp_syn_retries; u8 sysctl_tcp_syn_retries;
int sysctl_tcp_synack_retries; u8 sysctl_tcp_synack_retries;
int sysctl_tcp_syncookies; u8 sysctl_tcp_syncookies;
int sysctl_tcp_reordering; int sysctl_tcp_reordering;
int sysctl_tcp_retries1; u8 sysctl_tcp_retries1;
int sysctl_tcp_retries2; u8 sysctl_tcp_retries2;
int sysctl_tcp_orphan_retries; u8 sysctl_tcp_orphan_retries;
u8 sysctl_tcp_tw_reuse;
int sysctl_tcp_fin_timeout; int sysctl_tcp_fin_timeout;
unsigned int sysctl_tcp_notsent_lowat; unsigned int sysctl_tcp_notsent_lowat;
int sysctl_tcp_tw_reuse; u8 sysctl_tcp_sack;
int sysctl_tcp_sack; u8 sysctl_tcp_window_scaling;
int sysctl_tcp_window_scaling; u8 sysctl_tcp_timestamps;
int sysctl_tcp_timestamps; u8 sysctl_tcp_early_retrans;
int sysctl_tcp_early_retrans; u8 sysctl_tcp_recovery;
int sysctl_tcp_recovery; u8 sysctl_tcp_thin_linear_timeouts;
int sysctl_tcp_thin_linear_timeouts; u8 sysctl_tcp_slow_start_after_idle;
int sysctl_tcp_slow_start_after_idle; u8 sysctl_tcp_retrans_collapse;
int sysctl_tcp_retrans_collapse; u8 sysctl_tcp_stdurg;
int sysctl_tcp_stdurg; u8 sysctl_tcp_rfc1337;
int sysctl_tcp_rfc1337; u8 sysctl_tcp_abort_on_overflow;
int sysctl_tcp_abort_on_overflow; u8 sysctl_tcp_fack; /* obsolete */
int sysctl_tcp_fack;
int sysctl_tcp_max_reordering; int sysctl_tcp_max_reordering;
int sysctl_tcp_dsack;
int sysctl_tcp_app_win;
int sysctl_tcp_adv_win_scale; int sysctl_tcp_adv_win_scale;
int sysctl_tcp_frto; u8 sysctl_tcp_dsack;
int sysctl_tcp_nometrics_save; u8 sysctl_tcp_app_win;
int sysctl_tcp_no_ssthresh_metrics_save; u8 sysctl_tcp_frto;
int sysctl_tcp_moderate_rcvbuf; u8 sysctl_tcp_nometrics_save;
int sysctl_tcp_tso_win_divisor; u8 sysctl_tcp_no_ssthresh_metrics_save;
int sysctl_tcp_workaround_signed_windows; u8 sysctl_tcp_moderate_rcvbuf;
u8 sysctl_tcp_tso_win_divisor;
u8 sysctl_tcp_workaround_signed_windows;
int sysctl_tcp_limit_output_bytes; int sysctl_tcp_limit_output_bytes;
int sysctl_tcp_challenge_ack_limit; int sysctl_tcp_challenge_ack_limit;
int sysctl_tcp_min_tso_segs;
int sysctl_tcp_min_rtt_wlen; int sysctl_tcp_min_rtt_wlen;
int sysctl_tcp_autocorking; u8 sysctl_tcp_min_tso_segs;
u8 sysctl_tcp_autocorking;
u8 sysctl_tcp_reflect_tos;
int sysctl_tcp_invalid_ratelimit; int sysctl_tcp_invalid_ratelimit;
int sysctl_tcp_pacing_ss_ratio; int sysctl_tcp_pacing_ss_ratio;
int sysctl_tcp_pacing_ca_ratio; int sysctl_tcp_pacing_ca_ratio;
...@@ -182,7 +183,6 @@ struct netns_ipv4 { ...@@ -182,7 +183,6 @@ struct netns_ipv4 {
unsigned int sysctl_tcp_fastopen_blackhole_timeout; unsigned int sysctl_tcp_fastopen_blackhole_timeout;
atomic_t tfo_active_disable_times; atomic_t tfo_active_disable_times;
unsigned long tfo_active_disable_stamp; unsigned long tfo_active_disable_stamp;
int sysctl_tcp_reflect_tos;
int sysctl_udp_wmem_min; int sysctl_udp_wmem_min;
int sysctl_udp_rmem_min; int sysctl_udp_rmem_min;
......
...@@ -1034,6 +1034,65 @@ int proc_douintvec_minmax(struct ctl_table *table, int write, ...@@ -1034,6 +1034,65 @@ int proc_douintvec_minmax(struct ctl_table *table, int write,
do_proc_douintvec_minmax_conv, &param); do_proc_douintvec_minmax_conv, &param);
} }
/**
* proc_dou8vec_minmax - read a vector of unsigned chars with min/max values
* @table: the sysctl table
* @write: %TRUE if this is a write to the sysctl file
* @buffer: the user buffer
* @lenp: the size of the user buffer
* @ppos: file position
*
* Reads/writes up to table->maxlen/sizeof(u8) unsigned chars
* values from/to the user buffer, treated as an ASCII string. Negative
* strings are not allowed.
*
* This routine will ensure the values are within the range specified by
* table->extra1 (min) and table->extra2 (max).
*
* Returns 0 on success or an error on write when the range check fails.
*/
int proc_dou8vec_minmax(struct ctl_table *table, int write,
void *buffer, size_t *lenp, loff_t *ppos)
{
struct ctl_table tmp;
unsigned int min = 0, max = 255U, val;
u8 *data = table->data;
struct do_proc_douintvec_minmax_conv_param param = {
.min = &min,
.max = &max,
};
int res;
/* Do not support arrays yet. */
if (table->maxlen != sizeof(u8))
return -EINVAL;
if (table->extra1) {
min = *(unsigned int *) table->extra1;
if (min > 255U)
return -EINVAL;
}
if (table->extra2) {
max = *(unsigned int *) table->extra2;
if (max > 255U)
return -EINVAL;
}
tmp = *table;
tmp.maxlen = sizeof(val);
tmp.data = &val;
val = *data;
res = do_proc_douintvec(&tmp, write, buffer, lenp, ppos,
do_proc_douintvec_minmax_conv, &param);
if (res)
return res;
if (write)
*data = val;
return 0;
}
EXPORT_SYMBOL_GPL(proc_dou8vec_minmax);
static int do_proc_dopipe_max_size_conv(unsigned long *lvalp, static int do_proc_dopipe_max_size_conv(unsigned long *lvalp,
unsigned int *valp, unsigned int *valp,
int write, void *data) int write, void *data)
...@@ -1582,6 +1641,12 @@ int proc_douintvec_minmax(struct ctl_table *table, int write, ...@@ -1582,6 +1641,12 @@ int proc_douintvec_minmax(struct ctl_table *table, int write,
return -ENOSYS; return -ENOSYS;
} }
int proc_dou8vec_minmax(struct ctl_table *table, int write,
void *buffer, size_t *lenp, loff_t *ppos)
{
return -ENOSYS;
}
int proc_dointvec_jiffies(struct ctl_table *table, int write, int proc_dointvec_jiffies(struct ctl_table *table, int write,
void *buffer, size_t *lenp, loff_t *ppos) void *buffer, size_t *lenp, loff_t *ppos)
{ {
......
...@@ -209,7 +209,7 @@ static int ipv4_fwd_update_priority(struct ctl_table *table, int write, ...@@ -209,7 +209,7 @@ static int ipv4_fwd_update_priority(struct ctl_table *table, int write,
net = container_of(table->data, struct net, net = container_of(table->data, struct net,
ipv4.sysctl_ip_fwd_update_priority); ipv4.sysctl_ip_fwd_update_priority);
ret = proc_dointvec_minmax(table, write, buffer, lenp, ppos); ret = proc_dou8vec_minmax(table, write, buffer, lenp, ppos);
if (write && ret == 0) if (write && ret == 0)
call_netevent_notifiers(NETEVENT_IPV4_FWD_UPDATE_PRIORITY_UPDATE, call_netevent_notifiers(NETEVENT_IPV4_FWD_UPDATE_PRIORITY_UPDATE,
net); net);
...@@ -389,7 +389,7 @@ static int proc_tcp_early_demux(struct ctl_table *table, int write, ...@@ -389,7 +389,7 @@ static int proc_tcp_early_demux(struct ctl_table *table, int write,
{ {
int ret = 0; int ret = 0;
ret = proc_dointvec(table, write, buffer, lenp, ppos); ret = proc_dou8vec_minmax(table, write, buffer, lenp, ppos);
if (write && !ret) { if (write && !ret) {
int enabled = init_net.ipv4.sysctl_tcp_early_demux; int enabled = init_net.ipv4.sysctl_tcp_early_demux;
...@@ -405,7 +405,7 @@ static int proc_udp_early_demux(struct ctl_table *table, int write, ...@@ -405,7 +405,7 @@ static int proc_udp_early_demux(struct ctl_table *table, int write,
{ {
int ret = 0; int ret = 0;
ret = proc_dointvec(table, write, buffer, lenp, ppos); ret = proc_dou8vec_minmax(table, write, buffer, lenp, ppos);
if (write && !ret) { if (write && !ret) {
int enabled = init_net.ipv4.sysctl_udp_early_demux; int enabled = init_net.ipv4.sysctl_udp_early_demux;
...@@ -595,30 +595,30 @@ static struct ctl_table ipv4_net_table[] = { ...@@ -595,30 +595,30 @@ static struct ctl_table ipv4_net_table[] = {
{ {
.procname = "icmp_echo_ignore_all", .procname = "icmp_echo_ignore_all",
.data = &init_net.ipv4.sysctl_icmp_echo_ignore_all, .data = &init_net.ipv4.sysctl_icmp_echo_ignore_all,
.maxlen = sizeof(int), .maxlen = sizeof(u8),
.mode = 0644, .mode = 0644,
.proc_handler = proc_dointvec .proc_handler = proc_dou8vec_minmax,
}, },
{ {
.procname = "icmp_echo_ignore_broadcasts", .procname = "icmp_echo_ignore_broadcasts",
.data = &init_net.ipv4.sysctl_icmp_echo_ignore_broadcasts, .data = &init_net.ipv4.sysctl_icmp_echo_ignore_broadcasts,
.maxlen = sizeof(int), .maxlen = sizeof(u8),
.mode = 0644, .mode = 0644,
.proc_handler = proc_dointvec .proc_handler = proc_dou8vec_minmax,
}, },
{ {
.procname = "icmp_ignore_bogus_error_responses", .procname = "icmp_ignore_bogus_error_responses",
.data = &init_net.ipv4.sysctl_icmp_ignore_bogus_error_responses, .data = &init_net.ipv4.sysctl_icmp_ignore_bogus_error_responses,
.maxlen = sizeof(int), .maxlen = sizeof(u8),
.mode = 0644, .mode = 0644,
.proc_handler = proc_dointvec .proc_handler = proc_dou8vec_minmax,
}, },
{ {
.procname = "icmp_errors_use_inbound_ifaddr", .procname = "icmp_errors_use_inbound_ifaddr",
.data = &init_net.ipv4.sysctl_icmp_errors_use_inbound_ifaddr, .data = &init_net.ipv4.sysctl_icmp_errors_use_inbound_ifaddr,
.maxlen = sizeof(int), .maxlen = sizeof(u8),
.mode = 0644, .mode = 0644,
.proc_handler = proc_dointvec .proc_handler = proc_dou8vec_minmax,
}, },
{ {
.procname = "icmp_ratelimit", .procname = "icmp_ratelimit",
...@@ -645,9 +645,9 @@ static struct ctl_table ipv4_net_table[] = { ...@@ -645,9 +645,9 @@ static struct ctl_table ipv4_net_table[] = {
{ {
.procname = "raw_l3mdev_accept", .procname = "raw_l3mdev_accept",
.data = &init_net.ipv4.sysctl_raw_l3mdev_accept, .data = &init_net.ipv4.sysctl_raw_l3mdev_accept,
.maxlen = sizeof(int), .maxlen = sizeof(u8),
.mode = 0644, .mode = 0644,
.proc_handler = proc_dointvec_minmax, .proc_handler = proc_dou8vec_minmax,
.extra1 = SYSCTL_ZERO, .extra1 = SYSCTL_ZERO,
.extra2 = SYSCTL_ONE, .extra2 = SYSCTL_ONE,
}, },
...@@ -655,60 +655,60 @@ static struct ctl_table ipv4_net_table[] = { ...@@ -655,60 +655,60 @@ static struct ctl_table ipv4_net_table[] = {
{ {
.procname = "tcp_ecn", .procname = "tcp_ecn",
.data = &init_net.ipv4.sysctl_tcp_ecn, .data = &init_net.ipv4.sysctl_tcp_ecn,
.maxlen = sizeof(int), .maxlen = sizeof(u8),
.mode = 0644, .mode = 0644,
.proc_handler = proc_dointvec .proc_handler = proc_dou8vec_minmax,
}, },
{ {
.procname = "tcp_ecn_fallback", .procname = "tcp_ecn_fallback",
.data = &init_net.ipv4.sysctl_tcp_ecn_fallback, .data = &init_net.ipv4.sysctl_tcp_ecn_fallback,
.maxlen = sizeof(int), .maxlen = sizeof(u8),
.mode = 0644, .mode = 0644,
.proc_handler = proc_dointvec .proc_handler = proc_dou8vec_minmax,
}, },
{ {
.procname = "ip_dynaddr", .procname = "ip_dynaddr",
.data = &init_net.ipv4.sysctl_ip_dynaddr, .data = &init_net.ipv4.sysctl_ip_dynaddr,
.maxlen = sizeof(int), .maxlen = sizeof(u8),
.mode = 0644, .mode = 0644,
.proc_handler = proc_dointvec .proc_handler = proc_dou8vec_minmax,
}, },
{ {
.procname = "ip_early_demux", .procname = "ip_early_demux",
.data = &init_net.ipv4.sysctl_ip_early_demux, .data = &init_net.ipv4.sysctl_ip_early_demux,
.maxlen = sizeof(int), .maxlen = sizeof(u8),
.mode = 0644, .mode = 0644,
.proc_handler = proc_dointvec .proc_handler = proc_dou8vec_minmax,
}, },
{ {
.procname = "udp_early_demux", .procname = "udp_early_demux",
.data = &init_net.ipv4.sysctl_udp_early_demux, .data = &init_net.ipv4.sysctl_udp_early_demux,
.maxlen = sizeof(int), .maxlen = sizeof(u8),
.mode = 0644, .mode = 0644,
.proc_handler = proc_udp_early_demux .proc_handler = proc_udp_early_demux
}, },
{ {
.procname = "tcp_early_demux", .procname = "tcp_early_demux",
.data = &init_net.ipv4.sysctl_tcp_early_demux, .data = &init_net.ipv4.sysctl_tcp_early_demux,
.maxlen = sizeof(int), .maxlen = sizeof(u8),
.mode = 0644, .mode = 0644,
.proc_handler = proc_tcp_early_demux .proc_handler = proc_tcp_early_demux
}, },
{ {
.procname = "nexthop_compat_mode", .procname = "nexthop_compat_mode",
.data = &init_net.ipv4.sysctl_nexthop_compat_mode, .data = &init_net.ipv4.sysctl_nexthop_compat_mode,
.maxlen = sizeof(int), .maxlen = sizeof(u8),
.mode = 0644, .mode = 0644,
.proc_handler = proc_dointvec_minmax, .proc_handler = proc_dou8vec_minmax,
.extra1 = SYSCTL_ZERO, .extra1 = SYSCTL_ZERO,
.extra2 = SYSCTL_ONE, .extra2 = SYSCTL_ONE,
}, },
{ {
.procname = "ip_default_ttl", .procname = "ip_default_ttl",
.data = &init_net.ipv4.sysctl_ip_default_ttl, .data = &init_net.ipv4.sysctl_ip_default_ttl,
.maxlen = sizeof(int), .maxlen = sizeof(u8),
.mode = 0644, .mode = 0644,
.proc_handler = proc_dointvec_minmax, .proc_handler = proc_dou8vec_minmax,
.extra1 = &ip_ttl_min, .extra1 = &ip_ttl_min,
.extra2 = &ip_ttl_max, .extra2 = &ip_ttl_max,
}, },
...@@ -729,21 +729,21 @@ static struct ctl_table ipv4_net_table[] = { ...@@ -729,21 +729,21 @@ static struct ctl_table ipv4_net_table[] = {
{ {
.procname = "ip_no_pmtu_disc", .procname = "ip_no_pmtu_disc",
.data = &init_net.ipv4.sysctl_ip_no_pmtu_disc, .data = &init_net.ipv4.sysctl_ip_no_pmtu_disc,
.maxlen = sizeof(int), .maxlen = sizeof(u8),
.mode = 0644, .mode = 0644,
.proc_handler = proc_dointvec .proc_handler = proc_dou8vec_minmax,
}, },
{ {
.procname = "ip_forward_use_pmtu", .procname = "ip_forward_use_pmtu",
.data = &init_net.ipv4.sysctl_ip_fwd_use_pmtu, .data = &init_net.ipv4.sysctl_ip_fwd_use_pmtu,
.maxlen = sizeof(int), .maxlen = sizeof(u8),
.mode = 0644, .mode = 0644,
.proc_handler = proc_dointvec, .proc_handler = proc_dou8vec_minmax,
}, },
{ {
.procname = "ip_forward_update_priority", .procname = "ip_forward_update_priority",
.data = &init_net.ipv4.sysctl_ip_fwd_update_priority, .data = &init_net.ipv4.sysctl_ip_fwd_update_priority,
.maxlen = sizeof(int), .maxlen = sizeof(u8),
.mode = 0644, .mode = 0644,
.proc_handler = ipv4_fwd_update_priority, .proc_handler = ipv4_fwd_update_priority,
.extra1 = SYSCTL_ZERO, .extra1 = SYSCTL_ZERO,
...@@ -752,40 +752,40 @@ static struct ctl_table ipv4_net_table[] = { ...@@ -752,40 +752,40 @@ static struct ctl_table ipv4_net_table[] = {
{ {
.procname = "ip_nonlocal_bind", .procname = "ip_nonlocal_bind",
.data = &init_net.ipv4.sysctl_ip_nonlocal_bind, .data = &init_net.ipv4.sysctl_ip_nonlocal_bind,
.maxlen = sizeof(int), .maxlen = sizeof(u8),
.mode = 0644, .mode = 0644,
.proc_handler = proc_dointvec .proc_handler = proc_dou8vec_minmax,
}, },
{ {
.procname = "ip_autobind_reuse", .procname = "ip_autobind_reuse",
.data = &init_net.ipv4.sysctl_ip_autobind_reuse, .data = &init_net.ipv4.sysctl_ip_autobind_reuse,
.maxlen = sizeof(int), .maxlen = sizeof(u8),
.mode = 0644, .mode = 0644,
.proc_handler = proc_dointvec_minmax, .proc_handler = proc_dou8vec_minmax,
.extra1 = SYSCTL_ZERO, .extra1 = SYSCTL_ZERO,
.extra2 = SYSCTL_ONE, .extra2 = SYSCTL_ONE,
}, },
{ {
.procname = "fwmark_reflect", .procname = "fwmark_reflect",
.data = &init_net.ipv4.sysctl_fwmark_reflect, .data = &init_net.ipv4.sysctl_fwmark_reflect,
.maxlen = sizeof(int), .maxlen = sizeof(u8),
.mode = 0644, .mode = 0644,
.proc_handler = proc_dointvec, .proc_handler = proc_dou8vec_minmax,
}, },
{ {
.procname = "tcp_fwmark_accept", .procname = "tcp_fwmark_accept",
.data = &init_net.ipv4.sysctl_tcp_fwmark_accept, .data = &init_net.ipv4.sysctl_tcp_fwmark_accept,
.maxlen = sizeof(int), .maxlen = sizeof(u8),
.mode = 0644, .mode = 0644,
.proc_handler = proc_dointvec, .proc_handler = proc_dou8vec_minmax,
}, },
#ifdef CONFIG_NET_L3_MASTER_DEV #ifdef CONFIG_NET_L3_MASTER_DEV
{ {
.procname = "tcp_l3mdev_accept", .procname = "tcp_l3mdev_accept",
.data = &init_net.ipv4.sysctl_tcp_l3mdev_accept, .data = &init_net.ipv4.sysctl_tcp_l3mdev_accept,
.maxlen = sizeof(int), .maxlen = sizeof(u8),
.mode = 0644, .mode = 0644,
.proc_handler = proc_dointvec_minmax, .proc_handler = proc_dou8vec_minmax,
.extra1 = SYSCTL_ZERO, .extra1 = SYSCTL_ZERO,
.extra2 = SYSCTL_ONE, .extra2 = SYSCTL_ONE,
}, },
...@@ -793,9 +793,9 @@ static struct ctl_table ipv4_net_table[] = { ...@@ -793,9 +793,9 @@ static struct ctl_table ipv4_net_table[] = {
{ {
.procname = "tcp_mtu_probing", .procname = "tcp_mtu_probing",
.data = &init_net.ipv4.sysctl_tcp_mtu_probing, .data = &init_net.ipv4.sysctl_tcp_mtu_probing,
.maxlen = sizeof(int), .maxlen = sizeof(u8),
.mode = 0644, .mode = 0644,
.proc_handler = proc_dointvec, .proc_handler = proc_dou8vec_minmax,
}, },
{ {
.procname = "tcp_base_mss", .procname = "tcp_base_mss",
...@@ -897,9 +897,9 @@ static struct ctl_table ipv4_net_table[] = { ...@@ -897,9 +897,9 @@ static struct ctl_table ipv4_net_table[] = {
{ {
.procname = "tcp_keepalive_probes", .procname = "tcp_keepalive_probes",
.data = &init_net.ipv4.sysctl_tcp_keepalive_probes, .data = &init_net.ipv4.sysctl_tcp_keepalive_probes,
.maxlen = sizeof(int), .maxlen = sizeof(u8),
.mode = 0644, .mode = 0644,
.proc_handler = proc_dointvec .proc_handler = proc_dou8vec_minmax,
}, },
{ {
.procname = "tcp_keepalive_intvl", .procname = "tcp_keepalive_intvl",
...@@ -911,26 +911,26 @@ static struct ctl_table ipv4_net_table[] = { ...@@ -911,26 +911,26 @@ static struct ctl_table ipv4_net_table[] = {
{ {
.procname = "tcp_syn_retries", .procname = "tcp_syn_retries",
.data = &init_net.ipv4.sysctl_tcp_syn_retries, .data = &init_net.ipv4.sysctl_tcp_syn_retries,
.maxlen = sizeof(int), .maxlen = sizeof(u8),
.mode = 0644, .mode = 0644,
.proc_handler = proc_dointvec_minmax, .proc_handler = proc_dou8vec_minmax,
.extra1 = &tcp_syn_retries_min, .extra1 = &tcp_syn_retries_min,
.extra2 = &tcp_syn_retries_max .extra2 = &tcp_syn_retries_max
}, },
{ {
.procname = "tcp_synack_retries", .procname = "tcp_synack_retries",
.data = &init_net.ipv4.sysctl_tcp_synack_retries, .data = &init_net.ipv4.sysctl_tcp_synack_retries,
.maxlen = sizeof(int), .maxlen = sizeof(u8),
.mode = 0644, .mode = 0644,
.proc_handler = proc_dointvec .proc_handler = proc_dou8vec_minmax,
}, },
#ifdef CONFIG_SYN_COOKIES #ifdef CONFIG_SYN_COOKIES
{ {
.procname = "tcp_syncookies", .procname = "tcp_syncookies",
.data = &init_net.ipv4.sysctl_tcp_syncookies, .data = &init_net.ipv4.sysctl_tcp_syncookies,
.maxlen = sizeof(int), .maxlen = sizeof(u8),
.mode = 0644, .mode = 0644,
.proc_handler = proc_dointvec .proc_handler = proc_dou8vec_minmax,
}, },
#endif #endif
{ {
...@@ -943,24 +943,24 @@ static struct ctl_table ipv4_net_table[] = { ...@@ -943,24 +943,24 @@ static struct ctl_table ipv4_net_table[] = {
{ {
.procname = "tcp_retries1", .procname = "tcp_retries1",
.data = &init_net.ipv4.sysctl_tcp_retries1, .data = &init_net.ipv4.sysctl_tcp_retries1,
.maxlen = sizeof(int), .maxlen = sizeof(u8),
.mode = 0644, .mode = 0644,
.proc_handler = proc_dointvec_minmax, .proc_handler = proc_dou8vec_minmax,
.extra2 = &tcp_retr1_max .extra2 = &tcp_retr1_max
}, },
{ {
.procname = "tcp_retries2", .procname = "tcp_retries2",
.data = &init_net.ipv4.sysctl_tcp_retries2, .data = &init_net.ipv4.sysctl_tcp_retries2,
.maxlen = sizeof(int), .maxlen = sizeof(u8),
.mode = 0644, .mode = 0644,
.proc_handler = proc_dointvec .proc_handler = proc_dou8vec_minmax,
}, },
{ {
.procname = "tcp_orphan_retries", .procname = "tcp_orphan_retries",
.data = &init_net.ipv4.sysctl_tcp_orphan_retries, .data = &init_net.ipv4.sysctl_tcp_orphan_retries,
.maxlen = sizeof(int), .maxlen = sizeof(u8),
.mode = 0644, .mode = 0644,
.proc_handler = proc_dointvec .proc_handler = proc_dou8vec_minmax,
}, },
{ {
.procname = "tcp_fin_timeout", .procname = "tcp_fin_timeout",
...@@ -979,9 +979,9 @@ static struct ctl_table ipv4_net_table[] = { ...@@ -979,9 +979,9 @@ static struct ctl_table ipv4_net_table[] = {
{ {
.procname = "tcp_tw_reuse", .procname = "tcp_tw_reuse",
.data = &init_net.ipv4.sysctl_tcp_tw_reuse, .data = &init_net.ipv4.sysctl_tcp_tw_reuse,
.maxlen = sizeof(int), .maxlen = sizeof(u8),
.mode = 0644, .mode = 0644,
.proc_handler = proc_dointvec_minmax, .proc_handler = proc_dou8vec_minmax,
.extra1 = SYSCTL_ZERO, .extra1 = SYSCTL_ZERO,
.extra2 = &two, .extra2 = &two,
}, },
...@@ -1067,88 +1067,88 @@ static struct ctl_table ipv4_net_table[] = { ...@@ -1067,88 +1067,88 @@ static struct ctl_table ipv4_net_table[] = {
{ {
.procname = "tcp_sack", .procname = "tcp_sack",
.data = &init_net.ipv4.sysctl_tcp_sack, .data = &init_net.ipv4.sysctl_tcp_sack,
.maxlen = sizeof(int), .maxlen = sizeof(u8),
.mode = 0644, .mode = 0644,
.proc_handler = proc_dointvec .proc_handler = proc_dou8vec_minmax,
}, },
{ {
.procname = "tcp_window_scaling", .procname = "tcp_window_scaling",
.data = &init_net.ipv4.sysctl_tcp_window_scaling, .data = &init_net.ipv4.sysctl_tcp_window_scaling,
.maxlen = sizeof(int), .maxlen = sizeof(u8),
.mode = 0644, .mode = 0644,
.proc_handler = proc_dointvec .proc_handler = proc_dou8vec_minmax,
}, },
{ {
.procname = "tcp_timestamps", .procname = "tcp_timestamps",
.data = &init_net.ipv4.sysctl_tcp_timestamps, .data = &init_net.ipv4.sysctl_tcp_timestamps,
.maxlen = sizeof(int), .maxlen = sizeof(u8),
.mode = 0644, .mode = 0644,
.proc_handler = proc_dointvec .proc_handler = proc_dou8vec_minmax,
}, },
{ {
.procname = "tcp_early_retrans", .procname = "tcp_early_retrans",
.data = &init_net.ipv4.sysctl_tcp_early_retrans, .data = &init_net.ipv4.sysctl_tcp_early_retrans,
.maxlen = sizeof(int), .maxlen = sizeof(u8),
.mode = 0644, .mode = 0644,
.proc_handler = proc_dointvec_minmax, .proc_handler = proc_dou8vec_minmax,
.extra1 = SYSCTL_ZERO, .extra1 = SYSCTL_ZERO,
.extra2 = &four, .extra2 = &four,
}, },
{ {
.procname = "tcp_recovery", .procname = "tcp_recovery",
.data = &init_net.ipv4.sysctl_tcp_recovery, .data = &init_net.ipv4.sysctl_tcp_recovery,
.maxlen = sizeof(int), .maxlen = sizeof(u8),
.mode = 0644, .mode = 0644,
.proc_handler = proc_dointvec, .proc_handler = proc_dou8vec_minmax,
}, },
{ {
.procname = "tcp_thin_linear_timeouts", .procname = "tcp_thin_linear_timeouts",
.data = &init_net.ipv4.sysctl_tcp_thin_linear_timeouts, .data = &init_net.ipv4.sysctl_tcp_thin_linear_timeouts,
.maxlen = sizeof(int), .maxlen = sizeof(u8),
.mode = 0644, .mode = 0644,
.proc_handler = proc_dointvec .proc_handler = proc_dou8vec_minmax,
}, },
{ {
.procname = "tcp_slow_start_after_idle", .procname = "tcp_slow_start_after_idle",
.data = &init_net.ipv4.sysctl_tcp_slow_start_after_idle, .data = &init_net.ipv4.sysctl_tcp_slow_start_after_idle,
.maxlen = sizeof(int), .maxlen = sizeof(u8),
.mode = 0644, .mode = 0644,
.proc_handler = proc_dointvec .proc_handler = proc_dou8vec_minmax,
}, },
{ {
.procname = "tcp_retrans_collapse", .procname = "tcp_retrans_collapse",
.data = &init_net.ipv4.sysctl_tcp_retrans_collapse, .data = &init_net.ipv4.sysctl_tcp_retrans_collapse,
.maxlen = sizeof(int), .maxlen = sizeof(u8),
.mode = 0644, .mode = 0644,
.proc_handler = proc_dointvec .proc_handler = proc_dou8vec_minmax,
}, },
{ {
.procname = "tcp_stdurg", .procname = "tcp_stdurg",
.data = &init_net.ipv4.sysctl_tcp_stdurg, .data = &init_net.ipv4.sysctl_tcp_stdurg,
.maxlen = sizeof(int), .maxlen = sizeof(u8),
.mode = 0644, .mode = 0644,
.proc_handler = proc_dointvec .proc_handler = proc_dou8vec_minmax,
}, },
{ {
.procname = "tcp_rfc1337", .procname = "tcp_rfc1337",
.data = &init_net.ipv4.sysctl_tcp_rfc1337, .data = &init_net.ipv4.sysctl_tcp_rfc1337,
.maxlen = sizeof(int), .maxlen = sizeof(u8),
.mode = 0644, .mode = 0644,
.proc_handler = proc_dointvec .proc_handler = proc_dou8vec_minmax,
}, },
{ {
.procname = "tcp_abort_on_overflow", .procname = "tcp_abort_on_overflow",
.data = &init_net.ipv4.sysctl_tcp_abort_on_overflow, .data = &init_net.ipv4.sysctl_tcp_abort_on_overflow,
.maxlen = sizeof(int), .maxlen = sizeof(u8),
.mode = 0644, .mode = 0644,
.proc_handler = proc_dointvec .proc_handler = proc_dou8vec_minmax,
}, },
{ {
.procname = "tcp_fack", .procname = "tcp_fack",
.data = &init_net.ipv4.sysctl_tcp_fack, .data = &init_net.ipv4.sysctl_tcp_fack,
.maxlen = sizeof(int), .maxlen = sizeof(u8),
.mode = 0644, .mode = 0644,
.proc_handler = proc_dointvec .proc_handler = proc_dou8vec_minmax,
}, },
{ {
.procname = "tcp_max_reordering", .procname = "tcp_max_reordering",
...@@ -1160,16 +1160,16 @@ static struct ctl_table ipv4_net_table[] = { ...@@ -1160,16 +1160,16 @@ static struct ctl_table ipv4_net_table[] = {
{ {
.procname = "tcp_dsack", .procname = "tcp_dsack",
.data = &init_net.ipv4.sysctl_tcp_dsack, .data = &init_net.ipv4.sysctl_tcp_dsack,
.maxlen = sizeof(int), .maxlen = sizeof(u8),
.mode = 0644, .mode = 0644,
.proc_handler = proc_dointvec .proc_handler = proc_dou8vec_minmax,
}, },
{ {
.procname = "tcp_app_win", .procname = "tcp_app_win",
.data = &init_net.ipv4.sysctl_tcp_app_win, .data = &init_net.ipv4.sysctl_tcp_app_win,
.maxlen = sizeof(int), .maxlen = sizeof(u8),
.mode = 0644, .mode = 0644,
.proc_handler = proc_dointvec .proc_handler = proc_dou8vec_minmax,
}, },
{ {
.procname = "tcp_adv_win_scale", .procname = "tcp_adv_win_scale",
...@@ -1183,46 +1183,46 @@ static struct ctl_table ipv4_net_table[] = { ...@@ -1183,46 +1183,46 @@ static struct ctl_table ipv4_net_table[] = {
{ {
.procname = "tcp_frto", .procname = "tcp_frto",
.data = &init_net.ipv4.sysctl_tcp_frto, .data = &init_net.ipv4.sysctl_tcp_frto,
.maxlen = sizeof(int), .maxlen = sizeof(u8),
.mode = 0644, .mode = 0644,
.proc_handler = proc_dointvec .proc_handler = proc_dou8vec_minmax,
}, },
{ {
.procname = "tcp_no_metrics_save", .procname = "tcp_no_metrics_save",
.data = &init_net.ipv4.sysctl_tcp_nometrics_save, .data = &init_net.ipv4.sysctl_tcp_nometrics_save,
.maxlen = sizeof(int), .maxlen = sizeof(u8),
.mode = 0644, .mode = 0644,
.proc_handler = proc_dointvec, .proc_handler = proc_dou8vec_minmax,
}, },
{ {
.procname = "tcp_no_ssthresh_metrics_save", .procname = "tcp_no_ssthresh_metrics_save",
.data = &init_net.ipv4.sysctl_tcp_no_ssthresh_metrics_save, .data = &init_net.ipv4.sysctl_tcp_no_ssthresh_metrics_save,
.maxlen = sizeof(int), .maxlen = sizeof(u8),
.mode = 0644, .mode = 0644,
.proc_handler = proc_dointvec_minmax, .proc_handler = proc_dou8vec_minmax,
.extra1 = SYSCTL_ZERO, .extra1 = SYSCTL_ZERO,
.extra2 = SYSCTL_ONE, .extra2 = SYSCTL_ONE,
}, },
{ {
.procname = "tcp_moderate_rcvbuf", .procname = "tcp_moderate_rcvbuf",
.data = &init_net.ipv4.sysctl_tcp_moderate_rcvbuf, .data = &init_net.ipv4.sysctl_tcp_moderate_rcvbuf,
.maxlen = sizeof(int), .maxlen = sizeof(u8),
.mode = 0644, .mode = 0644,
.proc_handler = proc_dointvec, .proc_handler = proc_dou8vec_minmax,
}, },
{ {
.procname = "tcp_tso_win_divisor", .procname = "tcp_tso_win_divisor",
.data = &init_net.ipv4.sysctl_tcp_tso_win_divisor, .data = &init_net.ipv4.sysctl_tcp_tso_win_divisor,
.maxlen = sizeof(int), .maxlen = sizeof(u8),
.mode = 0644, .mode = 0644,
.proc_handler = proc_dointvec, .proc_handler = proc_dou8vec_minmax,
}, },
{ {
.procname = "tcp_workaround_signed_windows", .procname = "tcp_workaround_signed_windows",
.data = &init_net.ipv4.sysctl_tcp_workaround_signed_windows, .data = &init_net.ipv4.sysctl_tcp_workaround_signed_windows,
.maxlen = sizeof(int), .maxlen = sizeof(u8),
.mode = 0644, .mode = 0644,
.proc_handler = proc_dointvec .proc_handler = proc_dou8vec_minmax,
}, },
{ {
.procname = "tcp_limit_output_bytes", .procname = "tcp_limit_output_bytes",
...@@ -1241,9 +1241,9 @@ static struct ctl_table ipv4_net_table[] = { ...@@ -1241,9 +1241,9 @@ static struct ctl_table ipv4_net_table[] = {
{ {
.procname = "tcp_min_tso_segs", .procname = "tcp_min_tso_segs",
.data = &init_net.ipv4.sysctl_tcp_min_tso_segs, .data = &init_net.ipv4.sysctl_tcp_min_tso_segs,
.maxlen = sizeof(int), .maxlen = sizeof(u8),
.mode = 0644, .mode = 0644,
.proc_handler = proc_dointvec_minmax, .proc_handler = proc_dou8vec_minmax,
.extra1 = SYSCTL_ONE, .extra1 = SYSCTL_ONE,
.extra2 = &gso_max_segs, .extra2 = &gso_max_segs,
}, },
...@@ -1259,9 +1259,9 @@ static struct ctl_table ipv4_net_table[] = { ...@@ -1259,9 +1259,9 @@ static struct ctl_table ipv4_net_table[] = {
{ {
.procname = "tcp_autocorking", .procname = "tcp_autocorking",
.data = &init_net.ipv4.sysctl_tcp_autocorking, .data = &init_net.ipv4.sysctl_tcp_autocorking,
.maxlen = sizeof(int), .maxlen = sizeof(u8),
.mode = 0644, .mode = 0644,
.proc_handler = proc_dointvec_minmax, .proc_handler = proc_dou8vec_minmax,
.extra1 = SYSCTL_ZERO, .extra1 = SYSCTL_ZERO,
.extra2 = SYSCTL_ONE, .extra2 = SYSCTL_ONE,
}, },
...@@ -1332,9 +1332,9 @@ static struct ctl_table ipv4_net_table[] = { ...@@ -1332,9 +1332,9 @@ static struct ctl_table ipv4_net_table[] = {
{ {
.procname = "tcp_reflect_tos", .procname = "tcp_reflect_tos",
.data = &init_net.ipv4.sysctl_tcp_reflect_tos, .data = &init_net.ipv4.sysctl_tcp_reflect_tos,
.maxlen = sizeof(int), .maxlen = sizeof(u8),
.mode = 0644, .mode = 0644,
.proc_handler = proc_dointvec_minmax, .proc_handler = proc_dou8vec_minmax,
.extra1 = SYSCTL_ZERO, .extra1 = SYSCTL_ZERO,
.extra2 = SYSCTL_ONE, .extra2 = SYSCTL_ONE,
}, },
......
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