Re: [PATCH net-next v2 10/10] net: dsa: realtek: rtl8365mb: report the DCB DSCP-to-priority map

From: Linus Walleij

Date: Thu Nov 12 2026 - 18:59:19 EST


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

> Report the DSCP-to-priority map through dcbnl, so that "dcb app show"
> lists, on every port, the priority a DSCP value gets once the port
> trusts DSCP.
>
> The switch has one DSCP-to-priority table for all its ports, with
> exactly one priority per DSCP value. dcbnl, in contrast, configures DSCP
> priorities per port and allows several priorities for one DSCP value.
> DSA could mirror a change to every port (dscp_prio_mapping_is_global),
> but a request on one port would still change the classification of all
> ports. Keep the map read-only. The QoS baseline seeds it with the
> default mapping from ietf_dscp_to_ieee8021q_tt(). Requests to change a
> DSCP entry fail with -EOPNOTSUPP.
>
> Signed-off-by: Oleksij Rempel <o.rempel@xxxxxxxxxxxxxx>
> ---
> Q: The v1 review (Linus) suggested DSCP get, add and delete callbacks
> in the common code, and setting ds->dscp_prio_mapping_is_global when
> registering DSCP offload. Why are add, delete and the flag gone in v2?
> A: The DSCP get moved into the shared code as asked. Add and del were
> dropped because the table is chip-wide, as the commit message explains.
> Without add and del, nothing would use the flag, so it is not set.
>
> Changes in v2:
> - make the DSCP map read-only, as the table is shared by all ports of
> the chip and per-port remapping would change every port
> - drop the DSCP add/del ops, whose delete path could leave the hardware
> out of step with the remaining APP entries (sashiko)
> - do not set ds->dscp_prio_mapping_is_global; without DSCP add/del
> nothing needs its global set/del path (sashiko)
> - retitled (was "offload DCB DSCP-to-priority")
> - move the DSCP get handling into rtl83xx-qos.c behind a new
> qos_get_dscp_prio callback (Linus)
> - DSCP table seeding moved to the baseline patch
> - read the table entry through rtl8365mb_qos_regmap_read_field(), which
> uses field_get() (Luiz)

Excellent revision here, all requests fulfilled from my PoV:
Reviewed-by: Linus Walleij <linusw@xxxxxxxxxx>

Yours,
Linus Walleij