From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp-42a8.mail.infomaniak.ch (smtp-42a8.mail.infomaniak.ch [84.16.66.168]) (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 2DBFD3E009B for ; Thu, 18 Jun 2026 09:39:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=84.16.66.168 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781775596; cv=none; b=vGWLgTXjEC9uVbU5A7lxtukVvriG14VYdR9eGny4by5fNTzT6UDVy0IuSapjJRZzk36YZYXPNpP9NmFirp3oFl/mYy1hwCZSN1zpN7RNJaMf0sGT1XDUNhR/Oaf2ihhPhR/WvG9Y/yYPxrd1qGUaJ5A2GX5YysdUK7sl0oOc1Pg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781775596; c=relaxed/simple; bh=dB0Vq19/pojtzKMdhU+ZjSekw7vileLMRuihFiNJgbY=; h=Message-ID:Subject:From:To:Cc:Date:In-Reply-To:References: Content-Type:MIME-Version; b=LQNz+qBzpMM4+RO31apDohIuQH0agX5/0PJxep47gWmtgebQHmE35e/69R4Fh9d23kquYdI8HPO4IC2Vinb1mQTdySQgcYagjV3YiJecJYC49Tq/2Y7S4RLftD0V8CC/4iUveQ0/LGzfCLw0Q3l9DIxyeWxlL6heBP9ga2jom60= 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=84.16.66.168 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-3-3000.mail.infomaniak.ch (Postfix) with ESMTPS id 4ggwSm30plzg4l; 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: linux-kernel@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--