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: <4CB55975.4080109@kernel.org>
Date:	Wed, 13 Oct 2010 11:02:13 +0400
From:	Denis Kirjanov <dkirjanov@...nel.org>
To:	Eric Dumazet <eric.dumazet@...il.com>
CC:	netdev@...r.kernel.org, David Miller <davem@...emloft.net>,
	Joe Perches <joe@...ches.com>,
	Ben Hutchings <bhutchings@...arflare.com>,
	Jeff Garzik <jgarzik@...hat.com>
Subject: Re: [PATCH -next] sundance: Add initial ethtool stats support

On 10/13/2010 10:33 AM, Eric Dumazet wrote:
> Le mercredi 13 octobre 2010 à 10:06 +0400, Denis Kirjanov a écrit :
> 
>> @@ -1494,13 +1506,23 @@ static struct net_device_stats *get_stats(struct net_device *dev)
>>  	dev->stats.rx_missed_errors	+= ioread8(ioaddr + RxMissed);
>>  	dev->stats.tx_packets += ioread16(ioaddr + TxFramesOK);
>>  	dev->stats.rx_packets += ioread16(ioaddr + RxFramesOK);
>> -	dev->stats.collisions += ioread8(ioaddr + StatsLateColl);
>> -	dev->stats.collisions += ioread8(ioaddr + StatsMultiColl);
>> -	dev->stats.collisions += ioread8(ioaddr + StatsOneColl);
>>  	dev->stats.tx_carrier_errors += ioread8(ioaddr + StatsCarrierError);
>> -	ioread8(ioaddr + StatsTxDefer);
>> -	for (i = StatsTxDefer; i <= StatsMcastRx; i++)
>> -		ioread8(ioaddr + i);
>> +
>> +	np->xstats.tx_multiple_collisions += ioread8(ioaddr + StatsMultiColl);
>> +	np->xstats.tx_single_collisions += ioread8(ioaddr + StatsOneColl);
>> +	np->xstats.tx_late_collisions += ioread8(ioaddr + StatsLateColl);
>> +	dev->stats.collisions += np->xstats.tx_multiple_collisions
>> +		+ np->xstats.tx_single_collisions
>> +		+ np->xstats.tx_late_collisions;
> 
> 
> Oh well..., really ?
> 
> Each time we are calling get_stats(), you do
> 
> dev->stats.collisions += (number of accumulated collisions since device
> is up)
> 
> instead of
> 
> dev->stats.collisions += (number of accumulated collisions since last
> time we read counters)
> 
> 
> Can you see the problem ?

Oops, thanks Eric!
I'll fix it up and resend
> 
> 

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ