Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp2251317ybg; Sun, 27 Oct 2019 14:24:26 -0700 (PDT) X-Google-Smtp-Source: APXvYqw2hJXG86GnQbCBbEa87ND3IHhw8GG04xXzxwLHI3fqLywWLlXkVXC0MMMFvIm4pdacRPVW X-Received: by 2002:a17:906:1f09:: with SMTP id w9mr4543048ejj.35.1572211466366; Sun, 27 Oct 2019 14:24:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1572211466; cv=none; d=google.com; s=arc-20160816; b=qBNPxaZ/O2rm+OJDGOmpweHWUMjKG9gluAnsaGFzbGD54z+koEDrLiJHa6sK68uzEb xpOeg8BG2wib6A1oK5mEE+tIKOH5MojkmmyKtnZalVU3IaXZsvHZOv0/JCRT2e6LJ8/g lqDLACth0tdpvgweAVp+PImmvwUTGiVv79m+cTSnFksSkGxUwlXpPrN+DyL/rjo+c+b7 pXHrFNPqM7z8+jQn+Fwy3QWNGutm/9De/sHE0Dw3qqScNs/uJtk2ReRptIcLlh6yeIVg 5T7FAphQd2Pg5oex2y6MH7lqmnvHoBcBS1BfOTED6X/5UL4/9FjFOg0pyjqMnWyN5IjM rfCA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=XLrbcb+b0CU6NAq7mUhVA7/ZR6Vx93jc5KBnkoeSMxw=; b=Yf5NAa5M74TftTJUqSV9ByPsIw2m9LRgjBZah0oDUA6/FiKjRXed5NIJn5vclNrRcG Kr9YHMgEES8IOnljzvljssmHgIceeYo3p6NkaNZbl9OSmmx+tHmRq18ygfbCnYJyYUHz 3oFMTX3tiBeFG9XG/iTF3QSMkR7QBA/GUNjUSKkYJfXP3lW+vAQ3OyBKkIKfUYXfL0T6 KI/2cLG0MtiP9l6VwkZcLQNCTwGPW1EgI5oGlhMUzSaSwr8X2FmeQUmM18QG+Nv4Vivm MtoltJjvtDczQYhYrxvS8I9hbOI4T9E37PYAVRlE5clgR0M6zWvfRjcd3MeU4SHJg0Rf Omyg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=u8IjIzWo; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c24si6702387edb.328.2019.10.27.14.24.02; Sun, 27 Oct 2019 14:24:26 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=u8IjIzWo; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731759AbfJ0VUm (ORCPT + 99 others); Sun, 27 Oct 2019 17:20:42 -0400 Received: from mail.kernel.org ([198.145.29.99]:41292 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728941AbfJ0VUk (ORCPT ); Sun, 27 Oct 2019 17:20:40 -0400 Received: from localhost (100.50.158.77.rev.sfr.net [77.158.50.100]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 3FC5D205C9; Sun, 27 Oct 2019 21:20:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1572211239; bh=4HTSAcKMHHhArRvWh4ks/beeLB7R+fEj+N19kWOwOaU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=u8IjIzWoCtPDrsFpb7sAa7NaPHYlBfpu7QEjIW12uYJlUrhqmsoegRzAazqegkkgr ZTDsVj3Xs4UJJsomT2J3HHM7MBT7NF9WnRt+5xsCJfJ8gEsBP0SoubXxd5hXFUhAKD lhaoUusy+JonRUHvp9qBHCjjiBw2jh0UUjRVVIRo= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Ederson de Souza , Vinicius Costa Gomes , "David S. Miller" Subject: [PATCH 5.3 079/197] sched: etf: Fix ordering of packets with same txtime Date: Sun, 27 Oct 2019 21:59:57 +0100 Message-Id: <20191027203355.952831914@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191027203351.684916567@linuxfoundation.org> References: <20191027203351.684916567@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Vinicius Costa Gomes [ Upstream commit 28aa7c86c2b49f659c8460a89e53b506c45979bb ] 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 Signed-off-by: Vinicius Costa Gomes Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- net/sched/sch_etf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/net/sched/sch_etf.c +++ b/net/sched/sch_etf.c @@ -177,7 +177,7 @@ static int etf_enqueue_timesortedlist(st 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 {