lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <89a401dd-b6a9-4b1b-b323-10d713646e5d@lunn.ch>
Date: Tue, 18 Nov 2025 17:49:55 +0100
From: Andrew Lunn <andrew@...n.ch>
To: David Yang <mmyangfl@...il.com>
Cc: netdev@...r.kernel.org, Vladimir Oltean <olteanv@...il.com>,
	"David S. Miller" <davem@...emloft.net>,
	Eric Dumazet <edumazet@...gle.com>,
	Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH net-next] net: dsa: yt921x: Fix MIB attribute table

On Tue, Nov 18, 2025 at 05:12:33PM +0800, David Yang wrote:
> There are holes in the MIB field I didn't notice, leading to wrong
> statistics after stress tests.
> 
> Signed-off-by: David Yang <mmyangfl@...il.com>
> ---
>  drivers/net/dsa/yt921x.c | 22 +++++++++++-----------
>  1 file changed, 11 insertions(+), 11 deletions(-)
> 
> diff --git a/drivers/net/dsa/yt921x.c b/drivers/net/dsa/yt921x.c
> index 944988e29127..97fc6085f4d0 100644
> --- a/drivers/net/dsa/yt921x.c
> +++ b/drivers/net/dsa/yt921x.c
> @@ -56,13 +56,13 @@ static const struct yt921x_mib_desc yt921x_mib_descs[] = {
>  
>  	MIB_DESC(1, 0x30, NULL),	/* RxPktSz1024To1518 */
>  	MIB_DESC(1, 0x34, NULL),	/* RxPktSz1519ToMax */
> -	MIB_DESC(2, 0x38, NULL),	/* RxGoodBytes */
> -	/* 0x3c */
> +	/* 0x38 unused */
> +	MIB_DESC(2, 0x3c, NULL),	/* RxGoodBytes */

How is this described in the datasheet? Maybe add #defines for each
location? At could mean you don't need the comment, since the #define
documents what it is.

> @@ -705,7 +705,7 @@ static int yt921x_read_mib(struct yt921x_priv *priv, int port)
>  			res = yt921x_reg_read(priv, reg + 4, &val1);
>  			if (res)
>  				break;
> -			val = ((u64)val0 << 32) | val1;
> +			val = ((u64)val1 << 32) | val0;

And that is a different thing, has nothing to do with holes. This
should be mentioned in the commit message.

    Andrew

---
pw-bot: cr

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ