Lines Matching refs:qdisc
576 static int noop_enqueue(struct sk_buff *skb, struct Qdisc *qdisc, in noop_enqueue() argument
583 static struct sk_buff *noop_dequeue(struct Qdisc *qdisc) in noop_dequeue() argument
598 RCU_POINTER_INITIALIZER(qdisc, &noop_qdisc),
625 static int noqueue_init(struct Qdisc *qdisc, struct nlattr *opt, in noqueue_init() argument
631 qdisc->enqueue = NULL; in noqueue_init()
669 static int pfifo_fast_enqueue(struct sk_buff *skb, struct Qdisc *qdisc, in pfifo_fast_enqueue() argument
673 struct pfifo_fast_priv *priv = qdisc_priv(qdisc); in pfifo_fast_enqueue()
681 if (qdisc_is_percpu_stats(qdisc)) in pfifo_fast_enqueue()
682 return qdisc_drop_cpu(skb, qdisc, to_free); in pfifo_fast_enqueue()
684 return qdisc_drop(skb, qdisc, to_free); in pfifo_fast_enqueue()
687 qdisc_update_stats_at_enqueue(qdisc, pkt_len); in pfifo_fast_enqueue()
691 static struct sk_buff *pfifo_fast_dequeue(struct Qdisc *qdisc) in pfifo_fast_dequeue() argument
693 struct pfifo_fast_priv *priv = qdisc_priv(qdisc); in pfifo_fast_dequeue()
708 qdisc_update_stats_at_dequeue(qdisc, skb); in pfifo_fast_dequeue()
710 READ_ONCE(qdisc->state) & QDISC_STATE_NON_EMPTY) { in pfifo_fast_dequeue()
716 clear_bit(__QDISC_STATE_MISSED, &qdisc->state); in pfifo_fast_dequeue()
717 clear_bit(__QDISC_STATE_DRAINING, &qdisc->state); in pfifo_fast_dequeue()
732 static struct sk_buff *pfifo_fast_peek(struct Qdisc *qdisc) in pfifo_fast_peek() argument
734 struct pfifo_fast_priv *priv = qdisc_priv(qdisc); in pfifo_fast_peek()
747 static void pfifo_fast_reset(struct Qdisc *qdisc) in pfifo_fast_reset() argument
750 struct pfifo_fast_priv *priv = qdisc_priv(qdisc); in pfifo_fast_reset()
766 if (qdisc_is_percpu_stats(qdisc)) { in pfifo_fast_reset()
770 q = per_cpu_ptr(qdisc->cpu_qstats, i); in pfifo_fast_reset()
777 static int pfifo_fast_dump(struct Qdisc *qdisc, struct sk_buff *skb) in pfifo_fast_dump() argument
790 static int pfifo_fast_init(struct Qdisc *qdisc, struct nlattr *opt, in pfifo_fast_init() argument
793 unsigned int qlen = qdisc_dev(qdisc)->tx_queue_len; in pfifo_fast_init()
794 struct pfifo_fast_priv *priv = qdisc_priv(qdisc); in pfifo_fast_init()
811 qdisc->flags |= TCQ_F_CAN_BYPASS; in pfifo_fast_init()
964 void qdisc_reset(struct Qdisc *qdisc) in qdisc_reset() argument
966 const struct Qdisc_ops *ops = qdisc->ops; in qdisc_reset()
969 trace_qdisc_reset(qdisc); in qdisc_reset()
972 ops->reset(qdisc); in qdisc_reset()
974 skb_queue_walk_safe(&qdisc->gso_skb, skb, tmp) { in qdisc_reset()
975 __skb_unlink(skb, &qdisc->gso_skb); in qdisc_reset()
979 skb_queue_walk_safe(&qdisc->skb_bad_txq, skb, tmp) { in qdisc_reset()
980 __skb_unlink(skb, &qdisc->skb_bad_txq); in qdisc_reset()
984 qdisc->q.qlen = 0; in qdisc_reset()
985 qdisc->qstats.backlog = 0; in qdisc_reset()
989 void qdisc_free(struct Qdisc *qdisc) in qdisc_free() argument
991 if (qdisc_is_percpu_stats(qdisc)) { in qdisc_free()
992 free_percpu(qdisc->cpu_bstats); in qdisc_free()
993 free_percpu(qdisc->cpu_qstats); in qdisc_free()
996 kfree(qdisc); in qdisc_free()
1006 static void qdisc_destroy(struct Qdisc *qdisc) in qdisc_destroy() argument
1008 const struct Qdisc_ops *ops = qdisc->ops; in qdisc_destroy()
1011 qdisc_hash_del(qdisc); in qdisc_destroy()
1013 qdisc_put_stab(rtnl_dereference(qdisc->stab)); in qdisc_destroy()
1015 gen_kill_estimator(&qdisc->rate_est); in qdisc_destroy()
1017 qdisc_reset(qdisc); in qdisc_destroy()
1020 ops->destroy(qdisc); in qdisc_destroy()
1023 dev_put(qdisc_dev(qdisc)); in qdisc_destroy()
1025 trace_qdisc_destroy(qdisc); in qdisc_destroy()
1027 call_rcu(&qdisc->rcu, qdisc_free_cb); in qdisc_destroy()
1030 void qdisc_put(struct Qdisc *qdisc) in qdisc_put() argument
1032 if (!qdisc) in qdisc_put()
1035 if (qdisc->flags & TCQ_F_BUILTIN || in qdisc_put()
1036 !refcount_dec_and_test(&qdisc->refcnt)) in qdisc_put()
1039 qdisc_destroy(qdisc); in qdisc_put()
1048 void qdisc_put_unlocked(struct Qdisc *qdisc) in qdisc_put_unlocked() argument
1050 if (qdisc->flags & TCQ_F_BUILTIN || in qdisc_put_unlocked()
1051 !refcount_dec_and_rtnl_lock(&qdisc->refcnt)) in qdisc_put_unlocked()
1054 qdisc_destroy(qdisc); in qdisc_put_unlocked()
1061 struct Qdisc *qdisc) in dev_graft_qdisc() argument
1070 if (qdisc == NULL) in dev_graft_qdisc()
1071 qdisc = &noop_qdisc; in dev_graft_qdisc()
1072 dev_queue->qdisc_sleeping = qdisc; in dev_graft_qdisc()
1073 rcu_assign_pointer(dev_queue->qdisc, &noop_qdisc); in dev_graft_qdisc()
1085 struct Qdisc *qdisc; in attach_one_default_qdisc() local
1093 qdisc = qdisc_create_dflt(dev_queue, ops, TC_H_ROOT, NULL); in attach_one_default_qdisc()
1094 if (!qdisc) in attach_one_default_qdisc()
1098 qdisc->flags |= TCQ_F_ONETXQUEUE | TCQ_F_NOPARENT; in attach_one_default_qdisc()
1099 dev_queue->qdisc_sleeping = qdisc; in attach_one_default_qdisc()
1105 struct Qdisc *qdisc; in attach_default_qdiscs() local
1112 dev->qdisc = txq->qdisc_sleeping; in attach_default_qdiscs()
1113 qdisc_refcount_inc(dev->qdisc); in attach_default_qdiscs()
1115 qdisc = qdisc_create_dflt(txq, &mq_qdisc_ops, TC_H_ROOT, NULL); in attach_default_qdiscs()
1116 if (qdisc) { in attach_default_qdiscs()
1117 dev->qdisc = qdisc; in attach_default_qdiscs()
1118 qdisc->ops->attach(qdisc); in attach_default_qdiscs()
1123 if (dev->qdisc == &noop_qdisc) { in attach_default_qdiscs()
1128 dev->qdisc = txq->qdisc_sleeping; in attach_default_qdiscs()
1129 qdisc_refcount_inc(dev->qdisc); in attach_default_qdiscs()
1134 if (dev->qdisc != &noop_qdisc) in attach_default_qdiscs()
1135 qdisc_hash_add(dev->qdisc, false); in attach_default_qdiscs()
1149 rcu_assign_pointer(dev_queue->qdisc, new_qdisc); in transition_one_qdisc()
1165 if (dev->qdisc == &noop_qdisc) in dev_activate()
1184 static void qdisc_deactivate(struct Qdisc *qdisc) in qdisc_deactivate() argument
1186 if (qdisc->flags & TCQ_F_BUILTIN) in qdisc_deactivate()
1189 set_bit(__QDISC_STATE_DEACTIVATED, &qdisc->state); in qdisc_deactivate()
1197 struct Qdisc *qdisc; in dev_deactivate_queue() local
1199 qdisc = rtnl_dereference(dev_queue->qdisc); in dev_deactivate_queue()
1200 if (qdisc) { in dev_deactivate_queue()
1201 qdisc_deactivate(qdisc); in dev_deactivate_queue()
1202 rcu_assign_pointer(dev_queue->qdisc, qdisc_default); in dev_deactivate_queue()
1210 struct Qdisc *qdisc; in dev_reset_queue() local
1213 qdisc = dev_queue->qdisc_sleeping; in dev_reset_queue()
1214 if (!qdisc) in dev_reset_queue()
1217 nolock = qdisc->flags & TCQ_F_NOLOCK; in dev_reset_queue()
1220 spin_lock_bh(&qdisc->seqlock); in dev_reset_queue()
1221 spin_lock_bh(qdisc_lock(qdisc)); in dev_reset_queue()
1223 qdisc_reset(qdisc); in dev_reset_queue()
1225 spin_unlock_bh(qdisc_lock(qdisc)); in dev_reset_queue()
1227 clear_bit(__QDISC_STATE_MISSED, &qdisc->state); in dev_reset_queue()
1228 clear_bit(__QDISC_STATE_DRAINING, &qdisc->state); in dev_reset_queue()
1229 spin_unlock_bh(&qdisc->seqlock); in dev_reset_queue()
1320 struct Qdisc *qdisc = dev_queue->qdisc_sleeping; in qdisc_change_tx_queue_len() local
1321 const struct Qdisc_ops *ops = qdisc->ops; in qdisc_change_tx_queue_len()
1324 return ops->change_tx_queue_len(qdisc, dev->tx_queue_len); in qdisc_change_tx_queue_len()
1331 struct Qdisc *qdisc = dev->qdisc; in dev_qdisc_change_real_num_tx() local
1333 if (qdisc->ops->change_real_num_tx) in dev_qdisc_change_real_num_tx()
1334 qdisc->ops->change_real_num_tx(qdisc, new_real_tx); in dev_qdisc_change_real_num_tx()
1341 struct Qdisc *qdisc; in mq_change_real_num_tx() local
1345 qdisc = netdev_get_tx_queue(dev, i)->qdisc_sleeping; in mq_change_real_num_tx()
1349 if (qdisc != &noop_qdisc && !qdisc->handle) in mq_change_real_num_tx()
1350 qdisc_hash_del(qdisc); in mq_change_real_num_tx()
1353 qdisc = netdev_get_tx_queue(dev, i)->qdisc_sleeping; in mq_change_real_num_tx()
1354 if (qdisc != &noop_qdisc && !qdisc->handle) in mq_change_real_num_tx()
1355 qdisc_hash_add(qdisc, false); in mq_change_real_num_tx()
1387 struct Qdisc *qdisc = _qdisc; in dev_init_scheduler_queue() local
1389 rcu_assign_pointer(dev_queue->qdisc, qdisc); in dev_init_scheduler_queue()
1390 dev_queue->qdisc_sleeping = qdisc; in dev_init_scheduler_queue()
1395 dev->qdisc = &noop_qdisc; in dev_init_scheduler()
1407 struct Qdisc *qdisc = dev_queue->qdisc_sleeping; in shutdown_scheduler_queue() local
1410 if (qdisc) { in shutdown_scheduler_queue()
1411 rcu_assign_pointer(dev_queue->qdisc, qdisc_default); in shutdown_scheduler_queue()
1414 qdisc_put(qdisc); in shutdown_scheduler_queue()
1423 qdisc_put(dev->qdisc); in dev_shutdown()
1424 dev->qdisc = &noop_qdisc; in dev_shutdown()
1537 void mini_qdisc_pair_init(struct mini_Qdisc_pair *miniqp, struct Qdisc *qdisc, in mini_qdisc_pair_init() argument
1540 miniqp->miniq1.cpu_bstats = qdisc->cpu_bstats; in mini_qdisc_pair_init()
1541 miniqp->miniq1.cpu_qstats = qdisc->cpu_qstats; in mini_qdisc_pair_init()
1542 miniqp->miniq2.cpu_bstats = qdisc->cpu_bstats; in mini_qdisc_pair_init()
1543 miniqp->miniq2.cpu_qstats = qdisc->cpu_qstats; in mini_qdisc_pair_init()