Skip to contentSkip to conversation

: sch_netem: Use requeue list instead of ops->requeue()

PATCH In review David Miller 2 participants 2 messages Aug 18, 2008 – Aug 19, 2008

Subsystems (4)
lore
Share & tools
lore

David Miller

author maintainer
#0 lore raw

PATCH 5/9 : sch_netem: Use requeue list instead of ops->requeue()

sch_netem: Use requeue list instead of ops->requeue()

This code just wants to make this packet the "front" one, and that's just as simply done by queueing to the ->requeue list.

---
 net/sched/sch_netem.c |   11 +++--------
 1 files changed, 3 insertions(+), 8 deletions(-)
net/sched/sch_netem.c +3 -8
index dbd567f..7e15c0b 100644
@@ -233,7 +233,8 @@ 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_tail(&q->qdisc->requeue, skb);
+		ret = NET_XMIT_SUCCESS;
 	}
 
 	if (likely(ret == NET_XMIT_SUCCESS)) {
@@ -295,13 +296,7 @@ static struct sk_buff *netem_dequeue(struct Qdisc *sch)
 			return skb;
 		}
 
-		if (unlikely(q->qdisc->ops->requeue(skb, q->qdisc) != NET_XMIT_SUCCESS)) {
-			qdisc_tree_decrease_qlen(q->qdisc, 1);
-			sch->qstats.drops++;
-			printk(KERN_ERR "netem: %s could not requeue\n",
-			       q->qdisc->ops->id);
-		}
-
+		__skb_queue_tail(&q->qdisc->requeue, skb);
 		qdisc_watchdog_schedule(&q->watchdog, cb->time_to_send);
 	}
 
Signature · 1 line
1.5.6.5.GIT
#1 lore raw
Quoted 5 lines · David Miller

sch_netem: Use requeue list instead of ops->requeue()

This code just wants to make this packet the "front" one, and that's just as simply done by queueing to the ->requeue list.

Hi,
I think that might make some difference.
Suppose we have an upper qdisc that dequeues from netem and puts the packet in it's requeue-list. But after that another packet could arrive that should be send earlier (delay distribution, reordering).
As far as I understand it the requeued packet would now be send before the other.

net/sched/sch_netem.c static int netem_enqueue(struct sk_buff *skb, struct Qdisc *sch) · line 236

Quoted 8 lines
net/sched/sch_netem.c +1 -1
@@ -233,7 +233,8 @@ 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_tail(&q->qdisc->requeue, skb);

I think this should be __skb_queue_head() because in it's requeue-list netem has packets that it doesn't want to send yet. So their time_to_send is likely to be in the future. But reordered packets have current time as time_to_send.

Or did I get it wrong?

Regards
Bastian Bloessl