diff options
Diffstat (limited to 'net/sched')
-rw-r--r-- | net/sched/sch_fifo.c | 2 | ||||
-rw-r--r-- | net/sched/sch_prio.c | 14 | ||||
-rw-r--r-- | net/sched/sch_sfq.c | 12 |
3 files changed, 28 insertions, 0 deletions
diff --git a/net/sched/sch_fifo.c b/net/sched/sch_fifo.c index 23d258bfe8ac..8825e8806f41 100644 --- a/net/sched/sch_fifo.c +++ b/net/sched/sch_fifo.c | |||
@@ -83,6 +83,7 @@ struct Qdisc_ops pfifo_qdisc_ops __read_mostly = { | |||
83 | .priv_size = sizeof(struct fifo_sched_data), | 83 | .priv_size = sizeof(struct fifo_sched_data), |
84 | .enqueue = pfifo_enqueue, | 84 | .enqueue = pfifo_enqueue, |
85 | .dequeue = qdisc_dequeue_head, | 85 | .dequeue = qdisc_dequeue_head, |
86 | .peek = qdisc_peek_head, | ||
86 | .requeue = qdisc_requeue, | 87 | .requeue = qdisc_requeue, |
87 | .drop = qdisc_queue_drop, | 88 | .drop = qdisc_queue_drop, |
88 | .init = fifo_init, | 89 | .init = fifo_init, |
@@ -98,6 +99,7 @@ struct Qdisc_ops bfifo_qdisc_ops __read_mostly = { | |||
98 | .priv_size = sizeof(struct fifo_sched_data), | 99 | .priv_size = sizeof(struct fifo_sched_data), |
99 | .enqueue = bfifo_enqueue, | 100 | .enqueue = bfifo_enqueue, |
100 | .dequeue = qdisc_dequeue_head, | 101 | .dequeue = qdisc_dequeue_head, |
102 | .peek = qdisc_peek_head, | ||
101 | .requeue = qdisc_requeue, | 103 | .requeue = qdisc_requeue, |
102 | .drop = qdisc_queue_drop, | 104 | .drop = qdisc_queue_drop, |
103 | .init = fifo_init, | 105 | .init = fifo_init, |
diff --git a/net/sched/sch_prio.c b/net/sched/sch_prio.c index 504a78cdb718..3651da3e2802 100644 --- a/net/sched/sch_prio.c +++ b/net/sched/sch_prio.c | |||
@@ -120,6 +120,19 @@ prio_requeue(struct sk_buff *skb, struct Qdisc* sch) | |||
120 | return ret; | 120 | return ret; |
121 | } | 121 | } |
122 | 122 | ||
123 | static struct sk_buff *prio_peek(struct Qdisc *sch) | ||
124 | { | ||
125 | struct prio_sched_data *q = qdisc_priv(sch); | ||
126 | int prio; | ||
127 | |||
128 | for (prio = 0; prio < q->bands; prio++) { | ||
129 | struct Qdisc *qdisc = q->queues[prio]; | ||
130 | struct sk_buff *skb = qdisc->ops->peek(qdisc); | ||
131 | if (skb) | ||
132 | return skb; | ||
133 | } | ||
134 | return NULL; | ||
135 | } | ||
123 | 136 | ||
124 | static struct sk_buff *prio_dequeue(struct Qdisc* sch) | 137 | static struct sk_buff *prio_dequeue(struct Qdisc* sch) |
125 | { | 138 | { |
@@ -421,6 +434,7 @@ static struct Qdisc_ops prio_qdisc_ops __read_mostly = { | |||
421 | .priv_size = sizeof(struct prio_sched_data), | 434 | .priv_size = sizeof(struct prio_sched_data), |
422 | .enqueue = prio_enqueue, | 435 | .enqueue = prio_enqueue, |
423 | .dequeue = prio_dequeue, | 436 | .dequeue = prio_dequeue, |
437 | .peek = prio_peek, | ||
424 | .requeue = prio_requeue, | 438 | .requeue = prio_requeue, |
425 | .drop = prio_drop, | 439 | .drop = prio_drop, |
426 | .init = prio_init, | 440 | .init = prio_init, |
diff --git a/net/sched/sch_sfq.c b/net/sched/sch_sfq.c index fe1508ef0d3d..198b83d42ba8 100644 --- a/net/sched/sch_sfq.c +++ b/net/sched/sch_sfq.c | |||
@@ -391,8 +391,19 @@ sfq_requeue(struct sk_buff *skb, struct Qdisc *sch) | |||
391 | return NET_XMIT_CN; | 391 | return NET_XMIT_CN; |
392 | } | 392 | } |
393 | 393 | ||
394 | static struct sk_buff * | ||
395 | sfq_peek(struct Qdisc *sch) | ||
396 | { | ||
397 | struct sfq_sched_data *q = qdisc_priv(sch); | ||
398 | sfq_index a; | ||
394 | 399 | ||
400 | /* No active slots */ | ||
401 | if (q->tail == SFQ_DEPTH) | ||
402 | return NULL; | ||
395 | 403 | ||
404 | a = q->next[q->tail]; | ||
405 | return skb_peek(&q->qs[a]); | ||
406 | } | ||
396 | 407 | ||
397 | static struct sk_buff * | 408 | static struct sk_buff * |
398 | sfq_dequeue(struct Qdisc *sch) | 409 | sfq_dequeue(struct Qdisc *sch) |
@@ -624,6 +635,7 @@ static struct Qdisc_ops sfq_qdisc_ops __read_mostly = { | |||
624 | .priv_size = sizeof(struct sfq_sched_data), | 635 | .priv_size = sizeof(struct sfq_sched_data), |
625 | .enqueue = sfq_enqueue, | 636 | .enqueue = sfq_enqueue, |
626 | .dequeue = sfq_dequeue, | 637 | .dequeue = sfq_dequeue, |
638 | .peek = sfq_peek, | ||
627 | .requeue = sfq_requeue, | 639 | .requeue = sfq_requeue, |
628 | .drop = sfq_drop, | 640 | .drop = sfq_drop, |
629 | .init = sfq_init, | 641 | .init = sfq_init, |