netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net v1] sched: etf: Fix ordering of packets with same txtime
@ 2019-10-14 20:38 Vinicius Costa Gomes
  2019-10-16  3:33 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Vinicius Costa Gomes @ 2019-10-14 20:38 UTC (permalink / raw)
  To: netdev
  Cc: Vinicius Costa Gomes, jhs, xiyou.wangcong, jiri, davem, Ederson de Souza

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>
---
 net/sched/sch_etf.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/sched/sch_etf.c b/net/sched/sch_etf.c
index cebfb65d8556..b1da5589a0c6 100644
--- a/net/sched/sch_etf.c
+++ b/net/sched/sch_etf.c
@@ -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 {
-- 
2.23.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH net v1] sched: etf: Fix ordering of packets with same txtime
  2019-10-14 20:38 [PATCH net v1] sched: etf: Fix ordering of packets with same txtime Vinicius Costa Gomes
@ 2019-10-16  3:33 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2019-10-16  3:33 UTC (permalink / raw)
  To: vinicius.gomes; +Cc: netdev, jhs, xiyou.wangcong, jiri, ederson.desouza

From: Vinicius Costa Gomes <vinicius.gomes@intel.com>
Date: Mon, 14 Oct 2019 13:38:22 -0700

> 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>

Applied and queued up for -stable, thank you.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-10-16  3:33 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-14 20:38 [PATCH net v1] sched: etf: Fix ordering of packets with same txtime Vinicius Costa Gomes
2019-10-16  3:33 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).