netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Lunn <andrew@lunn.ch>
To: Vladimir Oltean <olteanv@gmail.com>
Cc: "David S. Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>,
	netdev@vger.kernel.org, Ido Schimmel <idosch@nvidia.com>,
	Petr Machata <petrm@nvidia.com>,
	Alexander Duyck <alexander.duyck@gmail.com>,
	Jamal Hadi Salim <jhs@mojatatu.com>,
	Cong Wang <xiyou.wangcong@gmail.com>,
	Jiri Pirko <jiri@nvidia.com>,
	f.fainelli@gmail.com, vivien.didelot@gmail.com
Subject: Re: [RFC PATCH net-next 1/2] net: dsa: allow setting port-based QoS priority using tc matchall skbedit
Date: Fri, 11 Feb 2022 16:59:14 +0100	[thread overview]
Message-ID: <YgaH0jjOcQMlZxxY@lunn.ch> (raw)
In-Reply-To: <CA+h21hoYOZZYhoD+QgDvm-Pe11EH5LgLtzRrYPQux_8a7AeHGw@mail.gmail.com>

On Thu, Feb 10, 2022 at 08:53:21PM +0200, Vladimir Oltean wrote:
> Hi Andrew,
> 
> On Thu, 14 Jan 2021 at 03:03, Andrew Lunn <andrew@lunn.ch> wrote:
> > On Thu, Jan 14, 2021 at 02:17:59AM +0200, Vladimir Oltean wrote:
> > > On Thu, Jan 14, 2021 at 12:41:28AM +0100, Andrew Lunn wrote:
> > > > On Wed, Jan 13, 2021 at 05:41:38PM +0200, Vladimir Oltean wrote:
> > > > > + int     (*port_priority_set)(struct dsa_switch *ds, int port,
> > > > > +                              struct dsa_mall_skbedit_tc_entry *skbedit);
> > > >
> > > > The fact we can turn this on/off suggests there should be a way to
> > > > disable this in the hardware, when the matchall is removed. I don't
> > > > see any such remove support in this patch.
> > >
> > > I don't understand this comment, sorry. When the matchall filter
> > > containing the skbedit action gets removed, DSA calls the driver's
> > > .port_priority_set callback again, this time with a priority of 0.
> > > There's nothing to "remove" about a port priority. I made an assumption
> > > (which I still consider perfectly reasonable) that no port-based
> > > prioritization means that all traffic gets classified to traffic class 0.
> >
> > That does not work for mv88e6xxx. Its default setup, if i remember
> > correctly, is it looks at the TOS bits to determine priority
> > classes. So in its default state, it is using all the available
> > traffic classes.  It can also be configured to look at the VLAN
> > priority, or the TCAM can set the priority class, or there is a per
> > port default priority, which is what you are describing here. There
> > are bits to select which of these happen on ingress, on a per port
> > basis.
> >
> > So setting the port priority to 0 means setting the priority of
> > zero. It does not mean go back to the default prioritisation scheme.
> >
> > I guess any switch which has a range of options for prioritisation
> > selection will have a similar problem. It defaults to something,
> > probably something a bit smarter than everything goes to traffic class
> > 0.
> >
> >       Andrew
> 
> I was going through my old patches, and re-reading this conversation,
> it appears one of us is misunderstanding something.
> 
> I looked at some Marvell datasheet and it has a similar QoS
> classification pipeline to Vitesse switches. There is a port-based
> default priority which can be overridden by IP DSCP, VLAN PCP, or
> advanced QoS classification (TCAM).
> 
> The proposal I had was to configure the default port priority using tc
> matchall skbedit priority. Advanced QoS classification would then be
> expressed as tc-flower filters with a higher precedence than the
> matchall (basically the "catchall"). PCP and DSCP, I don't know if
> that can be expressed cleanly using tc. I think there's something in
> the dcb ops, but I haven't studied that too deeply.
> 
> Anyway, I don't exactly understand your point, that an add/del is in
> any way better than a "set". Even for Marvell, what I'm proposing here
> would translate in a "set to 0" on "del" anyway. That's why this patch
> set is RFC. I don't know if there's a better way to express a
> port-based default priority than a matchall rule having the lowest
> precedence.

I think we have a generic problem in that the switch does not start up
in a state where all QoS features are turned off. But a traditional
netdev does have all QoS features off by default. You need to
explicitly turn on a QoS feature on a netdev by using tc, or some
other configuration mechanism.

To make the linux view of QoS features actually match what the
hardware is doing, we need to preload tc with a number of rules.  Your
proposed 'tc matchall skbedit priority' rule might need to be already
in tc because the switch might already be doing that by default, etc.

I also wonder if we need tc rules you cannot actually remove, because
you cannot turn the feature off in hardware? 'tc matchall skbedit
priority' is setting the default priority. If you remove the rule, the
hardware is still going to apply a default priority, it is just
ambiguous from tc what value it is using. It would be better if the
rule was present from boot, and all you can do is change the priority,
not remove the rule.

We need to consider the generic problem that the hardware comes with a
preconfigured QoS profile, which we currently don't reflect in Linux.
We have deployed devices which rely on that QoS profile. How do we
transition to describing that preconfigured QoS profile, and allowing
it to be changed?

   Andrew

  parent reply	other threads:[~2022-02-11 15:59 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-13 15:41 [RFC PATCH net-next 0/2] Port-based priority on DSA switches using tc-matchall Vladimir Oltean
2021-01-13 15:41 ` [RFC PATCH net-next 1/2] net: dsa: allow setting port-based QoS priority using tc matchall skbedit Vladimir Oltean
2021-01-13 23:41   ` Andrew Lunn
2021-01-14  0:17     ` Vladimir Oltean
2021-01-14  1:02       ` Andrew Lunn
2022-02-10 18:53         ` Vladimir Oltean
2022-02-11  7:52           ` Petr Machata
2022-02-11 15:29             ` Vladimir Oltean
2022-02-11 16:08               ` Andrew Lunn
2022-02-11 18:24               ` Petr Machata
2022-02-17 15:42                 ` Vladimir Oltean
2022-02-11 15:59           ` Andrew Lunn [this message]
2021-01-13 15:41 ` [RFC PATCH net-next 2/2] net: dsa: felix: offload port priority Vladimir Oltean
2021-01-13 23:36   ` Andrew Lunn
2021-01-13 23:37     ` Florian Fainelli
2021-01-14  0:57       ` Vladimir Oltean

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=YgaH0jjOcQMlZxxY@lunn.ch \
    --to=andrew@lunn.ch \
    --cc=alexander.duyck@gmail.com \
    --cc=davem@davemloft.net \
    --cc=f.fainelli@gmail.com \
    --cc=idosch@nvidia.com \
    --cc=jhs@mojatatu.com \
    --cc=jiri@nvidia.com \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=olteanv@gmail.com \
    --cc=petrm@nvidia.com \
    --cc=vivien.didelot@gmail.com \
    --cc=xiyou.wangcong@gmail.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 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).