Received: by 2002:a05:6a10:a852:0:0:0:0 with SMTP id d18csp1422897pxy; Thu, 6 May 2021 07:43:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy4HsAcP97S1i5g9bUk0wZxVjyuoT6T1pyBmlld13ogZjhGhk37UlDq5GQwRkf1huuAUYrf X-Received: by 2002:a65:6a0d:: with SMTP id m13mr4677827pgu.43.1620312201896; Thu, 06 May 2021 07:43:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620312201; cv=none; d=google.com; s=arc-20160816; b=KQpVWD8ruPzhSRkBhpcOyUevi8utTxV9VADVyTtpK412VNBfZfw+pq543JIkMp1PXT XE3jzk0YuCqiyNzPrTfYpQb62YSr9Y4o0gzhud6JNd9L8HyrcFB3fUi868dYCr8rM1eL FM1ityYzVLPIC7iuoLKSXo12dvt7uICMRGIl+IbjBLjw7zOt5Z1e/X4Bz5YVR/YJ+i/K XnsYME85NUyVnSfqx1MJSqhYr2Vss0IFm0aIHadqiIpjIgNmYI10/qr34YlDMuJhN5Gh IB3FO7CndhHGttPNHTQqxbcvXo8Zt4RVhOfJt3+Yv9N1FdZUBfydvoPcF67t1ws11aAg Wo9w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:user-agent:references:in-reply-to :subject:cc:to:from:date:content-transfer-encoding:mime-version :dkim-signature; bh=GuA+4sdxtI/hmbjVq0gs21HsQjNMUl4w3yNrwMHelvY=; b=KaFqIHKXGD2sWzULDLelluW4P781lgEgOZOpRZ5Y5KIFA9eFJlgOzhEC7WzagEFuBI 0HHBqfPFqQf4gC+7Qhjk5zJ0kJe1BkmBfsYdBEqoV1bPM7gpwv8Sx2Jt6+JO4rgzNgZ3 NzFpP4Pn+X5/NRuQ2/n5+g6KSzh2vhrCHoGHB7+bQ0JQOM5KAqapECRZ4rwi5EU4PTOz b29b0MdHuxz1q894RsksFLPRGpCO1RrGwbKhJJhom2/RM6/rOReHIRdFOzVA5/qiOG7b eZZTE7yXpC65cbMu6HJRRf6SWP0SImglT1VEC7zRb0or9epxilbgPBv5SyDFV2sDJQG5 aMIA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@walle.cc header.s=mail2016061301 header.b=suCseM4b; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d7si442315pfv.212.2021.05.06.07.43.09; Thu, 06 May 2021 07:43:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@walle.cc header.s=mail2016061301 header.b=suCseM4b; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234906AbhEFOm5 (ORCPT + 99 others); Thu, 6 May 2021 10:42:57 -0400 Received: from ssl.serverraum.org ([176.9.125.105]:46997 "EHLO ssl.serverraum.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234694AbhEFOmw (ORCPT ); Thu, 6 May 2021 10:42:52 -0400 Received: from ssl.serverraum.org (web.serverraum.org [172.16.0.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ssl.serverraum.org (Postfix) with ESMTPSA id D20892224B; Thu, 6 May 2021 16:41:51 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=walle.cc; s=mail2016061301; t=1620312112; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=GuA+4sdxtI/hmbjVq0gs21HsQjNMUl4w3yNrwMHelvY=; b=suCseM4bfzq/SZtMdL0bB6+YBUWFiltAu8P0KUiNA+3Drf/Om7pUpKABkLJ22IfZpVypJ0 9ZA6E7ehkh6GfoDCL2EXx2ZZM3FaKmJ9bgI56NsdJGLI/Y/6F3r2K8ujvH5kjOYJyMQ4uY 7c//1SnULrOVGD66kZ51XuYUEBSHUAA= MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Thu, 06 May 2021 16:41:51 +0200 From: Michael Walle To: Vladimir Oltean Cc: Vladimir Oltean , Xiaoliang Yang , UNGLinuxDriver@microchip.com, alexandre.belloni@bootlin.com, allan.nielsen@microchip.com, Claudiu Manoil , davem@davemloft.net, idosch@mellanox.com, joergen.andreasen@microchip.com, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, Po Liu , vinicius.gomes@intel.com Subject: Re: [net-next] net: dsa: felix: disable always guard band bit for TAS config In-Reply-To: <20210506135007.ul3gpdecq427tvgr@skbuf> References: <20210419102530.20361-1-xiaoliang.yang_1@nxp.com> <20210504170514.10729-1-michael@walle.cc> <20210504181833.w2pecbp2qpuiactv@skbuf> <20210504185040.ftkub3ropuacmyel@skbuf> <20210504191739.73oejybqb6z7dlxr@skbuf> <20210504213259.l5rbnyhxrrbkykyg@skbuf> <20210506135007.ul3gpdecq427tvgr@skbuf> User-Agent: Roundcube Webmail/1.4.11 Message-ID: <879df38ab1fb6d8fb8f371bfd5e8c213@walle.cc> X-Sender: michael@walle.cc Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Am 2021-05-06 15:50, schrieb Vladimir Oltean: > On Thu, May 06, 2021 at 03:25:07PM +0200, Michael Walle wrote: >> Am 2021-05-04 23:33, schrieb Vladimir Oltean: >> > [ trimmed the CC list, as this is most likely spam for most people ] >> > >> > On Tue, May 04, 2021 at 10:23:11PM +0200, Michael Walle wrote: >> > > Am 2021-05-04 21:17, schrieb Vladimir Oltean: >> > > > On Tue, May 04, 2021 at 09:08:00PM +0200, Michael Walle wrote: >> > > > > > > > > As explained in another mail in this thread, all queues are marked as >> > > > > > > > > scheduled. So this is actually a no-op, correct? It doesn't matter if >> > > > > > > > > it set or not set for now. Dunno why we even care for this bit then. >> > > > > > > > >> > > > > > > > It matters because ALWAYS_GUARD_BAND_SCH_Q reduces the available >> > > > > > > > throughput when set. >> > > > > > > >> > > > > > > Ahh, I see now. All queues are "scheduled" but the guard band only >> > > > > > > applies >> > > > > > > for "non-scheduled" -> "scheduled" transitions. So the guard band is >> > > > > > > never >> > > > > > > applied, right? Is that really what we want? >> > > > > > >> > > > > > Xiaoliang explained that yes, this is what we want. If the end user >> > > > > > wants a guard band they can explicitly add a "sched-entry 00" in the >> > > > > > tc-taprio config. >> > > > > >> > > > > You're disabling the guard band, then. I figured, but isn't that >> > > > > suprising for the user? Who else implements taprio? Do they do it in >> > > > > the >> > > > > same way? I mean this behavior is passed right to the userspace and >> > > > > have >> > > > > a direct impact on how it is configured. Of course a user can add it >> > > > > manually, but I'm not sure that is what we want here. At least it >> > > > > needs >> > > > > to be documented somewhere. Or maybe it should be a switchable option. >> > > > > >> > > > > Consider the following: >> > > > > sched-entry S 01 25000 >> > > > > sched-entry S fe 175000 >> > > > > basetime 0 >> > > > > >> > > > > Doesn't guarantee, that queue 0 is available at the beginning of >> > > > > the cycle, in the worst case it takes up to >> > > > > + ~12.5us until the frame makes it through (given >> > > > > gigabit and 1518b frames). >> > > > > >> > > > > Btw. there are also other implementations which don't need a guard >> > > > > band (because they are store-and-forward and cound the remaining >> > > > > bytes). So yes, using a guard band and scheduling is degrading the >> > > > > performance. >> > > > >> > > > What is surprising for the user, and I mentioned this already in another >> > > > thread on this patch, is that the Felix switch overruns the time gate (a >> > > > packet taking 2 us to transmit will start transmission even if there is >> > > > only 1 us left of its time slot, delaying the packets from the next time >> > > > slot by 1 us). I guess that this is why the ALWAYS_GUARD_BAND_SCH_Q bit >> > > > exists, as a way to avoid these overruns, but it is a bit of a poor tool >> > > > for that job. Anyway, right now we disable it and live with the >> > > > overruns. >> > > >> > > We are talking about the same thing here. Why is that a poor tool? >> > >> > It is a poor tool because it revolves around the idea of "scheduled >> > queues" and "non-scheduled queues". >> > >> > Consider the following tc-taprio schedule: >> > >> > sched-entry S 81 2000 # TC 7 and 0 open, all others closed >> > sched-entry S 82 2000 # TC 7 and 1 open, all others closed >> > sched-entry S 84 2000 # TC 7 and 2 open, all others closed >> > sched-entry S 88 2000 # TC 7 and 3 open, all others closed >> > sched-entry S 90 2000 # TC 7 and 4 open, all others closed >> > sched-entry S a0 2000 # TC 7 and 5 open, all others closed >> > sched-entry S c0 2000 # TC 7 and 6 open, all others closed >> > >> > Otherwise said, traffic class 7 should be able to send any time it >> > wishes. >> >> What is the use case behind that? TC7 (with the highest priority) >> may always take precedence of the other TCs, thus what is the point >> of having a dedicated window for the others. > > Worst case latency is obviously better for an intermittent stream (not > more than one packet in flight at a time) in TC7 than it is for any > stream in TC6-TC0. But intermittent streams in TC6-TC0 also have their > own worst case guarantees (assuming that 2000 ns is enough to fit one > TC 7 frame and one frame from the TC6-TC0 range). Oh and I missed that, TC0-TC6 probably won't work because that gate is too narrow (12.5us guard band) unless of course you set MAXSDU to a smaller value. Which would IMHO be the correct thing to do here. -michael