netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Bring comments in loopback.c uptodate.
@ 2007-09-27 22:39 Eric W. Biederman
  2007-09-28  0:09 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Eric W. Biederman @ 2007-09-27 22:39 UTC (permalink / raw)
  To: David Miller; +Cc: netdev


A hint as to why it is safe to use per cpu variables,
and note that we actually can have multiple instances
of the loopback device now.

Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
---
 drivers/net/loopback.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/drivers/net/loopback.c b/drivers/net/loopback.c
index 2617320..cba5c76 100644
--- a/drivers/net/loopback.c
+++ b/drivers/net/loopback.c
@@ -154,6 +154,7 @@ static int loopback_xmit(struct sk_buff *skb, struct net_device *dev)
 #endif
 	dev->last_rx = jiffies;
 
+	/* it's OK to use per_cpu_ptr() because BHs are off */
 	pcpu_lstats = netdev_priv(dev);
 	lb_stats = per_cpu_ptr(pcpu_lstats, smp_processor_id());
 	lb_stats->bytes += skb->len;
@@ -221,7 +222,8 @@ static void loopback_dev_free(struct net_device *dev)
 }
 
 /*
- * The loopback device is special. There is only one instance.
+ * The loopback device is special. There is only one instance 
+ * per network namespace.
  */
 static void loopback_setup(struct net_device *dev)
 {
-- 
1.5.3.rc6.17.g1911


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] Bring comments in loopback.c uptodate.
  2007-09-27 22:39 [PATCH] Bring comments in loopback.c uptodate Eric W. Biederman
@ 2007-09-28  0:09 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2007-09-28  0:09 UTC (permalink / raw)
  To: ebiederm; +Cc: netdev

From: ebiederm@xmission.com (Eric W. Biederman)
Date: Thu, 27 Sep 2007 16:39:53 -0600

> 
> A hint as to why it is safe to use per cpu variables,
> and note that we actually can have multiple instances
> of the loopback device now.
> 
> Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>

Applied.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2007-09-28  0:09 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-09-27 22:39 [PATCH] Bring comments in loopback.c uptodate Eric W. Biederman
2007-09-28  0:09 ` David Miller

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).