1 From b531d492d5ef1cf9dba0f4888eb5fd8624a6d762 Mon Sep 17 00:00:00 2001
2 From: Felix Fietkau <nbd@nbd.name>
3 Date: Fri, 7 Jul 2017 17:23:42 +0200
4 Subject: net: sched: switch default qdisc from pfifo_fast to fq_codel and remove pfifo_fast
6 Signed-off-by: Felix Fietkau <nbd@nbd.name>
8 net/sched/sch_generic.c | 140 ------------------------------------------------
9 1 file changed, 140 deletions(-)
11 --- a/net/sched/sch_generic.c
12 +++ b/net/sched/sch_generic.c
13 @@ -449,146 +449,6 @@ struct Qdisc_ops noqueue_qdisc_ops __rea
17 -static const u8 prio2band[TC_PRIO_MAX + 1] = {
18 - 1, 2, 2, 2, 1, 2, 0, 0 , 1, 1, 1, 1, 1, 1, 1, 1
21 -/* 3-band FIFO queue: old style, but should be a bit faster than
22 - generic prio+fifo combination.
25 -#define PFIFO_FAST_BANDS 3
28 - * Private data for a pfifo_fast scheduler containing:
29 - * - queues for the three band
30 - * - bitmap indicating which of the bands contain skbs
32 -struct pfifo_fast_priv {
34 - struct qdisc_skb_head q[PFIFO_FAST_BANDS];
38 - * Convert a bitmap to the first band number where an skb is queued, where:
39 - * bitmap=0 means there are no skbs on any band.
40 - * bitmap=1 means there is an skb on band 0.
41 - * bitmap=7 means there are skbs on all 3 bands, etc.
43 -static const int bitmap2band[] = {-1, 0, 1, 0, 2, 0, 1, 0};
45 -static inline struct qdisc_skb_head *band2list(struct pfifo_fast_priv *priv,
48 - return priv->q + band;
51 -static int pfifo_fast_enqueue(struct sk_buff *skb, struct Qdisc *qdisc,
52 - struct sk_buff **to_free)
54 - if (qdisc->q.qlen < qdisc_dev(qdisc)->tx_queue_len) {
55 - int band = prio2band[skb->priority & TC_PRIO_MAX];
56 - struct pfifo_fast_priv *priv = qdisc_priv(qdisc);
57 - struct qdisc_skb_head *list = band2list(priv, band);
59 - priv->bitmap |= (1 << band);
61 - return __qdisc_enqueue_tail(skb, qdisc, list);
64 - return qdisc_drop(skb, qdisc, to_free);
67 -static struct sk_buff *pfifo_fast_dequeue(struct Qdisc *qdisc)
69 - struct pfifo_fast_priv *priv = qdisc_priv(qdisc);
70 - int band = bitmap2band[priv->bitmap];
72 - if (likely(band >= 0)) {
73 - struct qdisc_skb_head *qh = band2list(priv, band);
74 - struct sk_buff *skb = __qdisc_dequeue_head(qh);
76 - if (likely(skb != NULL)) {
77 - qdisc_qstats_backlog_dec(qdisc, skb);
78 - qdisc_bstats_update(qdisc, skb);
83 - priv->bitmap &= ~(1 << band);
91 -static struct sk_buff *pfifo_fast_peek(struct Qdisc *qdisc)
93 - struct pfifo_fast_priv *priv = qdisc_priv(qdisc);
94 - int band = bitmap2band[priv->bitmap];
97 - struct qdisc_skb_head *qh = band2list(priv, band);
105 -static void pfifo_fast_reset(struct Qdisc *qdisc)
108 - struct pfifo_fast_priv *priv = qdisc_priv(qdisc);
110 - for (prio = 0; prio < PFIFO_FAST_BANDS; prio++)
111 - __qdisc_reset_queue(band2list(priv, prio));
114 - qdisc->qstats.backlog = 0;
118 -static int pfifo_fast_dump(struct Qdisc *qdisc, struct sk_buff *skb)
120 - struct tc_prio_qopt opt = { .bands = PFIFO_FAST_BANDS };
122 - memcpy(&opt.priomap, prio2band, TC_PRIO_MAX + 1);
123 - if (nla_put(skb, TCA_OPTIONS, sizeof(opt), &opt))
124 - goto nla_put_failure;
131 -static int pfifo_fast_init(struct Qdisc *qdisc, struct nlattr *opt)
134 - struct pfifo_fast_priv *priv = qdisc_priv(qdisc);
136 - for (prio = 0; prio < PFIFO_FAST_BANDS; prio++)
137 - qdisc_skb_head_init(band2list(priv, prio));
139 - /* Can by-pass the queue discipline */
140 - qdisc->flags |= TCQ_F_CAN_BYPASS;
144 -struct Qdisc_ops pfifo_fast_ops __read_mostly = {
145 - .id = "pfifo_fast",
146 - .priv_size = sizeof(struct pfifo_fast_priv),
147 - .enqueue = pfifo_fast_enqueue,
148 - .dequeue = pfifo_fast_dequeue,
149 - .peek = pfifo_fast_peek,
150 - .init = pfifo_fast_init,
151 - .reset = pfifo_fast_reset,
152 - .dump = pfifo_fast_dump,
153 - .owner = THIS_MODULE,
155 -EXPORT_SYMBOL(pfifo_fast_ops);
157 static struct lock_class_key qdisc_tx_busylock;
158 static struct lock_class_key qdisc_running_key;