From: Petr Machata <petrm@mellanox.com>
To: Jakub Kicinski <jakub.kicinski@netronome.com>
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>,
Ido Schimmel <idosch@mellanox.com>,
Roopa Prabhu <roopa@cumulusnetworks.com>
Subject: Re: [RFC PATCH 00/10] Add a new Qdisc, ETS
Date: Thu, 21 Nov 2019 12:43:47 +0000 [thread overview]
Message-ID: <87imndcscd.fsf@mellanox.com> (raw)
In-Reply-To: <20191120152534.2041788e@cakuba.netronome.com>
Jakub Kicinski <jakub.kicinski@netronome.com> writes:
> 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
For reference, the Spectrum hardware already is more smart. We could
offload PRIO with several DRRs under different bands, the HW is
expressive enough to describe this. But nobody seems to need this: it
seems there are no customers needing anything more than what 802.1Qaz
describes. The DCB interface, which is pretty much married to HW
interfaces, is likewise very close to what 802.1Q specifies, and I don't
believe that's by chance.
> 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.
If 802.1Q introduces an algorithm that can't be expressed as a single
Qdisc, growing the ETS Qdisc is of course valid. E.g. the shaper
operation is restricted to a single band, so it makes sense to express
it as an independent unit. That's unlike the ETS algorithm, which needs
cooperation between several bands, so you can't easily attach "ETS'ness"
under individual PRIO bands.
> 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?
One can imagine a library that handles these sorts of stuff. Drivers
would forward TC events to it, it would figure out what's what, and
somehow signal back to the driver. But packaging this as a Qdisc is such
an interface as well. And because Qdisc interface is well understood not
only by kernel hackers, but also by end users, a Qdisc takes care of
that part of the problem as well.
prev parent reply other threads:[~2019-11-21 12:43 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-11-20 13:05 [RFC PATCH 00/10] Add a new Qdisc, ETS Petr Machata
2019-11-20 13:05 ` [RFC PATCH 01/10] net: pkt_cls: Clarify a comment Petr Machata
2019-11-20 13:05 ` [RFC PATCH 02/10] mlxsw: spectrum_qdisc: " Petr Machata
2019-11-20 13:05 ` [RFC PATCH 03/10] mlxsw: spectrum: Fix typos in MLXSW_REG_QEEC_HIERARCHY_* enumerators Petr Machata
2019-11-20 13:05 ` [RFC PATCH 04/10] net: sch_ets: Add a new Qdisc Petr Machata
2019-11-20 13:05 ` [RFC PATCH 05/10] net: sch_ets: Make the ETS qdisc offloadable Petr Machata
2019-11-20 13:05 ` [RFC PATCH 06/10] mlxsw: spectrum_qdisc: Generalize PRIO offload to support ETS Petr Machata
2019-11-20 13:05 ` [RFC PATCH 07/10] mlxsw: spectrum_qdisc: Support offloading of ETS Qdisc Petr Machata
2019-11-20 13:05 ` [RFC PATCH 08/10] selftests: forwarding: Move start_/stop_traffic from mlxsw to lib.sh Petr Machata
2019-11-20 13:05 ` [RFC PATCH 09/10] selftests: forwarding: sch_ets: Add test coverage for ETS Qdisc Petr Machata
2019-11-20 13:05 ` [RFC PATCH 10/10] selftests: qdiscs: " Petr Machata
2019-11-20 15:15 ` Roman Mashak
2019-11-20 15:42 ` Petr Machata
2019-11-20 21:22 ` Roman Mashak
2019-11-20 13:05 ` [RFC PATCH 1/3] libnetlink: parse_rtattr_nested should allow NLA_F_NESTED flag Petr Machata
2019-11-20 13:05 ` [RFC PATCH 2/3] uapi: Update for the ETS Qdisc Petr Machata
2019-11-20 13:05 ` [RFC PATCH 3/3] tc: Add support for " Petr Machata
2019-11-20 23:25 ` [RFC PATCH 00/10] Add a new Qdisc, ETS Jakub Kicinski
2019-11-21 12:43 ` Petr Machata [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87imndcscd.fsf@mellanox.com \
--to=petrm@mellanox.com \
--cc=idosch@mellanox.com \
--cc=jakub.kicinski@netronome.com \
--cc=netdev@vger.kernel.org \
--cc=roopa@cumulusnetworks.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.