Re: [PATCH net-next v2 08/10] net: dsa: realtek: rtl8365mb: program the PCP of untagged frames

From: Linus Walleij

Date: Thu Nov 12 2026 - 16:33:19 EST


On Thu, Nov 12, 2026 at 9:37 AM Oleksij Rempel <o.rempel@xxxxxxxxxxxxxx> wrote:

> Program the PCP that the switch gives to untagged frames whenever the
> port default priority is set.
>
> With PCP trust, the switch classifies an untagged frame by this value.
> The value is 0 after reset, so untagged frames would be Best Effort
> whatever the port default priority is. PCP trust is added by "net: dsa:
> realtek: rtl8365mb: offload DCB apptrust".
>
> The switch also puts this value into the tag it adds on egress. So far,
> an untagged frame that left a VLAN-tagged port carried PCP 0. With a
> default priority set, it now carries that priority as its PCP. The
> standards require this:
>
> IEEE 802.1AC-2016, 13.1: "The priority parameter of the
> M_UNITDATA.indication shall take the value of the Default Priority
> parameter for the SAP on which the MA_DATA.indication was received."
>
> IEEE 802.1Q-2022, 6.9.4: "For untagged frames, the priority parameter
> signaled in the corresponding M_UNITDATA.indication is taken to be the
> received priority."
>
> IEEE 802.1Q-2022, 6.9.3: "The priority and drop_eligible parameters
> are encoded in the PCP field of the VLAN tag using the Priority Code
> Point Encoding Table for the Port". With the default priority
> regeneration (Table 6-4) and the 8P0D encoding (Table 6-2), the PCP
> equals the Default Priority.
>
> Signed-off-by: Oleksij Rempel <o.rempel@xxxxxxxxxxxxxx>
> ---
> Changes in v2:
> - New in v2. PCP trust needs it, or untagged frames would be Best
> Effort.

I really like the patch and the very helpful commit log.

Reviewed-by: Linus Walleij <linusw@xxxxxxxxxx>

Yours,
Linus Walleij