From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp-bc09.mail.infomaniak.ch (smtp-bc09.mail.infomaniak.ch [45.157.188.9]) (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 B5D3D3BED46 for ; Thu, 18 Jun 2026 09:30:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.157.188.9 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781775054; cv=none; b=H2rTrgfPs0u970QKv5h+Szp7KxNcMgmkWOT01rXCKM3Dv4EqPXP2NOlu2/pKO0r19GiWAjdlErKVBTD5xgz/lSlHGnx93drNp6Mh/Lba8qyLFOK/P2tWA2H1ER6xVBLp3KiAl3zVw6Cb1ZhIGqqDo5CBi0u81oJSqSIGXZ6USLU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781775054; c=relaxed/simple; bh=dB0Vq19/pojtzKMdhU+ZjSekw7vileLMRuihFiNJgbY=; h=Message-ID:Subject:From:To:Cc:Date:In-Reply-To:References: Content-Type:MIME-Version; b=fGtdnB4nkW1vTgnuQWrzvdsxdHBBtT3N1sHF6IWmg1gPsBt/wUu3P0gFbUaT3wzPUzhOAZOMUhtrqwHiDNCnI5rr5t8xXfZdqVS156U8wMIYwfohw6KJE46HLpWc89LqmSpy95CAQ9d440XR3yI919DL79ziCMley75QVE6HNgE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=pschenker.ch; spf=pass smtp.mailfrom=pschenker.ch; dkim=pass (1024-bit key) header.d=pschenker.ch header.i=@pschenker.ch header.b=QZkCmAOa; arc=none smtp.client-ip=45.157.188.9 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=pschenker.ch Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pschenker.ch Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=pschenker.ch header.i=@pschenker.ch header.b="QZkCmAOa" Received: from smtp-4-0001.mail.infomaniak.ch (smtp-4-0001.mail.infomaniak.ch [10.7.10.108]) by smtp-4-3000.mail.infomaniak.ch (Postfix) with ESMTPS id 4ggwSm312Wzbwx; Thu, 18 Jun 2026 11:30:48 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pschenker.ch; s=20220412; t=1781775048; bh=dB0Vq19/pojtzKMdhU+ZjSekw7vileLMRuihFiNJgbY=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=QZkCmAOaWPmGsisoVV7yHqc53vNnggu3Bg6/wYzJCYSgrPjBlmb/6HqOCH9HtFeq1 /oRHdXW3gab/eEdvxtLK+1V8QVwnAgC9tYBywtlMGqYamMHLA6yboVopbf8tiJVjxQ sL/zRJUCBVWwLL8fkWBN2vWfTWGK0oP4O6u9NTbE= Received: from unknown by smtp-4-0001.mail.infomaniak.ch (Postfix) with ESMTPA id 4ggwSk2kZbzmC6; Thu, 18 Jun 2026 11:30:46 +0200 (CEST) Message-ID: Subject: Re: [PATCH net] net: ethernet: ti: icssg: guard PA stat lookups From: Philippe Schenker To: Simon Horman Cc: netdev@vger.kernel.org, danishanwar@ti.com, rogerq@kernel.org, linux-arm-kernel@lists.infradead.org, stable@vger.kernel.org, Andrew Lunn , David Carlier , "David S. Miller" , Eric Dumazet , Jacob Keller , Jakub Kicinski , Kevin Hao , Meghana Malladi , Paolo Abeni , Vadim Fedorenko , linux-kernel@vger.kernel.org Date: Thu, 18 Jun 2026 11:29:24 +0200 In-Reply-To: <20260618091004.GG827683@horms.kernel.org> References: <20260616143642.1972071-1-dev@pschenker.ch> <20260618091004.GG827683@horms.kernel.org> Content-Type: multipart/signed; micalg="pgp-sha512"; protocol="application/pgp-signature"; boundary="=-b4MkfBcVTcys+AbJZKR4" User-Agent: Evolution 3.60.2 Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Infomaniak-Routing: alpha --=-b4MkfBcVTcys+AbJZKR4 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi Simon Thanks for the review and I'll send a v2 with that blank line removed. Saw it right after sending the patch. Philippe On Thu, 2026-06-18 at 10:10 +0100, Simon Horman wrote: > On Tue, Jun 16, 2026 at 04:35:34PM +0200, Philippe Schenker wrote: > > From: Philippe Schenker > >=20 > > icssg_ndo_get_stats64() unconditionally calls > > emac_get_stat_by_name() > > with FW PA stat names regardless of whether the PA stats block is > > present on the hardware.=C2=A0 emac_get_stat_by_name() already guards > > the > > PA stats lookup with `if (emac->prueth->pa_stats)`; when that > > pointer > > is NULL the lookup falls through to netdev_err() and returns - > > EINVAL. > > Because ndo_get_stats64 is polled regularly by the networking stack > > this produces thousands of log entries of the form: > >=20 > > =C2=A0 icssg-prueth icssg1-eth end0: Invalid stats FW_RX_ERROR > >=20 > > A secondary consequence is that the int(-EINVAL) return value is > > implicitly widened to a near-ULLONG_MAX unsigned value when > > accumulated > > into the __u64 fields of rtnl_link_stats64, silently corrupting the > > rx_errors, rx_dropped and tx_dropped counters reported by `ip -s > > link`. > >=20 > > Every other PA-aware code path in the driver is already guarded > > with > > the same `if (emac->prueth->pa_stats)` check.=C2=A0 Apply the same guar= d > > here. > >=20 > > Fixes: 0d15a26b247d ("net: ti: icssg-prueth: Add ICSSG FW Stats") >=20 > nit: no blank line between tags >=20 > >=20 > > Signed-off-by: Philippe Schenker > >=20 > > Cc: danishanwar@ti.com > > Cc: rogerq@kernel.org > > Cc: linux-arm-kernel@lists.infradead.org > > Cc: stable@vger.kernel.org >=20 > Reviewed-by: Simon Horman --=-b4MkfBcVTcys+AbJZKR4 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- iQGzBAABCgAdFiEEPaCxfVqqNYSPnRhRjRDjR2hoXxoFAmozunUACgkQjRDjR2ho XxorIgv+MdrlIU+2xGujhlcXTn+Dsq0kw33yjB3erdz6HBgq+DdEkIa0y70uv3T2 MqpKAYE3rPZQ3S8fZWhmzeJAFFXTgVF+G9XANpH9K3f0GClORwvNfjKfeS6sbbo3 9eg+iiQbKUSRBp6gYmAWySaaVXtu1rl4dWav4PBpHz+E8psyn7gsdBTePWozMhSe g9LI+eN8dt9j3khhcaSNQYulCe3GGomP5akVXTDNgYZo3fksJtoYX1r5wgYk78Ni UGBZHDol//C/rhpSGh7OF/HkBhz0ALZ6ceA+HzfCMwbJWy8IStRHtmMVBUEg+jZC sgJM8IRw5KRzVtp2N48ZgjYH3nryykpheySI+Rp9c7ZnY0Jqf+vDjS3ucjPUEmSk XherZhqhT0+nE4eaYJDNU+F/QudOvMHSYH+sk3mnCjpuGdOai8BDdhV+oq1Ql0LV W17nyWFwwmtgSQKbR3NV537nWIzKGqz5PEcHye6GowHRoTeH1rbLPSFYaIbPEvbd kgjvWlmW =KfCZ -----END PGP SIGNATURE----- --=-b4MkfBcVTcys+AbJZKR4--