Re: [PATCH net-next v16 13/15] net: dsa: realtek: rtl8365mb: refactor QoS priority handling

From: Linus Walleij

Date: Sun Nov 29 2026 - 17:52:16 EST


On Sun, Nov 29, 2026 at 4:12 PM Mieczyslaw Nalewaj <namiltd@xxxxxxxxx> wrote:

> The shared QoS layer hands the backend internal priorities that are
> 802.1Q traffic types, and the backend stores them in the chip as they
> are, together with a separate per-port PCP for untagged frames. Family D
> numbers its internal priorities differently and has no separate
> untagged-PCP register, which the next patch adds.
>
> Move the conversion between a traffic type and the chip's priority, and
> the programming of the PCP of untagged frames, behind three new hooks in
> struct rtl8365mb_family_info, as for the VLAN, PVID and L2 helpers:
> qos_iprio_to_hw, qos_hw_to_iprio and qos_set_untag_pcp. The existing
> behaviour becomes the family C implementation: the traffic type is
> stored as it is and the untagged PCP register is written as before.
> rtl8365mb_qos_qmap_init() now iterates over the chip's priorities and
> converts each one back to its traffic type. Name the qmap index
> hw_prio throughout, because it is already in the chip's numbering.
>
> No functional change.
>
> Tested-by: Gustavo Foletto Mora <gusfmora@xxxxxxxxx>
> Signed-off-by: Mieczyslaw Nalewaj <namiltd@xxxxxxxxx>

Reviewed-by: Linus Walleij <linusw@xxxxxxxxxx>

Yours,
Linus Walleij