diff options
author | Patrick McHardy <kaber@trash.net> | 2008-10-31 03:44:18 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-10-31 03:44:18 -0400 |
commit | 48a8f519e0fe22a5c98523286b2a120841a11dd5 (patch) | |
tree | ec70428b026091669bf1e23779f9cfdd1a1ca46f /net/sched/sch_fifo.c | |
parent | 90d841fd0a5e02affd4e2bbdde4f710c61599281 (diff) |
pkt_sched: Add ->peek() methods for fifo, prio and SFQ qdiscs.
From: Patrick McHardy <kaber@trash.net>
Just as a demonstration how easy adding a peek operation to the
work-conserving qdiscs actually is. It doesn't need to keep or change
any internal state in many cases thanks to the guarantee that the
packet will either be dequeued or, if another packet arrives, the
upper qdisc will immediately ->peek again to reevaluate the state.
(This is only slightly modified Patrick's patch.)
Signed-off-by: Jarek Poplawski <jarkao2@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sched/sch_fifo.c')
-rw-r--r-- | net/sched/sch_fifo.c | 2 |
1 files changed, 2 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, |