All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vladimir Oltean <vladimir.oltean@nxp.com>
To: Ferenc Fejes <fejes@inf.elte.hu>
Cc: peti.antal99@gmail.com, "andrew@lunn.ch" <andrew@lunn.ch>,
	Claudiu Manoil <claudiu.manoil@nxp.com>,
	"vivien.didelot@gmail.com" <vivien.didelot@gmail.com>,
	"vinicius.gomes@intel.com" <vinicius.gomes@intel.com>,
	"shuah@kernel.org" <shuah@kernel.org>,
	"bigeasy@linutronix.de" <bigeasy@linutronix.de>,
	"davem@davemloft.net" <davem@davemloft.net>,
	Yannick Vignon <yannick.vignon@nxp.com>,
	Xiaoliang Yang <xiaoliang.yang_1@nxp.com>,
	"UNGLinuxDriver@microchip.com" <UNGLinuxDriver@microchip.com>,
	"pabeni@redhat.com" <pabeni@redhat.com>,
	"edumazet@google.com" <edumazet@google.com>,
	"richardcochran@gmail.com" <richardcochran@gmail.com>,
	"idosch@nvidia.com" <idosch@nvidia.com>,
	"gerhard@engleder-embedded.com" <gerhard@engleder-embedded.com>,
	"Y.B. Lu" <yangbo.lu@nxp.com>,
	"jiri@nvidia.com" <jiri@nvidia.com>,
	"alexandre.belloni@bootlin.com" <alexandre.belloni@bootlin.com>,
	"kuba@kernel.org" <kuba@kernel.org>,
	"kurt@linutronix.de" <kurt@linutronix.de>,
	Rui Sousa <rui.sousa@nxp.com>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"linux-kselftest@vger.kernel.org"
	<linux-kselftest@vger.kernel.org>,
	"f.fainelli@gmail.com" <f.fainelli@gmail.com>
Subject: Re: [PATCH v2 net-next] selftests: forwarding: add Per-Stream Filtering and Policing test for Ocelot
Date: Thu, 16 Feb 2023 17:58:13 +0200	[thread overview]
Message-ID: <20230216155813.un3icarhi2h6aga2@skbuf> (raw)
In-Reply-To: <009e968cc984b563c375cb5be1999486b05db626.camel@inf.elte.hu>

On Thu, Feb 16, 2023 at 02:47:11PM +0100, Ferenc Fejes wrote:
> > To fix this, we need to keep a current_ipv variable according to the
> > gate entry that's currently executed by act_gate, and use this IPV to
> > overwrite the skb->priority.
> > 
> > In fact, a complication arises due to the following clause from
> > 802.1Q:
> > 
> > > 8.6.6.1 PSFP queuing
> > > If PSFP is supported (8.6.5.1), and the IPV associated with the stream
> > > filter that passed the frame is anything other than the null value, then
> > > that IPV is used to determine the traffic class of the frame, in place
> > > of the frame's priority, via the Traffic Class Table specified in 8.6.6.
> > > In all other respects, the queuing actions specified in 8.6.6 are
> > > unchanged. The IPV is used only to determine the traffic class
> > > associated with a frame, and hence select an outbound queue; for all
> > > other purposes, the received priority is used.
> 
> Interesting. In my understanding this indeed something like "modify the
> queueing decision while preserve the original PCP value".

I actually wonder what the interpretation in the spirit of this clause is.
I'm known to over-interpret the text of these IEEE standards and finding
inconsistencies in the process (being able to prove both A and !A).

For example, if we consider the framePreemptionAdminStatus (express or
preemptible). It is expressed per priority. So this means that the
Internal Priority Value rewritten by PSFP will not affect the express/
preemptible nature of a frame, but it *will* affect the traffic class
selection?

This is insane, because it means that to enforce the requirements of
clause 12.30.1.1.1:

| Priorities that all map to the same traffic class should be
| constrained to use the same value of preemption status.

it is insufficient to check that the prio_tc_map does not make some
traffic classes both express and preemptible. One has to also check the
tc-gate configuration, because the literal interpretation of the standard
would suggest that a packet is preemptible or express based on skb->priority,
but is classified to a traffic class based on skb->ipv. So I guess IPV
rewriting can only take place between one preemptible priority and another,
or only between one express priority and another, and that we should
somehow test this. But PSFP is at ingress, and FP is at egress, so we'd
somehow have to test the FP adminStatus of all the other net devices
that we can forward to!!!

I'll try to ask around and see if anyone knows more details about what
is the expected behavior.

> Your solution certainly correct and do the differentiation between the
> cases where we have PSFP at ingress or not. However in my understanding
> the only purpose of the IPV is the traffic class selection. 
> 
> Setting skb->queue_mapping to IPV probably wont work, because of two
> reasons:
> 1. it brings inconsistency with the mqprio/taprio queues and the actual
> hw rings the traffic sent
> 2. some drivers dont check if skb->queue_mapping is bounded, they
> expect its smaller than the num_tx_queues.
> 
> The 2. might be solvable, but the 1. is more problematic. However with
> a helper, we might check if skb->queue_mapping is already set and use
> that as a traffic class. Is that possible? I dont really see any other
> codepath where that value can be other than zero before the qdisc
> layer. That way one flag (use_ipv) might be enough which tells that we
> should use the skb->queue_mapping as is (set by act_gate) and preserve
> skb->priority.
> 
> What do you think? Again, sorry for being late here, but I'm following
> the list and see that recently you did major mqprio/taprio fixes and
> refactors, so I hope your cache line is hot.

I'm afraid it's not so easy to reuse this field for the IPV, because
skb->queue_mapping is already used between the RX and the TX path for
"recording the RX queue", see skb_rx_queue_recorded(), skb_record_rx_queue(),
skb_get_rx_queue().

  reply	other threads:[~2023-02-16 15:58 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-01 11:29 [PATCH v2 net-next] selftests: forwarding: add Per-Stream Filtering and Policing test for Ocelot Vladimir Oltean
2022-05-01 11:56 ` Kurt Kanzenbach
2022-05-02 23:10 ` patchwork-bot+netdevbpf
2022-05-06  7:49 ` Ferenc Fejes
2022-05-06 12:01   ` Vladimir Oltean
2022-05-06 12:24     ` Ferenc Fejes
2022-05-26  0:50       ` Vladimir Oltean
2022-05-26  6:40         ` Ferenc Fejes
2022-05-26  9:30           ` Vladimir Oltean
2023-02-16 13:47             ` Ferenc Fejes
2023-02-16 15:58               ` Vladimir Oltean [this message]
2023-02-17  8:03                 ` Ferenc Fejes
2023-02-17 13:07                   ` Vladimir Oltean
2023-02-17 14:35                     ` Ferenc Fejes

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=20230216155813.un3icarhi2h6aga2@skbuf \
    --to=vladimir.oltean@nxp.com \
    --cc=UNGLinuxDriver@microchip.com \
    --cc=alexandre.belloni@bootlin.com \
    --cc=andrew@lunn.ch \
    --cc=bigeasy@linutronix.de \
    --cc=claudiu.manoil@nxp.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=f.fainelli@gmail.com \
    --cc=fejes@inf.elte.hu \
    --cc=gerhard@engleder-embedded.com \
    --cc=idosch@nvidia.com \
    --cc=jiri@nvidia.com \
    --cc=kuba@kernel.org \
    --cc=kurt@linutronix.de \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=peti.antal99@gmail.com \
    --cc=richardcochran@gmail.com \
    --cc=rui.sousa@nxp.com \
    --cc=shuah@kernel.org \
    --cc=vinicius.gomes@intel.com \
    --cc=vivien.didelot@gmail.com \
    --cc=xiaoliang.yang_1@nxp.com \
    --cc=yangbo.lu@nxp.com \
    --cc=yannick.vignon@nxp.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.