[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20081014095502.GK10804@ff.dom.local>
Date: Tue, 14 Oct 2008 09:55:03 +0000
From: Jarek Poplawski <jarkao2@...il.com>
To: David Miller <davem@...emloft.net>
Cc: netdev@...r.kernel.org
Subject: [PATCH 10/14] pkt_sched: Redo qdisc_dequeue() and bring back
qdisc_requeue().
Use __qdisc_dequeue_head() and update sch->q.qlen in qdisc_dequeue().
Bring back qdisc_requeue() wrapper to raplace open-coded uses of
sch->requeue.
Signed-off-by: Jarek Poplawski <jarkao2@...il.com>
---
include/net/sch_generic.h | 29 +++++++++++++++++++++--------
1 files changed, 21 insertions(+), 8 deletions(-)
diff --git a/include/net/sch_generic.h b/include/net/sch_generic.h
index f3f0b0b..78c38a4 100644
--- a/include/net/sch_generic.h
+++ b/include/net/sch_generic.h
@@ -368,14 +368,6 @@ 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
@@ -439,6 +431,26 @@ static inline struct sk_buff *qdisc_dequeue_tail(struct Qdisc *sch)
return __qdisc_dequeue_tail(sch, &sch->q);
}
+static inline struct sk_buff *qdisc_dequeue(struct Qdisc *sch)
+{
+ struct sk_buff *skb = __qdisc_dequeue_head(sch, &sch->requeue);
+
+ if (unlikely(skb))
+ sch->q.qlen--;
+ else
+ skb = sch->dequeue(sch);
+
+ return skb;
+}
+
+static inline void qdisc_requeue(struct Qdisc *sch, struct sk_buff *skb)
+{
+ __skb_queue_head(&sch->requeue, skb);
+ sch->qstats.backlog += qdisc_pkt_len(skb);
+ sch->qstats.requeues++;
+ sch->q.qlen++;
+}
+
static inline void __qdisc_reset_queue(struct Qdisc *sch,
struct sk_buff_head *list)
{
@@ -452,6 +464,7 @@ static inline void __qdisc_reset_queue(struct Qdisc *sch,
static inline void qdisc_reset_queue(struct Qdisc *sch)
{
__qdisc_reset_queue(sch, &sch->q);
+ __qdisc_reset_queue(sch, &sch->requeue);
sch->qstats.backlog = 0;
}
--
1.5.6.5
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists