[PATCH v2 1/4] realtek: correct egress frame priority assignment

Birger Koblitz mail at birger-koblitz.de
Sun Jun 19 06:45:30 PDT 2022

On 19/06/2022 13:46, Sander Vanheule wrote:
> Priority values passed to the egress (TX) frame header initialiser are
> invalid when smaller than 0, and should not be assigned to the frame.
> Queue assignment is then left to the switch core logic.
> Current code for RTL83xx forces the passed priority value to be
> positive, by always masking it to the lower bits, resulting in the
> priority always being set and enabled. RTL93xx code doesn't even check
> the value and unconditionally assigns the (32 bit) value to the (5 bit)
> QID field without masking.
> Fix priority assignment by only setting the AS_QID/AS_PRI flag when a
> valid value is passed, and properly mask the value to not overflow the
> QID/PRI field.
> For RTL839x, also assign the priority to the right part of the frame
> header. Counting from the leftmost bit, AS_PRI and PRI are in bits 36
> and 37-39. The means they should be assigned to the third 16 bit value,
> containing bits 32-47.



More information about the openwrt-devel mailing list