public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Luke Howard <lukeh@padl.com>
To: Vladimir Oltean <olteanv@gmail.com>
Cc: netdev@vger.kernel.org, Andrew Lunn <andrew@lunn.ch>,
	Kieran Tyrrell <kieran@sienda.com>,
	Max Hunter <max@huntershome.org>
Subject: Re: net: dsa: mv88e6xxx architecture
Date: Sat, 21 Dec 2024 08:46:26 +1100	[thread overview]
Message-ID: <7BAB5C0F-9E22-401B-8B04-1592E6C67971@padl.com> (raw)
In-Reply-To: <20241220121010.kkvmb2z2dooef5it@skbuf>

Hi Vladimir,

> I think we need an AVB primer. What identifies an AVB stream? Should the
> kernel have a database of them? What actions need to be taken for AVB
> streams different than for best effort traffic? Is it about scheduling
> priority, or about resource reservations, or? Does the custom behavior
> pertain only to AVB streams or is it a more widely useful mechanism?

AVB is an umbrella term which encompasses 802.1AS (gPTP), 802.1Qav (CBS), 802.1Qat (SRP), and various application layer protocols. This patch series is concerned with CBS and, tangentially, SRP: the existing mv88e6xxx PTP support sufficies for 802.1AS, and the application layer protocols are of no concern to the kernel. Further, the existing TC abstractions for CBS also suffice, and the patch series simply implements those.

Your question: what is an AVB stream, and what (if any) state needs to be maintained in the kernel?

Stream reservations, between “talkers” (sources) and “listeners” (sinks) are coordinated by the Multiple Stream Reservation Protocol (MSRP). (Confusingly, _SRP_ itself is an umbrella term encompassing MVRP, MMRP and MSRP. The existing MVRP support in the kernel only implements part of the MRP state machine.)

MSRP coordinates talker advertisements (consisting of a 64-bit stream ID, a [typically multicast] DA, VID, bandwidth requirement, and PCP) with listener advertisements. It also coordinates “domain” advertisements which establish a mapping between AVB or SRP “classes”, and a (PCP, VID) tuple.

At a high level, the kernel does not need to know anything about SRP: it can, and IMO should (like the PTP state machine) be implemented completely in user space. Once SRP has established there is sufficient bandwidth and latency for a steam to flow, it adds the stream DA to the FDB or MDB, and configures the CBS policy appropriately on the egress port.

The catch is what to do with frames that share a priority with an AVB class but are not negotiated by SRP. These frames could crowd out frames from AVB streams. Marvell’s solution is a flag in the ATU which indicates that the DA was added by SRP. This is the one case where a new kernel interface (specifically, a flag passed down to {fdb,mdb}_add()), could be useful. In lieu of that, the patch currently uses a new Kconfig option to indicate that _all_ static FDB/MDB entries should have that flag set, noting that CBS is still usable without this option.

> What is the lifetime of an AVB packet in the Marvell DSA switches (in
> enhanced AVB mode)? Where do they go from these global queues? Still to
> the individual port TX queues, I assume? I find it a bit difficult to
> understand the concept of global queues.

A poor explanation on my part. Briefly: FPri is the switch’s internal frame priority derived from PCP or DSCP, and QPri is queue number.

* PCP/DSCP to FPri mappings are per port
* TX _queues_ are per-port
* The _mapping_ between FPri and QPri is per-switch (at least, pre-6390 family).
* Where the admission control described above is enabled, each SRP class must be assigned a designated FPri and QPri, and this configuration is per-switch

> I don't understand this. A mapping between which port's traffic classes
> and the global AVB classes? You're saying that mqprio TCs 2 and 1 of all
> ports are backed by the same queues?

The same queue _numbers_ but not the same queues. Configuring per-port FPri to QPri mappings is possible on the 6390 family, but not with SRP admission control. 

The current patch reference counts the MQPRIO policy so that it can be applied or removed from additional ports, but only replaced when one referent remains.

Cheers,
Luke

  reply	other threads:[~2024-12-20 21:46 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-18 21:02 net: dsa: mv88e6xxx architecture Luke Howard
2024-12-20 12:10 ` Vladimir Oltean
2024-12-20 21:46   ` Luke Howard [this message]
     [not found]   ` <7E1DC313-33DE-4AA8-AD52-56316C07ABC4@padl.com>
2024-12-20 22:33     ` Andrew Lunn
2024-12-20 22:56       ` Luke Howard
     [not found]       ` <F8AE422A-2A10-4C39-A431-DA6E668797D3@padl.com>
2024-12-21 21:36         ` Andrew Lunn
2024-12-21 22:15           ` Luke Howard
2024-12-20 22:54     ` Vladimir Oltean
2024-12-20 22:59       ` Luke Howard

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=7BAB5C0F-9E22-401B-8B04-1592E6C67971@padl.com \
    --to=lukeh@padl.com \
    --cc=andrew@lunn.ch \
    --cc=kieran@sienda.com \
    --cc=max@huntershome.org \
    --cc=netdev@vger.kernel.org \
    --cc=olteanv@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