[PATCH] net: airoha: Fix always-true condition in PPE1 queue reservation loop
Lorenzo Bianconi
lorenzo at kernel.org
Sat Jun 13 01:36:06 PDT 2026
> In airoha_fe_pse_ports_init(), the inner condition for PPE1 queue
> reservation is identical to the for-loop bound, making it always true
> and the else branch dead code:
>
> for (q = 0; q < pse_port_num_queues[FE_PSE_PORT_PPE1]; q++) {
> if (q < pse_port_num_queues[FE_PSE_PORT_PPE1]) /* always true */
> set RSV_PAGES;
> else
> set 0; /* unreachable */
> }
>
> The intended behavior is to reserve pages only for the first half of
> the queues, matching the PPE2 implementation on line 334 which
> correctly uses the /2 divisor. Fix the PPE1 condition accordingly.
>
> Fixes: 23020f049327 ("net: airoha: Introduce ethernet support for EN7581 SoC")
> Signed-off-by: Wayen.Yan <win847 at gmail.com>
Acked-by: Lorenzo Bianconi <lorenzo at kernel.org>
> ---
> drivers/net/ethernet/airoha/airoha_eth.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/net/ethernet/airoha/airoha_eth.c b/drivers/net/ethernet/airoha/airoha_eth.c
> index 31cdb11..999f517 100644
> --- a/drivers/net/ethernet/airoha/airoha_eth.c
> +++ b/drivers/net/ethernet/airoha/airoha_eth.c
> @@ -311,7 +311,7 @@ static void airoha_fe_pse_ports_init(struct airoha_eth *eth)
> PSE_QUEUE_RSV_PAGES);
> /* PPE1 */
> for (q = 0; q < pse_port_num_queues[FE_PSE_PORT_PPE1]; q++) {
> - if (q < pse_port_num_queues[FE_PSE_PORT_PPE1])
> + if (q < pse_port_num_queues[FE_PSE_PORT_PPE1] / 2)
> airoha_fe_set_pse_oq_rsv(eth, FE_PSE_PORT_PPE1, q,
> PSE_QUEUE_RSV_PAGES);
> else
> --
> 2.51.0
>
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 228 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20260613/1f5f09c4/attachment-0001.sig>
More information about the linux-arm-kernel
mailing list