Skip to contentSkip to conversation

: pkt_sched: Add qdisc_dequeue() helper.

PATCH In review David Miller 1 participant 1 message Aug 18, 2008

Subsystems (3)
lore
Share & tools
lore

David Miller

author maintainer
#0 lore raw

PATCH 3/9 : pkt_sched: Add qdisc_dequeue() helper.

pkt_sched: Add qdisc_dequeue() helper.

It prioritizes packets on the ->requeue list.

Use in qdisc_restart() as it's basically a complete copy of dequeue_skb().

---
 include/net/sch_generic.h |    8 ++++++++
 net/sched/sch_generic.c   |   13 +------------
 2 files changed, 9 insertions(+), 12 deletions(-)
include/net/sch_generic.h +8 -0
index 140c48b..6da6e0a 100644
@@ -355,6 +355,14 @@ enum net_xmit_qdisc_t {
 #define net_xmit_drop_count(e)	(1)
 #endif
 
+static inline struct sk_buff *qdisc_dequeue(struct Qdisc *sch)
+{
+	struct sk_buff *skb = __skb_dequeue(&sch->requeue);
+	if (!skb)
+		skb = sch->dequeue(sch);
+	return skb;
+}
+
 static inline int qdisc_enqueue(struct sk_buff *skb, struct Qdisc *sch)
 {
 #ifdef CONFIG_NET_SCHED
net/sched/sch_generic.c +1 -12
index 96d7d08..81e3dc4 100644
@@ -50,17 +50,6 @@ static inline int dev_requeue_skb(struct sk_buff *skb, struct Qdisc *q)
 	return 0;
 }
 
-static inline struct sk_buff *dequeue_skb(struct Qdisc *q)
-{
-	struct sk_buff *skb;
-
-	skb = __skb_dequeue(&q->requeue);
-	if (!skb)
-		skb = q->dequeue(q);
-
-	return skb;
-}
-
 static inline int handle_dev_cpu_collision(struct sk_buff *skb,
 					   struct netdev_queue *dev_queue,
 					   struct Qdisc *q)
@@ -119,7 +108,7 @@ static inline int qdisc_restart(struct Qdisc *q)
 	struct sk_buff *skb;
 
 	/* Dequeue packet */
-	if (unlikely((skb = dequeue_skb(q)) == NULL))
+	if (unlikely((skb = qdisc_dequeue(q)) == NULL))
 		return 0;
 
 	root_lock = qdisc_lock(q);
Signature · 1 line
1.5.6.5.GIT