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 diff --git a/net/sched/sch_generic.c b/net/sched/sch_generic.c
12 index 97de97e3c5e2..a62de9e4e897 100644
13 --- a/net/sched/sch_generic.c
14 +++ b/net/sched/sch_generic.c
15 @@ -449,146 +449,6 @@ struct Qdisc_ops noqueue_qdisc_ops __read_mostly = {
19 -static const u8 prio2band[TC_PRIO_MAX + 1] = {
20 - 1, 2, 2, 2, 1, 2, 0, 0 , 1, 1, 1, 1, 1, 1, 1, 1
23 -/* 3-band FIFO queue: old style, but should be a bit faster than
24 - generic prio+fifo combination.
27 -#define PFIFO_FAST_BANDS 3
30 - * Private data for a pfifo_fast scheduler containing:
31 - * - queues for the three band
32 - * - bitmap indicating which of the bands contain skbs
34 -struct pfifo_fast_priv {
36 - struct qdisc_skb_head q[PFIFO_FAST_BANDS];
40 - * Convert a bitmap to the first band number where an skb is queued, where:
41 - * bitmap=0 means there are no skbs on any band.
42 - * bitmap=1 means there is an skb on band 0.
43 - * bitmap=7 means there are skbs on all 3 bands, etc.
45 -static const int bitmap2band[] = {-1, 0, 1, 0, 2, 0, 1, 0};
47 -static inline struct qdisc_skb_head *band2list(struct pfifo_fast_priv *priv,
50 - return priv->q + band;
53 -static int pfifo_fast_enqueue(struct sk_buff *skb, struct Qdisc *qdisc,
54 - struct sk_buff **to_free)
56 - if (qdisc->q.qlen < qdisc_dev(qdisc)->tx_queue_len) {
57 - int band = prio2band[skb->priority & TC_PRIO_MAX];
58 - struct pfifo_fast_priv *priv = qdisc_priv(qdisc);
59 - struct qdisc_skb_head *list = band2list(priv, band);
61 - priv->bitmap |= (1 << band);
63 - return __qdisc_enqueue_tail(skb, qdisc, list);
66 - return qdisc_drop(skb, qdisc, to_free);
69 -static struct sk_buff *pfifo_fast_dequeue(struct Qdisc *qdisc)
71 - struct pfifo_fast_priv *priv = qdisc_priv(qdisc);
72 - int band = bitmap2band[priv->bitmap];
74 - if (likely(band >= 0)) {
75 - struct qdisc_skb_head *qh = band2list(priv, band);
76 - struct sk_buff *skb = __qdisc_dequeue_head(qh);
78 - if (likely(skb != NULL)) {
79 - qdisc_qstats_backlog_dec(qdisc, skb);
80 - qdisc_bstats_update(qdisc, skb);
85 - priv->bitmap &= ~(1 << band);
93 -static struct sk_buff *pfifo_fast_peek(struct Qdisc *qdisc)
95 - struct pfifo_fast_priv *priv = qdisc_priv(qdisc);
96 - int band = bitmap2band[priv->bitmap];
99 - struct qdisc_skb_head *qh = band2list(priv, band);
107 -static void pfifo_fast_reset(struct Qdisc *qdisc)
110 - struct pfifo_fast_priv *priv = qdisc_priv(qdisc);
112 - for (prio = 0; prio < PFIFO_FAST_BANDS; prio++)
113 - __qdisc_reset_queue(band2list(priv, prio));
116 - qdisc->qstats.backlog = 0;
120 -static int pfifo_fast_dump(struct Qdisc *qdisc, struct sk_buff *skb)
122 - struct tc_prio_qopt opt = { .bands = PFIFO_FAST_BANDS };
124 - memcpy(&opt.priomap, prio2band, TC_PRIO_MAX + 1);
125 - if (nla_put(skb, TCA_OPTIONS, sizeof(opt), &opt))
126 - goto nla_put_failure;
133 -static int pfifo_fast_init(struct Qdisc *qdisc, struct nlattr *opt)
136 - struct pfifo_fast_priv *priv = qdisc_priv(qdisc);
138 - for (prio = 0; prio < PFIFO_FAST_BANDS; prio++)
139 - qdisc_skb_head_init(band2list(priv, prio));
141 - /* Can by-pass the queue discipline */
142 - qdisc->flags |= TCQ_F_CAN_BYPASS;
146 -struct Qdisc_ops pfifo_fast_ops __read_mostly = {
147 - .id = "pfifo_fast",
148 - .priv_size = sizeof(struct pfifo_fast_priv),
149 - .enqueue = pfifo_fast_enqueue,
150 - .dequeue = pfifo_fast_dequeue,
151 - .peek = pfifo_fast_peek,
152 - .init = pfifo_fast_init,
153 - .reset = pfifo_fast_reset,
154 - .dump = pfifo_fast_dump,
155 - .owner = THIS_MODULE,
157 -EXPORT_SYMBOL(pfifo_fast_ops);
159 static struct lock_class_key qdisc_tx_busylock;
160 static struct lock_class_key qdisc_running_key;