@@ -256,7 +256,8 @@ int qdisc_set_default(const char *name)
* Note: caller either uses rtnl or rcu_read_lock()
*/
-static struct Qdisc *qdisc_match_from_root(struct Qdisc *root, u32 handle)
+static struct Qdisc *qdisc_match_from_root(struct net_device *dev,
+ struct Qdisc *root, u32 handle)
{
struct Qdisc *q;
@@ -264,7 +265,7 @@ static struct Qdisc *qdisc_match_from_root(struct Qdisc *root, u32 handle)
root->handle == handle)
return root;
- hash_for_each_possible_rcu(qdisc_dev(root)->qdisc_hash, q, hash, handle) {
+ hash_for_each_possible_rcu(dev->qdisc_hash, q, hash, handle) {
if (q->handle == handle)
return q;
}
@@ -296,12 +297,12 @@ struct Qdisc *qdisc_lookup(struct net_device *dev, u32 handle)
{
struct Qdisc *q;
- q = qdisc_match_from_root(dev->qdisc, handle);
+ q = qdisc_match_from_root(dev, dev->qdisc, handle);
if (q)
goto out;
if (dev_ingress_queue(dev))
- q = qdisc_match_from_root(
+ q = qdisc_match_from_root(dev,
dev_ingress_queue(dev)->qdisc_sleeping,
handle);
out:
@@ -1430,8 +1431,8 @@ err_out:
return -EINVAL;
}
-static int tc_dump_qdisc_root(struct Qdisc *root, struct sk_buff *skb,
- struct netlink_callback *cb,
+static int tc_dump_qdisc_root(struct net_device *dev, struct Qdisc *root,
+ struct sk_buff *skb, struct netlink_callback *cb,
int *q_idx_p, int s_q_idx)
{
int ret = 0, q_idx = *q_idx_p;
@@ -1451,7 +1452,7 @@ static int tc_dump_qdisc_root(struct Qdisc *root, struct sk_buff *skb,
goto done;
q_idx++;
}
- hash_for_each(qdisc_dev(root)->qdisc_hash, b, q, hash) {
+ hash_for_each(dev->qdisc_hash, b, q, hash) {
if (q_idx < s_q_idx) {
q_idx++;
continue;
@@ -1492,12 +1493,12 @@ static int tc_dump_qdisc(struct sk_buff *skb, struct netlink_callback *cb)
s_q_idx = 0;
q_idx = 0;
- if (tc_dump_qdisc_root(dev->qdisc, skb, cb, &q_idx, s_q_idx) < 0)
+ if (tc_dump_qdisc_root(dev, dev->qdisc, skb, cb, &q_idx, s_q_idx) < 0)
goto done;
dev_queue = dev_ingress_queue(dev);
if (dev_queue &&
- tc_dump_qdisc_root(dev_queue->qdisc_sleeping, skb, cb,
+ tc_dump_qdisc_root(dev, dev_queue->qdisc_sleeping, skb, cb,
&q_idx, s_q_idx) < 0)
goto done;
@@ -1762,9 +1763,9 @@ static int tc_dump_tclass_qdisc(struct Qdisc *q, struct sk_buff *skb,
return 0;
}
-static int tc_dump_tclass_root(struct Qdisc *root, struct sk_buff *skb,
- struct tcmsg *tcm, struct netlink_callback *cb,
- int *t_p, int s_t)
+static int tc_dump_tclass_root(struct net_device *dev, struct Qdisc *root,
+ struct sk_buff *skb, struct tcmsg *tcm,
+ struct netlink_callback *cb, int *t_p, int s_t)
{
struct Qdisc *q;
int b;
@@ -1775,7 +1776,7 @@ static int tc_dump_tclass_root(struct Qdisc *root, struct sk_buff *skb,
if (tc_dump_tclass_qdisc(root, skb, tcm, cb, t_p, s_t) < 0)
return -1;
- hash_for_each(qdisc_dev(root)->qdisc_hash, b, q, hash) {
+ hash_for_each(dev->qdisc_hash, b, q, hash) {
if (tc_dump_tclass_qdisc(q, skb, tcm, cb, t_p, s_t) < 0)
return -1;
}
@@ -1800,12 +1801,12 @@ static int tc_dump_tclass(struct sk_buff *skb, struct netlink_callback *cb)
s_t = cb->args[0];
t = 0;
- if (tc_dump_tclass_root(dev->qdisc, skb, tcm, cb, &t, s_t) < 0)
+ if (tc_dump_tclass_root(dev, dev->qdisc, skb, tcm, cb, &t, s_t) < 0)
goto done;
dev_queue = dev_ingress_queue(dev);
if (dev_queue &&
- tc_dump_tclass_root(dev_queue->qdisc_sleeping, skb, tcm, cb,
+ tc_dump_tclass_root(dev, dev_queue->qdisc_sleeping, skb, tcm, cb,
&t, s_t) < 0)
goto done;