Patchwork [2/2] sch_netem: Replace ->requeue() method with open code

login
register
mail settings
Submitter Jarek Poplawski
Date Oct. 31, 2008, 1:20 p.m.
Message ID <20081031132029.GB18895@ff.dom.local>
Download mbox | patch
Permalink /patch/6698/
State Accepted
Delegated to: David Miller
Headers show

Comments

Jarek Poplawski - Oct. 31, 2008, 1:20 p.m.
After removing netem classful functionality we are sure its inner
qdisc is tfifo, so we can replace qdisc->ops->requeue() method with
open code. After this patch there are no more ops->requeue() users.

The idea of this patch is by Patrick McHardy.

Signed-off-by: Jarek Poplawski <jarkao2@gmail.com>

Patch

diff --git a/net/sched/sch_netem.c b/net/sched/sch_netem.c
index 2ad0959..1aa4345 100644
--- a/net/sched/sch_netem.c
+++ b/net/sched/sch_netem.c
@@ -233,7 +233,11 @@  static int netem_enqueue(struct sk_buff *skb, struct Qdisc *sch)
 		 */
 		cb->time_to_send = psched_get_time();
 		q->counter = 0;
-		ret = q->qdisc->ops->requeue(skb, q->qdisc);
+
+		__skb_queue_head(&q->qdisc->q, skb);
+		q->qdisc->qstats.backlog += qdisc_pkt_len(skb);
+		q->qdisc->qstats.requeues++;
+		ret = NET_XMIT_SUCCESS;
 	}
 
 	if (likely(ret == NET_XMIT_SUCCESS)) {