Skip to contentSkip to conversation

Bring comments in loopback.c uptodate.

PATCH Applied Eric W. Biederman 2 participants 2 messages Sep 27, 2007 – Sep 28, 2007

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Bring comments in loopback.c uptodate.

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.

---
 drivers/net/loopback.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
drivers/net/loopback.c +3 -1
index 2617320..cba5c76 100644
@@ -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)
 {
Signature · 1 line
1.5.3.rc6.17.g1911