diff options
author | Stephen Hemminger <shemminger@osdl.org> | 2005-06-23 23:14:40 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2005-06-23 23:14:40 -0400 |
commit | 51b0bdedb8e784d0d969a6b77151911130812400 (patch) | |
tree | 2acfa2b696773e96c08641d73aadf6b83d93b10f | |
parent | 31aa02c53c84658f6694f319f09e232ede27be5a (diff) |
[NET]: Separate two usages of netdev_max_backlog.
Separate out the two uses of netdev_max_backlog. One controls the
upper bound on packets processed per softirq, the new name for this is
netdev_budget; the other controls the limit on packets queued via
netif_rx.
Increase the max_backlog default to account for faster processors.
Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | include/linux/sysctl.h | 1 | ||||
-rw-r--r-- | net/core/dev.c | 6 | ||||
-rw-r--r-- | net/core/sysctl_net_core.c | 9 |
3 files changed, 13 insertions, 3 deletions
diff --git a/include/linux/sysctl.h b/include/linux/sysctl.h index 72965bfe6cfb..ebfe1250f0a4 100644 --- a/include/linux/sysctl.h +++ b/include/linux/sysctl.h | |||
@@ -243,6 +243,7 @@ enum | |||
243 | NET_CORE_MOD_CONG=16, | 243 | NET_CORE_MOD_CONG=16, |
244 | NET_CORE_DEV_WEIGHT=17, | 244 | NET_CORE_DEV_WEIGHT=17, |
245 | NET_CORE_SOMAXCONN=18, | 245 | NET_CORE_SOMAXCONN=18, |
246 | NET_CORE_BUDGET=19, | ||
246 | }; | 247 | }; |
247 | 248 | ||
248 | /* /proc/sys/net/ethernet */ | 249 | /* /proc/sys/net/ethernet */ |
diff --git a/net/core/dev.c b/net/core/dev.c index 1a64508e527f..7016e0c36b3d 100644 --- a/net/core/dev.c +++ b/net/core/dev.c | |||
@@ -1346,7 +1346,8 @@ out: | |||
1346 | Receiver routines | 1346 | Receiver routines |
1347 | =======================================================================*/ | 1347 | =======================================================================*/ |
1348 | 1348 | ||
1349 | int netdev_max_backlog = 300; | 1349 | int netdev_max_backlog = 1000; |
1350 | int netdev_budget = 300; | ||
1350 | int weight_p = 64; /* old backlog weight */ | 1351 | int weight_p = 64; /* old backlog weight */ |
1351 | 1352 | ||
1352 | DEFINE_PER_CPU(struct netif_rx_stats, netdev_rx_stat) = { 0, }; | 1353 | DEFINE_PER_CPU(struct netif_rx_stats, netdev_rx_stat) = { 0, }; |
@@ -1695,8 +1696,7 @@ static void net_rx_action(struct softirq_action *h) | |||
1695 | { | 1696 | { |
1696 | struct softnet_data *queue = &__get_cpu_var(softnet_data); | 1697 | struct softnet_data *queue = &__get_cpu_var(softnet_data); |
1697 | unsigned long start_time = jiffies; | 1698 | unsigned long start_time = jiffies; |
1698 | int budget = netdev_max_backlog; | 1699 | int budget = netdev_budget; |
1699 | |||
1700 | 1700 | ||
1701 | local_irq_disable(); | 1701 | local_irq_disable(); |
1702 | 1702 | ||
diff --git a/net/core/sysctl_net_core.c b/net/core/sysctl_net_core.c index fff63643a35c..8f817ad9f546 100644 --- a/net/core/sysctl_net_core.c +++ b/net/core/sysctl_net_core.c | |||
@@ -13,6 +13,7 @@ | |||
13 | #ifdef CONFIG_SYSCTL | 13 | #ifdef CONFIG_SYSCTL |
14 | 14 | ||
15 | extern int netdev_max_backlog; | 15 | extern int netdev_max_backlog; |
16 | extern int netdev_budget; | ||
16 | extern int weight_p; | 17 | extern int weight_p; |
17 | extern int net_msg_cost; | 18 | extern int net_msg_cost; |
18 | extern int net_msg_burst; | 19 | extern int net_msg_burst; |
@@ -124,6 +125,14 @@ ctl_table core_table[] = { | |||
124 | .mode = 0644, | 125 | .mode = 0644, |
125 | .proc_handler = &proc_dointvec | 126 | .proc_handler = &proc_dointvec |
126 | }, | 127 | }, |
128 | { | ||
129 | .ctl_name = NET_CORE_BUDGET, | ||
130 | .procname = "netdev_budget", | ||
131 | .data = &netdev_budget, | ||
132 | .maxlen = sizeof(int), | ||
133 | .mode = 0644, | ||
134 | .proc_handler = &proc_dointvec | ||
135 | }, | ||
127 | { .ctl_name = 0 } | 136 | { .ctl_name = 0 } |
128 | }; | 137 | }; |
129 | 138 | ||