net: airoha: Fix QoS counter configuration for Tx-fwd channels
Subsystems (4)
PATCH v2 1/1 net: airoha: Fix QoS counter configuration for Tx-fwd channels
In airoha_qdma_init_qos_stats(), the Tx-fwd counter was incorrectly using register index (i << 1) instead of ((i << 1) + 1). This caused the Tx-fwd configuration to overwrite the Tx-cpu configuration for each QoS channel, resulting in incorrect QoS statistics.
Fix by using the correct register index ((i << 1) + 1) for Tx-fwd counter configuration.
--- drivers/net/ethernet/airoha/airoha_eth.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/airoha/airoha_eth.c +1 -1
@@ -1256,7 +1256,7 @@ static void airoha_qdma_init_qos_stats(struct airoha_qdma *qdma) FIELD_PREP(CNTR_CHAN_MASK, i));/* Tx-fwd transferred count */ airoha_qdma_wr (qdma,REG_CNTR_VAL ((i <<1 ) +1 ),0 ); - airoha_qdma_wr(qdma, REG_CNTR_CFG(i << 1), + airoha_qdma_wr(qdma, REG_CNTR_CFG((i << 1) + 1), CNTR_EN_MASK | CNTR_ALL_QUEUE_EN_MASK | CNTR_ALL_DSCP_RING_EN_MASK | FIELD_PREP(CNTR_SRC_MASK, 1) |
Signature · 1 line
2.51.0
Lorenzo Bianconi
maintainerQuoted 10 lines
In
airoha_qdma_init_qos_stats(), the Tx-fwd counter was incorrectly using register index (i << 1) instead of ((i << 1) + 1). This caused the Tx-fwd configuration to overwrite the Tx-cpu configuration for each QoS channel, resulting in incorrect QoS statistics.Fix by using the correct register index ((i << 1) + 1) for Tx-fwd counter configuration.
Fixes 20bf7d07c956 ("net: airoha: Add sched ETS offload support")Signed-off-by Wayen Yan <[email protected]>
Is this a patch you already sent? IIRC I have acked it.
Regards,
Lorenzo
Quoted 21 lines
--- drivers/net/ethernet/airoha/airoha_eth.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/net/ethernet/airoha/airoha_eth.c +1
-1@@ -1256,7 +1256,7 @@ static void airoha_qdma_init_qos_stats(struct airoha_qdma *qdma) FIELD_PREP(CNTR_CHAN_MASK, i));/* Tx-fwd transferred count */ airoha_qdma_wr (qdma,REG_CNTR_VAL ((i <<1 ) +1 ),0 ); - airoha_qdma_wr(qdma, REG_CNTR_CFG(i << 1), + airoha_qdma_wr(qdma, REG_CNTR_CFG((i << 1) + 1), CNTR_EN_MASK | CNTR_ALL_QUEUE_EN_MASK | CNTR_ALL_DSCP_RING_EN_MASK | FIELD_PREP(CNTR_SRC_MASK, 1) |Signature · 1 line
2.51.0
This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:
Hello:
This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:
Quoted 9 lines · On Tue, 16 Jun 2026 18:50:29 +0800 you wrote:
In
airoha_qdma_init_qos_stats(), the Tx-fwd counter was incorrectly using register index (i << 1) instead of ((i << 1) + 1). This caused the Tx-fwd configuration to overwrite the Tx-cpu configuration for each QoS channel, resulting in incorrect QoS statistics.Fix by using the correct register index ((i << 1) + 1) for Tx-fwd counter configuration.
[...]
Here is the summary with links:
- [v2,net] net: airoha: Fix QoS counter configuration for Tx-fwd channels
https://git.kernel.org/netdev/net-next/c/1402ecccf563
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html