lkml.org 
[lkml]   [2011]   [Nov]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH net-next v5 07/10] forcedeth: implement ndo_get_stats64() API
From
Date
On Wed, 2011-11-16 at 08:55 -0800, Stephen Hemminger wrote:
> On Tue, 15 Nov 2011 21:15:55 -0800
> David Decotigny <david.decotigny@google.com> wrote:
>
> > This commit implements the ndo_get_stats64() API for forcedeth. Since
> > these stats are being updated from different contexts (process and
> > timer), this commit adds protection (locking + atomic variables).
> >
> > Tested:
> > - 16-way SMP x86_64 ->
> > RX bytes:7244556582 (7.2 GB) TX bytes:181904254 (181.9 MB)
> > - pktgen + loopback: identical rx_bytes/tx_bytes and rx_packets/tx_packets
>
> Rather than adding additional locking why not use a percpu structure
> to hold statistics. See loopback, macvlan, veth, xen-netfront.

percpu is stupid for a single-queue driver.

> Or realize that the Tx side is single threaded by dev->xmit_lock already
> and the Rx side is single threaded by NAPI.

Right.

Ben.

--
Ben Hutchings, Staff Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.



\
 
 \ /
  Last update: 2011-11-16 18:17    [W:1.260 / U:0.004 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site