On 18.10.2020 14:16, Vladimir Oltean wrote: > On Sun, Oct 18, 2020 at 02:02:46PM +0200, Heiner Kallweit wrote: >> Wouldn't a simple unsigned long (like in struct net_device_stats) be >> sufficient here? This would make handling the counter much simpler. >> And as far as I understand we talk about a packet counter that is >> touched in certain scenarios only. > > I don't understand, in what sense 'sufficient'? This counter is exported > to ethtool which works with u64 values, how would an unsigned long, > which is u32 on 32-bit systems, help? > Sufficient for me means that it's unlikely that a 32 bit counter will overflow. Many drivers use the 32 bit counters (on a 32bit system) in net_device_stats for infrequent events like rx/tx errors, and 64bit counters only for things like rx/tx bytes, which are more likely to overflow.
- Re: [RFC PATCH 02/13] net: dsa: imp... Vladimir Oltean
- Re: [RFC PATCH 02/13] net: dsa:... Christian Eggers
- Re: [RFC PATCH 02/13] net: dsa:... Vladimir Oltean
- [RFC PATCH 06/13] net: dsa: tag_ocelot: let DSA core deal... Vladimir Oltean
- [RFC PATCH 01/13] net: dsa: add plumbing for custom netde... Vladimir Oltean
- Re: [RFC PATCH 01/13] net: dsa: add plumbing for cus... Florian Fainelli
- Re: [RFC PATCH 01/13] net: dsa: add plumbing for cus... Andrew Lunn
- Re: [RFC PATCH 01/13] net: dsa: add plumbing for... Vladimir Oltean
- Re: [RFC PATCH 01/13] net: dsa: add plumbing for cus... Heiner Kallweit
- Re: [RFC PATCH 01/13] net: dsa: add plumbing for... Vladimir Oltean
- Re: [RFC PATCH 01/13] net: dsa: add plumbing... Heiner Kallweit
- Re: [RFC PATCH 01/13] net: dsa: add plum... Vladimir Oltean
- Re: [RFC PATCH 01/13] net: dsa: add... Heiner Kallweit
- Re: [RFC PATCH 01/13] net: dsa:... Vladimir Oltean
- Re: [RFC PATCH 01/13] net: dsa:... Florian Fainelli
- Re: [RFC PATCH 01/13] net: dsa:... Vladimir Oltean
- Re: [RFC PATCH 01/13] net: dsa:... Florian Fainelli
- Re: [RFC PATCH 01/13] net: dsa:... Andrew Lunn
- Re: [RFC PATCH 01/13] net: dsa:... Florian Fainelli
- Re: [RFC PATCH 01/13] net: dsa: add plumbing for cus... Jakub Kicinski