Netdev List
 help / color / mirror / Atom feed
From: Eric Dumazet <eric.dumazet@gmail.com>
To: Stephen Hemminger <shemminger@vyatta.com>
Cc: David Miller <davem@davemloft.net>,
	netdev@vger.kernel.org, bridge@lists.linux-foundation.org
Subject: Re: [PATCH]  bridge: per-cpu packet statistics
Date: Tue, 02 Mar 2010 07:01:30 +0100	[thread overview]
Message-ID: <1267509690.2843.5.camel@edumazet-laptop> (raw)
In-Reply-To: <20100301161658.5a61143b@nehalam>

Le lundi 01 mars 2010 à 16:16 -0800, Stephen Hemminger a écrit :
> The shared packet statistics are a potential source of slow down
> on bridged traffic. Convert to per-cpu array, but only keep those
> statistics which change per-packet.
> 
> Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
> 
> ---
> 
>  net/bridge/br_device.c  |   43 ++++++++++++++++++++++++++++++++++++++-----
>  net/bridge/br_if.c      |    6 ++++++
>  net/bridge/br_input.c   |    5 +++--
>  net/bridge/br_private.h |    8 ++++++++
>  4 files changed, 55 insertions(+), 7 deletions(-)
> 
> --- a/net/bridge/br_device.c	2010-03-01 08:22:23.476657998 -0800
> +++ b/net/bridge/br_device.c	2010-03-01 15:31:36.737227465 -0800
> @@ -26,11 +26,12 @@ netdev_tx_t br_dev_xmit(struct sk_buff *
>  	const unsigned char *dest = skb->data;
>  	struct net_bridge_fdb_entry *dst;
>  	struct net_bridge_mdb_entry *mdst;
> +	struct br_cpu_netstats *brstats = this_cpu_ptr(br->stats);
>  
> -	BR_INPUT_SKB_CB(skb)->brdev = dev;
> +	brstats->tx_packets++;
> +	brstats->tx_bytes += skb->len;


On TX path, this is not really necessary, since we already dirtied
txq->lock before calling br_dev_xmit(), we can use txq->tx_packets and
txq->tx_bytes for free ?

>  
> -	dev->stats.tx_packets++;
> -	dev->stats.tx_bytes += skb->len;
> +	BR_INPUT_SKB_CB(skb)->brdev = dev;
>  
>  	skb_reset_mac_header(skb);
>  	skb_pull(skb, ETH_HLEN);
> @@ -81,6 +82,28 @@ static int br_dev_stop(struct net_device
>  	return 0;
>  }
>  



  reply	other threads:[~2010-03-02  6:01 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-02  0:16 [PATCH] bridge: per-cpu packet statistics Stephen Hemminger
2010-03-02  6:01 ` Eric Dumazet [this message]
2010-03-02 17:22   ` [Bridge] " Stephen Hemminger
2010-03-16  2:48     ` Herbert Xu
2010-03-02  7:43 ` Eric Dumazet
2010-03-02  7:51 ` Eric Dumazet
2010-03-02  9:02 ` Eric Dumazet
2010-03-02 17:23   ` [Bridge] " Stephen Hemminger
2010-03-16  2:51     ` Herbert Xu
2010-03-02 17:58   ` [PATCH] bridge: per-cpu packet statistics (v2) Stephen Hemminger
2010-03-02 18:06     ` Eric Dumazet
2010-03-02 23:32       ` [Bridge] [PATCH] bridge: per-cpu packet statistics (v3) Stephen Hemminger
2010-03-03  6:09         ` Eric Dumazet
2010-03-03  9:16           ` David Miller
2010-03-17  4:27         ` David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1267509690.2843.5.camel@edumazet-laptop \
    --to=eric.dumazet@gmail.com \
    --cc=bridge@lists.linux-foundation.org \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    --cc=shemminger@vyatta.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox