Re: [PATCH net-next v1 1/7] net: ethtool: plumb PHY stats to PHY drivers

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, 6 Dec 2024 09:11:32 +0000 Russell King (Oracle) wrote:
> Maybe:
> 
>  * The input structure is pre-initialised with ETHTOOL_STAT_NOT_SET and
>  * the implementation must only change implemented statistics.

Yup, that's better!

FWIW I think my brain goes to talking about zero-init because for
per-queue or per-cpu stats some drivers do:

	for each q:
		struct->stat += q->stat;

without first setting to 0. And it _seems_ fine since NOT_SET is -1,
and the off-by-one is hard to spot. But for PHY stats this sort of
iteration is very unlikely.




[Index of Archives]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux