: pkt_sched: Use __qdisc_lookup() more consistently and export.
Subsystems (3)
David Miller
maintainerPATCH 7/14 : pkt_sched: Use __qdisc_lookup() more consistently and export.
We should make lookups whenever possible in the namespace of a specific queue.
Export so we can use in the classifier API in subsequent changesets.
Signed-off-by David S. Miller <[email protected]>
--- include/net/pkt_sched.h | 1 + net/sched/sch_api.c | 17 ++++++++++------- 2 files changed, 11 insertions(+), 7 deletions(-)
include/net/pkt_sched.h +1 -0
@@ -79,6 +79,7 @@ extern struct Qdisc *fifo_create_dflt(struct Qdisc *sch, struct Qdisc_ops *ops,extern int register_qdisc (struct Qdisc_ops *qops);extern int unregister_qdisc (struct Qdisc_ops *qops); +extern struct Qdisc *__qdisc_lookup (struct netdev_queue *dev_queue,u32 handle);extern struct Qdisc *qdisc_lookup (struct net_device *dev,u32 handle);extern struct Qdisc *qdisc_lookup_class (struct net_device *dev,u32 handle); extern struct qdisc_rate_table *qdisc_get_rtab(struct tc_ratespec *r,
net/sched/sch_api.c +10 -7
@@ -183,7 +183,7 @@ EXPORT_SYMBOL(unregister_qdisc);(root qdisc, all its children, children of children etc.) */ -static struct Qdisc *__qdisc_lookup (struct netdev_queue *dev_queue,u32 handle) +struct Qdisc *__qdisc_lookup (struct netdev_queue *dev_queue,u32 handle) {struct Qdisc *q;
@@ -505,7 +505,7 @@ void qdisc_tree_decrease_qlen(struct Qdisc *sch, unsigned int n)if (TC_H_MAJ (parentid) ==TC_H_MAJ (TC_H_INGRESS ))return ; - sch =qdisc_lookup (qdisc_dev (sch),TC_H_MAJ (parentid)); + sch =__qdisc_lookup (sch->dev_queue,TC_H_MAJ (parentid));if (sch ==NULL ) {WARN_ON (parentid !=TC_H_ROOT );return ;
@@ -718,7 +718,8 @@ static int tc_get_prep_request(struct tc_qdisc_op_info *queue_arr, unsigned intif (TC_H_MAJ (clid) ==TC_H_MAJ (TC_H_INGRESS )) { qp->op_q = dev_queue->qdisc; }else { - qp->parent_q =qdisc_lookup (dev,TC_H_MAJ (clid)); + qp->parent_q =__qdisc_lookup (dev_queue, +TC_H_MAJ (clid));if (!qp->parent_q)return -ENOENT ; qp->op_q =qdisc_leaf (qp->parent_q, clid);
@@ -1186,7 +1187,8 @@ static int tc_prepare_one(struct tc_qdisc_op_info *qp, struct net_device *dev,if (clid) {if (clid !=TC_H_ROOT ) {if (clid !=TC_H_INGRESS ) { - qp->parent_q =qdisc_lookup (dev,TC_H_MAJ (clid)); + qp->parent_q =__qdisc_lookup (dev_queue, +TC_H_MAJ (clid));if (!qp->parent_q)return -ENOENT ; qp->op_q =qdisc_leaf (qp->parent_q, clid);
@@ -1210,7 +1212,8 @@ static int tc_prepare_one(struct tc_qdisc_op_info *qp, struct net_device *dev,if (TC_H_MIN (tcm->tcm_handle))return -EINVAL ; - qp->op_q =__qdisc_lookup (dev_queue, tcm->tcm_handle); + qp->op_q =__qdisc_lookup (dev_queue, + tcm->tcm_handle);if (!qp->op_q) goto create_and_graft;
@@ -1265,7 +1268,7 @@ static int tc_prepare_one(struct tc_qdisc_op_info *qp, struct net_device *dev, }else {if (!tcm->tcm_handle)return -EINVAL ; - qp->op_q =qdisc_lookup (dev, tcm->tcm_handle); + qp->op_q =__qdisc_lookup (dev_queue, tcm->tcm_handle); }/* Change qdisc parameters */
@@ -1574,7 +1577,7 @@ static int tc_ctl_tclass(struct sk_buff *skb, struct nlmsghdr *n, void *arg) }/* OK. Locate qdisc */ -if ((q =qdisc_lookup (dev, qid)) ==NULL ) +if ((q =__qdisc_lookup (dev_queue, qid)) ==NULL )return -ENOENT ;/* An check that it supports classes */
Signature · 1 line
1.5.6.2.255.gbed62