From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E89C73AB293 for ; Sat, 13 Jun 2026 08:36:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781339771; cv=none; b=oiVX5dqmGZ3wdwqh71+mPYBXN6KSLvS5SI6xydHuC+SXN13KPafcJg7+AqZIwibHK9yu6ZPTfHioUldM+QY6j+r/4qkDEwJ5tsQgvwwsMTm2aOJmCLHwlo3egFbb8Et5zMfgdkodFeoHxaSphIdp2c30W3IXFjpdGql7LUv2qTE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781339771; c=relaxed/simple; bh=lp+rwv/5cHI+h1iUnoNus7Q0S7VFmCVS7aGT1UuD6ec=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=RSAr7loifPjfjNbVqVQ3HBIw625KBz7a1IMRfywZF9fPXgh8/KHNrXz8Mb7DCeD9uH65W2/gCrwzZgHmkWkp0/CN0VQSCfe5+Lqa6YQTxyaBsj/HrLdfhAp8xuCNny5km/TALURTFfxfiNRnt1eQkJRIwPlHbvnBsbgeoAXzTTA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=dW3ZLxCx; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="dW3ZLxCx" Received: by smtp.kernel.org (Postfix) with ESMTPSA id F16441F000E9; Sat, 13 Jun 2026 08:36:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1781339769; bh=FA8Qkjbau8l6ahSUSntT4VYINgPbUIyT3mXo0SiPu8w=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=dW3ZLxCxKWkp6dV+14xw66cXXHoGeXWWY/r4cIx3haGMztzrz6c+x5NWk3Rd+Fhl4 yGzOT9Eq3fe272TR8Jupukq6BzIgNoWhFdZULN4b4LpL7AT5eXLwk0FsGcq8xYeztl +Q5CaoXRuimk7Vxl1gc4hyYIlVQ4dQqK3Ld6vymfNtAlrAxoeGZbnb6PS//aMPe1cl yHO9fBhN81POwK6tEBri7BNdZBhaFW1hsXhD0FTUpgUuWefGYOSDx8TvwcSVyW6U9/ E62O8UmVJF0dYBJF2fVXLGbUWsyPCMdFWQsmjyUxKtGwU3Oi3zBtslRdYlyklccZw6 Fh/3mBbHNJlig== Date: Sat, 13 Jun 2026 10:36:06 +0200 From: Lorenzo Bianconi To: "Wayen.Yan" Cc: netdev@vger.kernel.org, horms@kernel.org, pabeni@redhat.com, kuba@kernel.org, edumazet@google.com, andrew+netdev@lunn.ch, angelogioacchino.delregno@collabora.com, matthias.bgg@gmail.com, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org Subject: Re: [PATCH] net: airoha: Fix always-true condition in PPE1 queue reservation loop Message-ID: References: <6a2ca3de.ad59c0a6.147df9.2ac1@mx.google.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="H5AwCgcOCuAvnmQX" Content-Disposition: inline In-Reply-To: <6a2ca3de.ad59c0a6.147df9.2ac1@mx.google.com> --H5AwCgcOCuAvnmQX Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable > 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: >=20 > for (q =3D 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 */ > } >=20 > 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. >=20 > Fixes: 23020f049327 ("net: airoha: Introduce ethernet support for EN7581 = SoC") > Signed-off-by: Wayen.Yan Acked-by: Lorenzo Bianconi > --- > drivers/net/ethernet/airoha/airoha_eth.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) >=20 > diff --git a/drivers/net/ethernet/airoha/airoha_eth.c b/drivers/net/ether= net/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_et= h *eth) > PSE_QUEUE_RSV_PAGES); > /* PPE1 */ > for (q =3D 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 > --=20 > 2.51.0 >=20 >=20 --H5AwCgcOCuAvnmQX Content-Type: application/pgp-signature; name=signature.asc -----BEGIN PGP SIGNATURE----- iHUEABYKAB0WIQTquNwa3Txd3rGGn7Y6cBh0uS2trAUCai0WcgAKCRA6cBh0uS2t rO7RAP9g7N1WhxG+uVhjrwSIALK1fOaWyiTfOWfqgjMFz2sJTgD/X/4yttNNe92V RyqwwsP+NoHXVSlbjU6imIw7+hHDggM= =AAmu -----END PGP SIGNATURE----- --H5AwCgcOCuAvnmQX--