aboutsummaryrefslogtreecommitdiffstats
path: root/net/sched/sch_api.c
diff options
context:
space:
mode:
authorAndrea Bastoni <bastoni@cs.unc.edu>2010-05-30 19:16:45 -0400
committerAndrea Bastoni <bastoni@cs.unc.edu>2010-05-30 19:16:45 -0400
commitada47b5fe13d89735805b566185f4885f5a3f750 (patch)
tree644b88f8a71896307d71438e9b3af49126ffb22b /net/sched/sch_api.c
parent43e98717ad40a4ae64545b5ba047c7b86aa44f4f (diff)
parent3280f21d43ee541f97f8cda5792150d2dbec20d5 (diff)
Merge branch 'wip-2.6.34' into old-private-masterarchived-private-master
Diffstat (limited to 'net/sched/sch_api.c')
-rw-r--r--net/sched/sch_api.c21
1 files changed, 12 insertions, 9 deletions
diff --git a/net/sched/sch_api.c b/net/sched/sch_api.c
index 903e4188b6ca..145268ca57cf 100644
--- a/net/sched/sch_api.c
+++ b/net/sched/sch_api.c
@@ -28,6 +28,7 @@
28#include <linux/list.h> 28#include <linux/list.h>
29#include <linux/hrtimer.h> 29#include <linux/hrtimer.h>
30#include <linux/lockdep.h> 30#include <linux/lockdep.h>
31#include <linux/slab.h>
31 32
32#include <net/net_namespace.h> 33#include <net/net_namespace.h>
33#include <net/sock.h> 34#include <net/sock.h>
@@ -947,7 +948,7 @@ static int tc_get_qdisc(struct sk_buff *skb, struct nlmsghdr *n, void *arg)
947 struct Qdisc *p = NULL; 948 struct Qdisc *p = NULL;
948 int err; 949 int err;
949 950
950 if (net != &init_net) 951 if (!net_eq(net, &init_net))
951 return -EINVAL; 952 return -EINVAL;
952 953
953 if ((dev = __dev_get_by_index(&init_net, tcm->tcm_ifindex)) == NULL) 954 if ((dev = __dev_get_by_index(&init_net, tcm->tcm_ifindex)) == NULL)
@@ -1009,7 +1010,7 @@ static int tc_modify_qdisc(struct sk_buff *skb, struct nlmsghdr *n, void *arg)
1009 struct Qdisc *q, *p; 1010 struct Qdisc *q, *p;
1010 int err; 1011 int err;
1011 1012
1012 if (net != &init_net) 1013 if (!net_eq(net, &init_net))
1013 return -EINVAL; 1014 return -EINVAL;
1014 1015
1015replay: 1016replay:
@@ -1179,7 +1180,7 @@ static int tc_fill_qdisc(struct sk_buff *skb, struct Qdisc *q, u32 clid,
1179 goto nla_put_failure; 1180 goto nla_put_failure;
1180 1181
1181 if (gnet_stats_copy_basic(&d, &q->bstats) < 0 || 1182 if (gnet_stats_copy_basic(&d, &q->bstats) < 0 ||
1182 gnet_stats_copy_rate_est(&d, &q->rate_est) < 0 || 1183 gnet_stats_copy_rate_est(&d, &q->bstats, &q->rate_est) < 0 ||
1183 gnet_stats_copy_queue(&d, &q->qstats) < 0) 1184 gnet_stats_copy_queue(&d, &q->qstats) < 0)
1184 goto nla_put_failure; 1185 goto nla_put_failure;
1185 1186
@@ -1274,14 +1275,15 @@ static int tc_dump_qdisc(struct sk_buff *skb, struct netlink_callback *cb)
1274 int s_idx, s_q_idx; 1275 int s_idx, s_q_idx;
1275 struct net_device *dev; 1276 struct net_device *dev;
1276 1277
1277 if (net != &init_net) 1278 if (!net_eq(net, &init_net))
1278 return 0; 1279 return 0;
1279 1280
1280 s_idx = cb->args[0]; 1281 s_idx = cb->args[0];
1281 s_q_idx = q_idx = cb->args[1]; 1282 s_q_idx = q_idx = cb->args[1];
1282 read_lock(&dev_base_lock); 1283
1284 rcu_read_lock();
1283 idx = 0; 1285 idx = 0;
1284 for_each_netdev(&init_net, dev) { 1286 for_each_netdev_rcu(&init_net, dev) {
1285 struct netdev_queue *dev_queue; 1287 struct netdev_queue *dev_queue;
1286 1288
1287 if (idx < s_idx) 1289 if (idx < s_idx)
@@ -1302,7 +1304,7 @@ cont:
1302 } 1304 }
1303 1305
1304done: 1306done:
1305 read_unlock(&dev_base_lock); 1307 rcu_read_unlock();
1306 1308
1307 cb->args[0] = idx; 1309 cb->args[0] = idx;
1308 cb->args[1] = q_idx; 1310 cb->args[1] = q_idx;
@@ -1333,7 +1335,7 @@ static int tc_ctl_tclass(struct sk_buff *skb, struct nlmsghdr *n, void *arg)
1333 u32 qid = TC_H_MAJ(clid); 1335 u32 qid = TC_H_MAJ(clid);
1334 int err; 1336 int err;
1335 1337
1336 if (net != &init_net) 1338 if (!net_eq(net, &init_net))
1337 return -EINVAL; 1339 return -EINVAL;
1338 1340
1339 if ((dev = __dev_get_by_index(&init_net, tcm->tcm_ifindex)) == NULL) 1341 if ((dev = __dev_get_by_index(&init_net, tcm->tcm_ifindex)) == NULL)
@@ -1575,7 +1577,7 @@ static int tc_dump_tclass(struct sk_buff *skb, struct netlink_callback *cb)
1575 struct net_device *dev; 1577 struct net_device *dev;
1576 int t, s_t; 1578 int t, s_t;
1577 1579
1578 if (net != &init_net) 1580 if (!net_eq(net, &init_net))
1579 return 0; 1581 return 0;
1580 1582
1581 if (cb->nlh->nlmsg_len < NLMSG_LENGTH(sizeof(*tcm))) 1583 if (cb->nlh->nlmsg_len < NLMSG_LENGTH(sizeof(*tcm)))
@@ -1706,6 +1708,7 @@ static int __init pktsched_init(void)
1706{ 1708{
1707 register_qdisc(&pfifo_qdisc_ops); 1709 register_qdisc(&pfifo_qdisc_ops);
1708 register_qdisc(&bfifo_qdisc_ops); 1710 register_qdisc(&bfifo_qdisc_ops);
1711 register_qdisc(&pfifo_head_drop_qdisc_ops);
1709 register_qdisc(&mq_qdisc_ops); 1712 register_qdisc(&mq_qdisc_ops);
1710 proc_net_fops_create(&init_net, "psched", 0, &psched_fops); 1713 proc_net_fops_create(&init_net, "psched", 0, &psched_fops);
1711 1714