aboutsummaryrefslogtreecommitdiffstats
path: root/net/sched
diff options
context:
space:
mode:
authorMaciej Żenczykowski <maze@google.com>2013-11-14 11:50:43 -0500
committerDavid S. Miller <davem@davemloft.net>2013-11-14 17:16:07 -0500
commit2abc2f070eb30ac8421554a5c32229f8332c6206 (patch)
tree3446c060181efebf51a78b05a85bccb99012a764 /net/sched
parentb54629e226d196e802abdd30c5e34f2a47cddcf2 (diff)
pkt_sched: fq: change classification of control packets
Initial sch_fq implementation copied code from pfifo_fast to classify a packet as a high prio packet. This clashes with setups using PRIO with say 7 bands, as one of the band could be incorrectly (mis)classified by FQ. Packets would be queued in the 'internal' queue, and no pacing ever happen for this special queue. Fixes: afe4fd062416 ("pkt_sched: fq: Fair Queue packet scheduler") Signed-off-by: Maciej Żenczykowski <maze@google.com> Signed-off-by: Eric Dumazet <edumazet@google.com> Cc: Stephen Hemminger <stephen@networkplumber.org> Cc: Willem de Bruijn <willemb@google.com> Cc: Yuchung Cheng <ycheng@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sched')
-rw-r--r--net/sched/sch_fq.c8
1 files changed, 1 insertions, 7 deletions
diff --git a/net/sched/sch_fq.c b/net/sched/sch_fq.c
index fdc041c57853..d4fa38e4af80 100644
--- a/net/sched/sch_fq.c
+++ b/net/sched/sch_fq.c
@@ -209,21 +209,15 @@ static void fq_gc(struct fq_sched_data *q,
209 } 209 }
210} 210}
211 211
212static const u8 prio2band[TC_PRIO_MAX + 1] = {
213 1, 2, 2, 2, 1, 2, 0, 0 , 1, 1, 1, 1, 1, 1, 1, 1
214};
215
216static struct fq_flow *fq_classify(struct sk_buff *skb, struct fq_sched_data *q) 212static struct fq_flow *fq_classify(struct sk_buff *skb, struct fq_sched_data *q)
217{ 213{
218 struct rb_node **p, *parent; 214 struct rb_node **p, *parent;
219 struct sock *sk = skb->sk; 215 struct sock *sk = skb->sk;
220 struct rb_root *root; 216 struct rb_root *root;
221 struct fq_flow *f; 217 struct fq_flow *f;
222 int band;
223 218
224 /* warning: no starvation prevention... */ 219 /* warning: no starvation prevention... */
225 band = prio2band[skb->priority & TC_PRIO_MAX]; 220 if (unlikely((skb->priority & TC_PRIO_MAX) == TC_PRIO_CONTROL))
226 if (unlikely(band == 0))
227 return &q->internal; 221 return &q->internal;
228 222
229 if (unlikely(!sk)) { 223 if (unlikely(!sk)) {