Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

sched: etf: Fix ordering of packets with same txtime

When a application sends many packets with the same txtime, they may
be transmitted out of order (different from the order in which they
were enqueued).

This happens because when inserting elements into the tree, when the
txtime of two packets are the same, the new packet is inserted at the
left side of the tree, causing the reordering. The only effect of this
change should be that packets with the same txtime will be transmitted
in the order they are enqueued.

The application in question (the AVTP GStreamer plugin, still in
development) is sending video traffic, in which each video frame have
a single presentation time, the problem is that when packetizing,
multiple packets end up with the same txtime.

The receiving side was rejecting packets because they were being
received out of order.

Fixes: 25db26a91364 ("net/sched: Introduce the ETF Qdisc")
Reported-by: Ederson de Souza <ederson.desouza@intel.com>
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Vinicius Costa Gomes and committed by
David S. Miller
28aa7c86 39f13ea2

+1 -1
+1 -1
net/sched/sch_etf.c
··· 177 177 178 178 parent = *p; 179 179 skb = rb_to_skb(parent); 180 - if (ktime_after(txtime, skb->tstamp)) { 180 + if (ktime_compare(txtime, skb->tstamp) >= 0) { 181 181 p = &parent->rb_right; 182 182 leftmost = false; 183 183 } else {