[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20191120152534.2041788e@cakuba.netronome.com>
Date: Wed, 20 Nov 2019 15:25:34 -0800
From: Jakub Kicinski <jakub.kicinski@...ronome.com>
To: Petr Machata <petrm@...lanox.com>
Cc: "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
Ido Schimmel <idosch@...lanox.com>,
Roopa Prabhu <roopa@...ulusnetworks.com>
Subject: Re: [RFC PATCH 00/10] Add a new Qdisc, ETS
On Wed, 20 Nov 2019 13:05:08 +0000, Petr Machata wrote:
> The IEEE standard 802.1Qaz (and 802.1Q-2014) specifies four principal
> transmission selection algorithms: strict priority, credit-based shaper,
> ETS (bandwidth sharing), and vendor-specific. All these have their
> corresponding knobs in DCB. But DCB does not have interfaces to configure
> RED and ECN, unlike Qdiscs.
>
> In the Qdisc land, strict priority is implemented by PRIO. Credit-based
> transmission selection algorithm can then be modeled by having e.g. TBF or
> CBS Qdisc below some of the PRIO bands. ETS would then be modeled by
> placing a DRR Qdisc under the last PRIO band.
>
> The problem with this approach is that DRR on its own, as well as the
> combination of PRIO and DRR, are tricky to configure and tricky to offload
> to 802.1Qaz-compliant hardware. This is due to several reasons:
>
> - As any classful Qdisc, DRR supports adding classifiers to decide in which
> class to enqueue packets. Unlike PRIO, there's however no fallback in the
> form of priomap. A way to achieve classification based on packet priority
> is e.g. like this:
>
> # tc filter add dev swp1 root handle 1: \
> basic match 'meta(priority eq 0)' flowid 1:10
>
> Expressing the priomap in this manner however forces drivers to deep dive
> into the classifier block to parse the individual rules.
>
> A possible solution would be to extend the classes with a "defmap" a la
> split / defmap mechanism of CBQ, and introduce this as a last resort
> classification. However, unlike priomap, this doesn't have the guarantee
> of covering all priorities. Traffic whose priority is not covered is
> dropped by DRR as unclassified. But ASICs tend to implement dropping in
> the ACL block, not in scheduling pipelines. The need to treat these
> configurations correctly (if only to decide to not offload at all)
> complicates a driver.
>
> It's not clear how to retrofit priomap with all its benefits to DRR
> without changing it beyond recognition.
>
> - The interplay between PRIO and DRR is also causing problems. 802.1Qaz has
> all ETS TCs as a last resort. I believe switch ASICs that support ETS at
> all will handle ETS traffic likewise. However the Linux model is more
> generic, allowing the DRR block in any band. Drivers would need to be
> careful to handle this case correctly, otherwise the offloaded model
> might not match the slow-path one.
>
> In a similar vein, PRIO and DRR need to agree on the list of priorities
> assigned to DRR. This is doubly problematic--the user needs to take care
> to keep the two in sync, and the driver needs to watch for any holes in
> DRR coverage and treat the traffic correctly, as discussed above.
>
> Note that at the time that DRR Qdisc is added, it has no classes, and
> thus any priorities assigned to that PRIO band are not covered. Thus this
> case is surprisingly rather common, and needs to be handled gracefully by
> the driver.
>
> - Similarly due to DRR flexibility, when a Qdisc (such as RED) is attached
> below it, it is not immediately clear which TC the class represents. This
> is unlike PRIO with its straightforward classid scheme. When DRR is
> combined with PRIO, the relationship between classes and TCs gets even
> more murky.
>
> This is a problem for users as well: the TC mapping is rather important
> for (devlink) shared buffer configuration and (ethtool) counters.
IMHO adding an API to simplify HW config is a double edged sword.
I think everyone will appreciate the simplicity of the new interface..
until the HW gets a little more smart and then we'll all have to
go back to the full interface and offload both that and the simple one,
or keep growing the new interface (for all practical sense just for HW)
Qdisc.
Having written a MQ+GRED offload I sympathize with the complexity
concerns, also trying to explain how to set up such Qdiscs to users
results in a lot of blank stares.
Is there any chance at all we could simplify things by adding a better
user interface and a common translation layer in front of the drivers?
Powered by blists - more mailing lists