Re: [PATCH] bridge: per-cpu packet statistics

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

 



On Tue, 02 Mar 2010 10:02:59 +0100
Eric Dumazet <eric.dumazet@xxxxxxxxx> wrote:

> From: Stephen Hemminger <shemminger@xxxxxxxxxx>
> 
> Le lundi 01 mars 2010 à 16:16 -0800, Stephen Hemminger a écrit :
> 
> > +	for_each_online_cpu(cpu) {
> > +		const struct br_cpu_netstats *bstats
> > +			= per_cpu_ptr(br->stats, cpu);
> > +
> > +		stats->rx_bytes   += bstats->rx_bytes;
> > +		stats->rx_packets += bstats->rx_packets;
> > +	}
> 
> And last point, we should use for_each_possible_cpu() here
> 
> Here is your patch with all my comments integrated :
> 
> 1) Use txq->{tx_bytes|tx_packets} counter
> 
> 2) alloc_percpu(struct ...) instead of alloc_percpu(sizeof(struct ...))
> 
> 3) free_netdev() in destructor
> 
> 4) for_each_possible_cpu() instead of for_each_online_cpu()
> 
> 5) br_get_stats() use local variables for the sake of concurrent users

No need, bridge has no queue!
_______________________________________________
Bridge mailing list
Bridge@xxxxxxxxxxxxxxxxxxxxxxxxxx
https://lists.linux-foundation.org/mailman/listinfo/bridge


[Index of Archives]     [Netdev]     [AoE Tools]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]     [Video 4 Linux]

  Powered by Linux