Skip to content

Commit

Permalink
[NET]: Bring comments in loopback.c uptodate.
Browse files Browse the repository at this point in the history
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>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Eric W. Biederman authored and David S. Miller committed Oct 10, 2007
1 parent fe242cf commit 9e0db4b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/net/loopback.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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)
{
Expand Down

0 comments on commit 9e0db4b

Please sign in to comment.