浏览代码

[NET]: Fix sysctl net.core.dev_weight

Changing the sysctl net.core.dev_weight has no effect because the weight
of the backlog devices is set during initialization and never changed.

This patch propagates any changes to the global value affected by sysctl
to the per-cpu devices. It is done every time the packet handler
function is run.

Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Stephen Hemminger 20 年之前
父节点
当前提交
e387660545
共有 1 个文件被更改,包括 1 次插入0 次删除
  1. 1 0
      net/core/dev.c

+ 1 - 0
net/core/dev.c

@@ -1744,6 +1744,7 @@ static int process_backlog(struct net_device *backlog_dev, int *budget)
 	struct softnet_data *queue = &__get_cpu_var(softnet_data);
 	struct softnet_data *queue = &__get_cpu_var(softnet_data);
 	unsigned long start_time = jiffies;
 	unsigned long start_time = jiffies;
 
 
+	backlog_dev->weight = weight_p;
 	for (;;) {
 	for (;;) {
 		struct sk_buff *skb;
 		struct sk_buff *skb;
 		struct net_device *dev;
 		struct net_device *dev;