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] [thread-next>] [day] [month] [year] [list]
Message-ID:
 <PAXPR04MB851070E3D67D390B7A4114F88879A@PAXPR04MB8510.eurprd04.prod.outlook.com>
Date: Mon, 23 Jun 2025 01:49:59 +0000
From: Wei Fang <wei.fang@....com>
To: Simon Horman <horms@...nel.org>
CC: Claudiu Manoil <claudiu.manoil@....com>, Vladimir Oltean
	<vladimir.oltean@....com>, Clark Wang <xiaoning.wang@....com>,
	"andrew+netdev@...n.ch" <andrew+netdev@...n.ch>, "davem@...emloft.net"
	<davem@...emloft.net>, "edumazet@...gle.com" <edumazet@...gle.com>,
	"kuba@...nel.org" <kuba@...nel.org>, "pabeni@...hat.com" <pabeni@...hat.com>,
	"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	"imx@...ts.linux.dev" <imx@...ts.linux.dev>
Subject: RE: [PATCH net-next 1/3] net: enetc: change the statistics of ring to
 unsigned long type

> >  struct enetc_ring_stats {
> > -	unsigned int packets;
> > -	unsigned int bytes;
> > -	unsigned int rx_alloc_errs;
> > -	unsigned int xdp_drops;
> > -	unsigned int xdp_tx;
> > -	unsigned int xdp_tx_drops;
> > -	unsigned int xdp_redirect;
> > -	unsigned int xdp_redirect_failures;
> > -	unsigned int recycles;
> > -	unsigned int recycle_failures;
> > -	unsigned int win_drop;
> > +	unsigned long packets;
> > +	unsigned long bytes;
> > +	unsigned long rx_alloc_errs;
> > +	unsigned long xdp_drops;
> > +	unsigned long xdp_tx;
> > +	unsigned long xdp_tx_drops;
> > +	unsigned long xdp_redirect;
> > +	unsigned long xdp_redirect_failures;
> > +	unsigned long recycles;
> > +	unsigned long recycle_failures;
> > +	unsigned long win_drop;
> >  };
> 
> Hi Wei fang,
> 
> If the desire is for an unsigned 64 bit integer, then I think either u64 or unsigned
> long long would be good choices.
> 
> unsigned long may be 64bit or 32bit depending on the platform.

The use of unsigned long is to keep it consistent with the statistical
value type in struct net_device_stats. Because some statistics in
net_device_stats come from enetc_ring_stats.

#define NET_DEV_STAT(FIELD)			\
	union {					\
		unsigned long FIELD;		\
		atomic_long_t __##FIELD;	\
	}


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ