aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/sch_generic.h
diff options
context:
space:
mode:
authorFlorian Westphal <fw@strlen.de>2016-09-17 18:57:32 -0400
committerDavid S. Miller <davem@davemloft.net>2016-09-19 01:47:18 -0400
commitec323368793b8570c02e723127611a8d906a9b3f (patch)
treeee315766586d253172ec75a7591fba9326a08745 /include/net/sch_generic.h
parent97d0678f913369af0dc8b510a682a641654ab743 (diff)
sched: remove qdisc arg from __qdisc_dequeue_head
Moves qdisc stat accouting to qdisc_dequeue_head. The only direct caller of the __qdisc_dequeue_head version open-codes this now. This allows us to later use __qdisc_dequeue_head as a replacement of __skb_dequeue() (which operates on sk_buff_head list). Signed-off-by: Florian Westphal <fw@strlen.de> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/sch_generic.h')
-rw-r--r--include/net/sch_generic.h15
1 files changed, 8 insertions, 7 deletions
diff --git a/include/net/sch_generic.h b/include/net/sch_generic.h
index 52a2015667b4..0741ed41575b 100644
--- a/include/net/sch_generic.h
+++ b/include/net/sch_generic.h
@@ -614,11 +614,17 @@ static inline int qdisc_enqueue_tail(struct sk_buff *skb, struct Qdisc *sch)
614 return __qdisc_enqueue_tail(skb, sch, &sch->q); 614 return __qdisc_enqueue_tail(skb, sch, &sch->q);
615} 615}
616 616
617static inline struct sk_buff *__qdisc_dequeue_head(struct Qdisc *sch, 617static inline struct sk_buff *__qdisc_dequeue_head(struct sk_buff_head *list)
618 struct sk_buff_head *list)
619{ 618{
620 struct sk_buff *skb = __skb_dequeue(list); 619 struct sk_buff *skb = __skb_dequeue(list);
621 620
621 return skb;
622}
623
624static inline struct sk_buff *qdisc_dequeue_head(struct Qdisc *sch)
625{
626 struct sk_buff *skb = __qdisc_dequeue_head(&sch->q);
627
622 if (likely(skb != NULL)) { 628 if (likely(skb != NULL)) {
623 qdisc_qstats_backlog_dec(sch, skb); 629 qdisc_qstats_backlog_dec(sch, skb);
624 qdisc_bstats_update(sch, skb); 630 qdisc_bstats_update(sch, skb);
@@ -627,11 +633,6 @@ static inline struct sk_buff *__qdisc_dequeue_head(struct Qdisc *sch,
627 return skb; 633 return skb;
628} 634}
629 635
630static inline struct sk_buff *qdisc_dequeue_head(struct Qdisc *sch)
631{
632 return __qdisc_dequeue_head(sch, &sch->q);
633}
634
635/* Instead of calling kfree_skb() while root qdisc lock is held, 636/* Instead of calling kfree_skb() while root qdisc lock is held,
636 * queue the skb for future freeing at end of __dev_xmit_skb() 637 * queue the skb for future freeing at end of __dev_xmit_skb()
637 */ 638 */