aboutsummaryrefslogtreecommitdiffstats
path: root/include/net
diff options
context:
space:
mode:
authorPatrick McHardy <kaber@trash.net>2008-10-31 03:44:18 -0400
committerDavid S. Miller <davem@davemloft.net>2008-10-31 03:44:18 -0400
commit48a8f519e0fe22a5c98523286b2a120841a11dd5 (patch)
treeec70428b026091669bf1e23779f9cfdd1a1ca46f /include/net
parent90d841fd0a5e02affd4e2bbdde4f710c61599281 (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 'include/net')
-rw-r--r--include/net/sch_generic.h5
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)
433 return __qdisc_dequeue_tail(sch, &sch->q); 433 return __qdisc_dequeue_tail(sch, &sch->q);
434} 434}
435 435
436static inline struct sk_buff *qdisc_peek_head(struct Qdisc *sch)
437{
438 return skb_peek(&sch->q);
439}
440
436static inline int __qdisc_requeue(struct sk_buff *skb, struct Qdisc *sch, 441static inline int __qdisc_requeue(struct sk_buff *skb, struct Qdisc *sch,
437 struct sk_buff_head *list) 442 struct sk_buff_head *list)
438{ 443{