[PATCH] net: airoha: Fix skb->priority underflow in airoha_dev_select_queue()
Simon Horman
horms at kernel.org
Mon Jun 15 05:40:01 PDT 2026
On Sun, Jun 14, 2026 at 07:30:54AM +0800, Wayen.Yan wrote:
> In airoha_dev_select_queue(), the expression:
>
> queue = (skb->priority - 1) % AIROHA_NUM_QOS_QUEUES;
>
> implicitly converts to unsigned arithmetic: when skb->priority is 0
> (the default for unclassified traffic), (0u - 1u) wraps to UINT_MAX,
> and UINT_MAX % 8 = 7, routing default best-effort packets to the
> highest-priority QoS queue. This causes QoS inversion where the
> majority of traffic on a PON gateway starves actual high-priority
> flows (VoIP, gaming, etc.).
>
> Fix by guarding the subtraction: when priority is 0, map to queue 0
> (lowest priority), otherwise apply the original (priority - 1) % 8
> mapping.
>
> Fixes: 2b288b81560b ("net: airoha: Introduce ndo_select_queue callback")
> Signed-off-by: Wayen <win847 at gmail.com>
Our CI guessed incorrectly that this was for the net-next tree,
where it doesn't apply cleanly.
Please post a v2 targeting the net tree like this:
Subject: [PATCH net v2] ...
I suggest including Lorenzo's Acked-by tag.
For more information, please see:
https://docs.kernel.org/process/maintainer-netdev.html
...
--
pw-bot: changes-requested
More information about the linux-arm-kernel
mailing list