The private area of a netdev is now at a fixed offset once more.
Unfortunately, some assumptions that netdev_priv() == netdev->priv
crept back into the tree. In particular this happened in the
loopback driver. Make it use netdev->ml_priv.
Signed-off-by: David S. Miller <davem@davemloft.net>
dev->last_rx = jiffies;
/* it's OK to use per_cpu_ptr() because BHs are off */
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++;
lb_stats = per_cpu_ptr(pcpu_lstats, smp_processor_id());
lb_stats->bytes += skb->len;
lb_stats->packets++;
unsigned long packets = 0;
int i;
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;
for_each_possible_cpu(i) {
const struct pcpu_lstats *lb_stats;
if (!lstats)
return -ENOMEM;
if (!lstats)
return -ENOMEM;
return 0;
}
static void loopback_dev_free(struct net_device *dev)
{
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);
free_percpu(lstats);
free_netdev(dev);
*/
static inline void *netdev_priv(const struct net_device *dev)
{
*/
static inline void *netdev_priv(const struct net_device *dev)
{
+ return (char *)dev + ((sizeof(struct net_device)
+ + NETDEV_ALIGN_CONST)
+ & ~NETDEV_ALIGN_CONST);
}
/* Set the sysfs physical device reference for the network logical device
}
/* Set the sysfs physical device reference for the network logical device