Lines Matching refs:sch
186 static inline struct htb_class *htb_find(u32 handle, struct Qdisc *sch) in htb_find() argument
188 struct htb_sched *q = qdisc_priv(sch); in htb_find()
197 static unsigned long htb_search(struct Qdisc *sch, u32 handle) in htb_search() argument
199 return (unsigned long)htb_find(handle, sch); in htb_search()
219 static struct htb_class *htb_classify(struct sk_buff *skb, struct Qdisc *sch, in htb_classify() argument
222 struct htb_sched *q = qdisc_priv(sch); in htb_classify()
232 if (skb->priority == sch->handle) in htb_classify()
234 cl = htb_find(skb->priority, sch); in htb_classify()
259 if (res.classid == sch->handle) in htb_classify()
261 cl = htb_find(res.classid, sch); in htb_classify()
272 cl = htb_find(TC_H_MAKE(TC_H_MAJ(sch->handle), q->defcls), sch); in htb_classify()
618 static int htb_enqueue(struct sk_buff *skb, struct Qdisc *sch, in htb_enqueue() argument
623 struct htb_sched *q = qdisc_priv(sch); in htb_enqueue()
624 struct htb_class *cl = htb_classify(skb, sch, &ret); in htb_enqueue()
632 return qdisc_drop(skb, sch, to_free); in htb_enqueue()
637 qdisc_qstats_drop(sch); in htb_enqueue()
644 qdisc_qstats_drop(sch); in htb_enqueue()
652 sch->qstats.backlog += len; in htb_enqueue()
653 sch->q.qlen++; in htb_enqueue()
937 static struct sk_buff *htb_dequeue(struct Qdisc *sch) in htb_dequeue() argument
940 struct htb_sched *q = qdisc_priv(sch); in htb_dequeue()
949 qdisc_bstats_update(sch, skb); in htb_dequeue()
950 qdisc_qstats_backlog_dec(sch, skb); in htb_dequeue()
951 sch->q.qlen--; in htb_dequeue()
955 if (!sch->q.qlen) in htb_dequeue()
997 static void htb_reset(struct Qdisc *sch) in htb_reset() argument
999 struct htb_sched *q = qdisc_priv(sch); in htb_reset()
1035 struct Qdisc *sch = q->watchdog.qdisc; in htb_work_func() local
1038 __netif_schedule(qdisc_root(sch)); in htb_work_func()
1054 static int htb_init(struct Qdisc *sch, struct nlattr *opt, in htb_init() argument
1057 struct net_device *dev = qdisc_dev(sch); in htb_init()
1059 struct htb_sched *q = qdisc_priv(sch); in htb_init()
1066 qdisc_watchdog_init(&q->watchdog, sch); in htb_init()
1072 err = tcf_block_get(&q->block, &q->filter_list, sch, extack); in htb_init()
1091 if (sch->parent != TC_H_ROOT) { in htb_init()
1116 q->direct_qlen = qdisc_dev(sch)->tx_queue_len; in htb_init()
1130 TC_H_MAKE(sch->handle, 0), extack); in htb_init()
1140 sch->flags |= TCQ_F_MQROOT; in htb_init()
1144 .parent_classid = TC_H_MAJ(sch->handle) >> 16, in htb_init()
1160 static void htb_attach_offload(struct Qdisc *sch) in htb_attach_offload() argument
1162 struct net_device *dev = qdisc_dev(sch); in htb_attach_offload()
1163 struct htb_sched *q = qdisc_priv(sch); in htb_attach_offload()
1184 static void htb_attach_software(struct Qdisc *sch) in htb_attach_software() argument
1186 struct net_device *dev = qdisc_dev(sch); in htb_attach_software()
1192 struct Qdisc *old = dev_graft_qdisc(dev_queue, sch); in htb_attach_software()
1194 qdisc_refcount_inc(sch); in htb_attach_software()
1200 static void htb_attach(struct Qdisc *sch) in htb_attach() argument
1202 struct htb_sched *q = qdisc_priv(sch); in htb_attach()
1205 htb_attach_offload(sch); in htb_attach()
1207 htb_attach_software(sch); in htb_attach()
1210 static int htb_dump(struct Qdisc *sch, struct sk_buff *skb) in htb_dump() argument
1212 struct htb_sched *q = qdisc_priv(sch); in htb_dump()
1217 sch->flags |= TCQ_F_OFFLOADED; in htb_dump()
1219 sch->flags &= ~TCQ_F_OFFLOADED; in htb_dump()
1221 sch->qstats.overlimits = q->overlimits; in htb_dump()
1248 static int htb_dump_class(struct Qdisc *sch, unsigned long arg, in htb_dump_class() argument
1252 struct htb_sched *q = qdisc_priv(sch); in htb_dump_class()
1328 htb_dump_class_stats(struct Qdisc *sch, unsigned long arg, struct gnet_dump *d) in htb_dump_class_stats() argument
1331 struct htb_sched *q = qdisc_priv(sch); in htb_dump_class_stats()
1369 htb_select_queue(struct Qdisc *sch, struct tcmsg *tcm) in htb_select_queue() argument
1371 struct net_device *dev = qdisc_dev(sch); in htb_select_queue()
1373 struct htb_sched *q = qdisc_priv(sch); in htb_select_queue()
1377 return sch->dev_queue; in htb_select_queue()
1417 static void htb_offload_move_qdisc(struct Qdisc *sch, struct htb_class *cl_old, in htb_offload_move_qdisc() argument
1421 struct net_device *dev = qdisc_dev(sch); in htb_offload_move_qdisc()
1449 static int htb_graft(struct Qdisc *sch, unsigned long arg, struct Qdisc *new, in htb_graft() argument
1452 struct netdev_queue *dev_queue = sch->dev_queue; in htb_graft()
1454 struct htb_sched *q = qdisc_priv(sch); in htb_graft()
1477 *old = qdisc_replace(sch, new, &cl->leaf.q); in htb_graft()
1487 static struct Qdisc *htb_leaf(struct Qdisc *sch, unsigned long arg) in htb_leaf() argument
1493 static void htb_qlen_notify(struct Qdisc *sch, unsigned long arg) in htb_qlen_notify() argument
1497 htb_deactivate(qdisc_priv(sch), cl); in htb_qlen_notify()
1511 static void htb_parent_to_leaf(struct Qdisc *sch, struct htb_class *cl, in htb_parent_to_leaf() argument
1514 struct htb_sched *q = qdisc_priv(sch); in htb_parent_to_leaf()
1534 static void htb_parent_to_leaf_offload(struct Qdisc *sch, in htb_parent_to_leaf_offload() argument
1547 static int htb_destroy_class_offload(struct Qdisc *sch, struct htb_class *cl, in htb_destroy_class_offload() argument
1587 err = htb_offload(qdisc_dev(sch), &offload_opt); in htb_destroy_class_offload()
1600 u32 classid = TC_H_MAJ(sch->handle) | in htb_destroy_class_offload()
1602 struct htb_class *moved_cl = htb_find(classid, sch); in htb_destroy_class_offload()
1604 htb_offload_move_qdisc(sch, moved_cl, cl, destroying); in htb_destroy_class_offload()
1610 static void htb_destroy_class(struct Qdisc *sch, struct htb_class *cl) in htb_destroy_class() argument
1621 static void htb_destroy(struct Qdisc *sch) in htb_destroy() argument
1623 struct net_device *dev = qdisc_dev(sch); in htb_destroy()
1625 struct htb_sched *q = qdisc_priv(sch); in htb_destroy()
1656 htb_destroy_class(sch, cl); in htb_destroy()
1668 htb_destroy_class_offload(sch, cl, last_child, in htb_destroy()
1675 htb_parent_to_leaf(sch, cl, NULL); in htb_destroy()
1676 htb_destroy_class(sch, cl); in htb_destroy()
1699 static int htb_delete(struct Qdisc *sch, unsigned long arg, in htb_delete() argument
1702 struct htb_sched *q = qdisc_priv(sch); in htb_delete()
1721 err = htb_destroy_class_offload(sch, cl, last_child, false, in htb_delete()
1728 struct netdev_queue *dev_queue = sch->dev_queue; in htb_delete()
1739 htb_parent_to_leaf_offload(sch, dev_queue, new_q); in htb_delete()
1743 sch_tree_lock(sch); in htb_delete()
1761 htb_parent_to_leaf(sch, cl, new_q); in htb_delete()
1763 sch_tree_unlock(sch); in htb_delete()
1765 htb_destroy_class(sch, cl); in htb_delete()
1769 static int htb_change_class(struct Qdisc *sch, u32 classid, in htb_change_class() argument
1774 struct htb_sched *q = qdisc_priv(sch); in htb_change_class()
1798 parent = parentid == TC_H_ROOT ? NULL : htb_find(parentid, sch); in htb_change_class()
1829 struct net_device *dev = qdisc_dev(sch); in htb_change_class()
1848 if (!classid || TC_H_MAJ(classid ^ sch->handle) || in htb_change_class()
1849 htb_find(classid, sch)) in htb_change_class()
1865 err = tcf_block_get(&cl->block, &cl->filter_list, sch, extack); in htb_change_class()
1898 dev_queue = sch->dev_queue; in htb_change_class()
1961 sch_tree_lock(sch); in htb_change_class()
2011 struct net_device *dev = qdisc_dev(sch); in htb_change_class()
2033 sch_tree_lock(sch); in htb_change_class()
2065 sch_tree_unlock(sch); in htb_change_class()
2073 qdisc_class_hash_grow(sch, &q->clhash); in htb_change_class()
2087 static struct tcf_block *htb_tcf_block(struct Qdisc *sch, unsigned long arg, in htb_tcf_block() argument
2090 struct htb_sched *q = qdisc_priv(sch); in htb_tcf_block()
2096 static unsigned long htb_bind_filter(struct Qdisc *sch, unsigned long parent, in htb_bind_filter() argument
2099 struct htb_class *cl = htb_find(classid, sch); in htb_bind_filter()
2115 static void htb_unbind_filter(struct Qdisc *sch, unsigned long arg) in htb_unbind_filter() argument
2122 static void htb_walk(struct Qdisc *sch, struct qdisc_walker *arg) in htb_walk() argument
2124 struct htb_sched *q = qdisc_priv(sch); in htb_walk()
2133 if (!tc_qdisc_stats_dump(sch, (unsigned long)cl, arg)) in htb_walk()