aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/net/sch_generic.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/include/net/sch_generic.h b/include/net/sch_generic.h
index da6839a7ff50..9dcb5bfe094a 100644
--- a/include/net/sch_generic.h
+++ b/include/net/sch_generic.h
@@ -438,6 +438,29 @@ static inline struct sk_buff *qdisc_peek_head(struct Qdisc *sch)
438 return skb_peek(&sch->q); 438 return skb_peek(&sch->q);
439} 439}
440 440
441/* generic pseudo peek method for non-work-conserving qdisc */
442static inline struct sk_buff *qdisc_peek_dequeued(struct Qdisc *sch)
443{
444 /* we can reuse ->gso_skb because peek isn't called for root qdiscs */
445 if (!sch->gso_skb)
446 sch->gso_skb = sch->dequeue(sch);
447
448 return sch->gso_skb;
449}
450
451/* use instead of qdisc->dequeue() for all qdiscs queried with ->peek() */
452static inline struct sk_buff *qdisc_dequeue_peeked(struct Qdisc *sch)
453{
454 struct sk_buff *skb = sch->gso_skb;
455
456 if (skb)
457 sch->gso_skb = NULL;
458 else
459 skb = sch->dequeue(sch);
460
461 return skb;
462}
463
441static inline int __qdisc_requeue(struct sk_buff *skb, struct Qdisc *sch, 464static inline int __qdisc_requeue(struct sk_buff *skb, struct Qdisc *sch,
442 struct sk_buff_head *list) 465 struct sk_buff_head *list)
443{ 466{