diff options
author | Patrick McHardy <kaber@trash.net> | 2008-10-31 10:44:18 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-10-31 10:44:18 +0300 |
commit | 48a8f519e0fe22a5c98523286b2a120841a11dd5 (patch) | |
tree | ec70428b026091669bf1e23779f9cfdd1a1ca46f /include | |
parent | 90d841fd0a5e02affd4e2bbdde4f710c61599281 (diff) | |
download | linux-48a8f519e0fe22a5c98523286b2a120841a11dd5.tar.xz |
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 'include')
-rw-r--r-- | include/net/sch_generic.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/include/net/sch_generic.h b/include/net/sch_generic.h index f81f7c4d76fa..da6839a7ff50 100644 --- a/include/net/sch_generic.h +++ b/include/net/sch_generic.h @@ -433,6 +433,11 @@ static inline struct sk_buff *qdisc_dequeue_tail(struct Qdisc *sch) return __qdisc_dequeue_tail(sch, &sch->q); } +static inline struct sk_buff *qdisc_peek_head(struct Qdisc *sch) +{ + return skb_peek(&sch->q); +} + static inline int __qdisc_requeue(struct sk_buff *skb, struct Qdisc *sch, struct sk_buff_head *list) { |