net/mlx4_en: Fix mixed PFC and Global pause user control requests
[pandora-kernel.git] / net / core / sysctl_net_core.c
index a829e3f..f9496c4 100644 (file)
 
 #include <net/ip.h>
 #include <net/sock.h>
+#include <net/net_ratelimit.h>
+
+static int zero = 0;
+static int ushort_max = USHRT_MAX;
+static int min_sndbuf = SOCK_MIN_SNDBUF;
+static int min_rcvbuf = SOCK_MIN_RCVBUF;
 
 #ifdef CONFIG_RPS
 static int rps_sock_flow_sysctl(ctl_table *table, int write,
@@ -85,28 +91,32 @@ static struct ctl_table net_core_table[] = {
                .data           = &sysctl_wmem_max,
                .maxlen         = sizeof(int),
                .mode           = 0644,
-               .proc_handler   = proc_dointvec
+               .proc_handler   = proc_dointvec_minmax,
+               .extra1         = &min_sndbuf,
        },
        {
                .procname       = "rmem_max",
                .data           = &sysctl_rmem_max,
                .maxlen         = sizeof(int),
                .mode           = 0644,
-               .proc_handler   = proc_dointvec
+               .proc_handler   = proc_dointvec_minmax,
+               .extra1         = &min_rcvbuf,
        },
        {
                .procname       = "wmem_default",
                .data           = &sysctl_wmem_default,
                .maxlen         = sizeof(int),
                .mode           = 0644,
-               .proc_handler   = proc_dointvec
+               .proc_handler   = proc_dointvec_minmax,
+               .extra1         = &min_sndbuf,
        },
        {
                .procname       = "rmem_default",
                .data           = &sysctl_rmem_default,
                .maxlen         = sizeof(int),
                .mode           = 0644,
-               .proc_handler   = proc_dointvec
+               .proc_handler   = proc_dointvec_minmax,
+               .extra1         = &min_rcvbuf,
        },
        {
                .procname       = "dev_weight",
@@ -191,7 +201,9 @@ static struct ctl_table netns_core_table[] = {
                .data           = &init_net.core.sysctl_somaxconn,
                .maxlen         = sizeof(int),
                .mode           = 0644,
-               .proc_handler   = proc_dointvec
+               .extra1         = &zero,
+               .extra2         = &ushort_max,
+               .proc_handler   = proc_dointvec_minmax
        },
        { }
 };