Re: [PATCH net-next v2 09/10] net: dsa: realtek: rtl8365mb: offload DCB apptrust
From: Linus Walleij
Date: Thu Nov 12 2026 - 16:10:04 EST
On Thu, Nov 12, 2026 at 9:38 AM Oleksij Rempel <o.rempel@xxxxxxxxxxxxxx> wrote:
> Wire up port_get_apptrust and port_set_apptrust. The admin can then
> choose through dcbnl apptrust which ingress classification a port trusts
> for its priority: 802.1p (PCP), DSCP or both. A port that trusts nothing
> keeps the port default priority.
>
> In the driver's model of the hardware, the trusted priority-decision
> table is switch-wide, so all ports that trust something must trust the
> same selectors. While another port trusts a set of selectors, a request
> to trust a different set is refused with -EBUSY.
>
> When both are trusted, DSCP must come first. When PCP is trusted, the
> switch classifies an untagged frame by the PCP given to untagged
> frames. A PCP source ranked above DSCP would then hide DSCP from
> untagged IP frames. Refuse the order pcp dscp and any unknown selector
> with -EOPNOTSUPP.
>
> Signed-off-by: Oleksij Rempel <o.rempel@xxxxxxxxxxxxxx>
> ---
> Changes in v2:
> - move selector and precedence validation into rtl83xx-qos.c behind new
> qos_get/set_apptrust callbacks; weights and -EBUSY stay here (Linus)
> - use one-hot decision weights; in the driver's model, the v1 linear
> weights could tie PCP with DSCP (Linus)
> - define the apptrust slot order once (enum rtl83xx_apptrust_slot) for
> the shared selector table and the backend source table
> - write the PCP and DSCP weights with one register update, so a failed
> write cannot leave the trusted table half programmed (sashiko)
> - check that all apptrust sources share the one register that is updated
> - rank DSCP above PCP and refuse pcp dscp with -EOPNOTSUPP, because
> with PCP first, untagged IP frames never reach DSCP
Very thorough and resolves my issues!
Reviewed-by: Linus Walleij <linusw@xxxxxxxxxx>
Yours,
Linus Walleij