netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: ebiederm@xmission.com (Eric W. Biederman)
To: David Miller <davem@davemloft.net>
Cc: netdev@vger.kernel.org, containers@lists.osdl.org
Subject: Re: [PATCH 1/4] net: Dynamically allocate the per cpu counters for the loopback device.
Date: Thu, 27 Sep 2007 01:48:00 -0600	[thread overview]
Message-ID: <m1myv8r1lb.fsf@ebiederm.dsl.xmission.com> (raw)
In-Reply-To: <20070926.220901.51682476.davem@davemloft.net> (David Miller's message of "Wed, 26 Sep 2007 22:09:01 -0700 (PDT)")

David Miller <davem@davemloft.net> writes:

> From: ebiederm@xmission.com (Eric W. Biederman)
> Date: Wed, 26 Sep 2007 17:53:40 -0600
>
>> 
>> This patch add support for dynamically allocating the statistics counters
>> for the loopback device and adds appropriate device methods for allocating
>> and freeing the loopback device.
>> 
>> This completes support for creating multiple instances of the loopback
>> device,  in preparation for creating per network namespace instances.
>> 
>> Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
>
> Applied to net-2.6.24, thanks.
>
>> @@ -155,7 +154,8 @@ static int loopback_xmit(struct sk_buff *skb, struct
> net_device *dev)
>>  	dev->last_rx = jiffies;
>>  
>>  	/* it's OK to use __get_cpu_var() because BHs are off */
>> -	lb_stats = &__get_cpu_var(pcpu_lstats);
>> +	pcpu_lstats = netdev_priv(dev);
>> +	lb_stats = per_cpu_ptr(pcpu_lstats, smp_processor_id());
>>  	lb_stats->bytes += skb->len;
>>  	lb_stats->packets++;
>>  
>
> I'm going to add a followon change that gets rid of that
> comment about __get_cpu_var() since it is no longer
> relevant.

Good point.

I'm not doing get_cpu/put_cpu so does the comment make sense
in relationship to per_cpu_ptr?

Eric


  reply	other threads:[~2007-09-27  7:48 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-09-26 23:53 [PATCH 1/4] net: Dynamically allocate the per cpu counters for the loopback device Eric W. Biederman
2007-09-26 23:55 ` [PATCH 2/4] net ipv4: Remove unnecessary test for the loopback device from inetdev_destroy Eric W. Biederman
2007-09-26 23:58   ` [PATCH 3/4] net ipv4: When possible test for IFF_LOOPBACK and not dev == loopback_dev Eric W. Biederman
2007-09-27  0:00     ` [PATCH 4/4] net: Make the loopback device per network namespace Eric W. Biederman
2007-09-27  5:11       ` David Miller
2007-09-27 12:14       ` [Devel] " Denis V. Lunev
2007-09-27 16:48         ` Eric W. Biederman
2007-09-27  5:10     ` [PATCH 3/4] net ipv4: When possible test for IFF_LOOPBACK and not dev == loopback_dev David Miller
2007-09-27 10:34     ` Daniel Lezcano
2007-09-27 16:10       ` Eric W. Biederman
2007-09-27  5:09   ` [PATCH 2/4] net ipv4: Remove unnecessary test for the loopback device from inetdev_destroy David Miller
2007-09-27  5:09 ` [PATCH 1/4] net: Dynamically allocate the per cpu counters for the loopback device David Miller
2007-09-27  7:48   ` Eric W. Biederman [this message]
2007-09-27 18:52     ` David Miller
2007-09-27 20:44       ` Eric W. Biederman
2007-09-27 20:56         ` 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=m1myv8r1lb.fsf@ebiederm.dsl.xmission.com \
    --to=ebiederm@xmission.com \
    --cc=containers@lists.osdl.org \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).