If packets are sent to the netem queue at the same time, they will be
reversed, even if re-ordering has not been enabled.

The problem is in sch_netem.c line 467:
if (PSCHED_TLESS(cb->time_to_send, ncb->time_to_send))

The queue is being traversed from back to front.  If A and B are sent at the
same time, the queue will result in B, A.  Logically the operation to find the
queue position should be: <= instead of <.   

Replacing that line with:
if (!PSCHED_TLESS(ncb->time_to_send, cb->time_to_send))
solves the problem.


here is a diff:
diff --git a/net/sched/sch_netem.c b/net/sched/sch_netem.c
index cdc8d28..82fb07a 100644
--- a/net/sched/sch_netem.c
+++ b/net/sched/sch_netem.c
@@ -464,7 +464,7 @@ static int tfifo_enqueue(struct sk_buff 
                        const struct netem_skb_cb *cb
                                = (const struct netem_skb_cb *)skb->cb;

-                       if (PSCHED_TLESS(cb->time_to_send, ncb->time_to_send))
+                       if (!PSCHED_TLESS(ncb->time_to_send, cb->time_to_send))
                                break;
                }

-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to