]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
net: airoha: Fix off-by-one in airoha_tc_remove_htb_queue()
authorLorenzo Bianconi <lorenzo@kernel.org>
Fri, 19 Jun 2026 11:37:13 +0000 (13:37 +0200)
committerJakub Kicinski <kuba@kernel.org>
Thu, 25 Jun 2026 00:44:42 +0000 (17:44 -0700)
airoha_tc_htb_alloc_leaf_queue() computes the HTB QoS channel index
as opt->classid % AIROHA_NUM_QOS_CHANNELS and stores it in qos_sq_bmap.
However, airoha_tc_remove_htb_queue() clears the HTB configuration
using queue + 1 as the channel index, causing an off-by-one error.
Use queue directly as the QoS channel index to match the allocation
logic.

Fixes: ef1ca9271313b ("net: airoha: Add sched HTB offload support")
Reviewed-by: Simon Horman <horms@kernel.org>
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Link: https://patch.msgid.link/20260619-airoha-qos-fixes-v2-1-5c43485038f9@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/airoha/airoha_eth.c

index 2eab69c81dcfa2aed70cdac5fe1e0585a9a21033..1d38f9f848154c08bdd76410a86b5a015907e66e 100644 (file)
@@ -3006,7 +3006,7 @@ static void airoha_tc_remove_htb_queue(struct net_device *netdev, int queue)
        struct airoha_qdma *qdma = dev->qdma;
 
        netif_set_real_num_tx_queues(netdev, netdev->real_num_tx_queues - 1);
-       airoha_qdma_set_tx_rate_limit(netdev, queue + 1, 0, 0);
+       airoha_qdma_set_tx_rate_limit(netdev, queue, 0, 0);
 
        clear_bit(queue, qdma->qos_channel_map);
        clear_bit(queue, dev->qos_sq_bmap);