Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 103589
b: refs/heads/master
c: e3c50d5
h: refs/heads/master
i:
  103587: 7d3b358
v: v3
  • Loading branch information
David S. Miller committed Jul 18, 2008
1 parent 2936121 commit 6d5224b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 6b0fb1261a4655613bed5dac0e935e733969e999
refs/heads/master: e3c50d5d25ac09efd9acbe2b2a3e365466de84ed
8 changes: 4 additions & 4 deletions trunk/drivers/net/loopback.c
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ static int loopback_xmit(struct sk_buff *skb, struct net_device *dev)
dev->last_rx = jiffies;

/* it's OK to use per_cpu_ptr() because BHs are off */
pcpu_lstats = netdev_priv(dev);
pcpu_lstats = dev->ml_priv;
lb_stats = per_cpu_ptr(pcpu_lstats, smp_processor_id());
lb_stats->bytes += skb->len;
lb_stats->packets++;
Expand All @@ -171,7 +171,7 @@ static struct net_device_stats *get_stats(struct net_device *dev)
unsigned long packets = 0;
int i;

pcpu_lstats = netdev_priv(dev);
pcpu_lstats = dev->ml_priv;
for_each_possible_cpu(i) {
const struct pcpu_lstats *lb_stats;

Expand Down Expand Up @@ -207,13 +207,13 @@ static int loopback_dev_init(struct net_device *dev)
if (!lstats)
return -ENOMEM;

dev->priv = lstats;
dev->ml_priv = lstats;
return 0;
}

static void loopback_dev_free(struct net_device *dev)
{
struct pcpu_lstats *lstats = netdev_priv(dev);
struct pcpu_lstats *lstats = dev->ml_priv;

free_percpu(lstats);
free_netdev(dev);
Expand Down
4 changes: 3 additions & 1 deletion trunk/include/linux/netdevice.h
Original file line number Diff line number Diff line change
Expand Up @@ -808,7 +808,9 @@ void dev_net_set(struct net_device *dev, struct net *net)
*/
static inline void *netdev_priv(const struct net_device *dev)
{
return dev->priv;
return (char *)dev + ((sizeof(struct net_device)
+ NETDEV_ALIGN_CONST)
& ~NETDEV_ALIGN_CONST);
}

/* Set the sysfs physical device reference for the network logical device
Expand Down

0 comments on commit 6d5224b

Please sign in to comment.