Skip to contentSkip to conversation

sched: etf: Fix ordering of packets with same txtime

PATCH In review Vinicius Costa Gomes 2 participants 2 messages Oct 14, 2019 – Oct 16, 2019

Subsystems (4)
lore
Share & tools
lore

Vinicius Costa Gomes

author maintainer
#0 lore raw

PATCH 1/1 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")
---
 net/sched/sch_etf.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/sched/sch_etf.c +1 -1
index cebfb65d8556..b1da5589a0c6 100644
@@ -177,7 +177,7 @@ static int etf_enqueue_timesortedlist(struct sk_buff *nskb, struct Qdisc *sch,
 
 		parent = *p;
 		skb = rb_to_skb(parent);
-		if (ktime_after(txtime, skb->tstamp)) {
+		if (ktime_compare(txtime, skb->tstamp) >= 0) {
 			p = &parent->rb_right;
 			leftmost = false;
 		} else {
Signature · 1 line
2.23.0
maintainer
#1 lore raw

From: Vinicius Costa Gomes <[email protected]>
Date: Mon, 14 Oct 2019 13:38:22 -0700

Quoted 15 lines

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.

Quoted 6 lines

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

Fixes 25db26a91364 ("net/sched: Introduce the ETF Qdisc")

Applied and queued up for -stable, thank you.