aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/veth.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/veth.c')
-rw-r--r--drivers/net/veth.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/net/veth.c b/drivers/net/veth.c
index eee1f19ef1e9..46e83e3fe999 100644
--- a/drivers/net/veth.c
+++ b/drivers/net/veth.c
@@ -230,10 +230,18 @@ static int veth_change_mtu(struct net_device *dev, int new_mtu)
230 230
231static int veth_dev_init(struct net_device *dev) 231static int veth_dev_init(struct net_device *dev)
232{ 232{
233 int i;
234
233 dev->vstats = alloc_percpu(struct pcpu_vstats); 235 dev->vstats = alloc_percpu(struct pcpu_vstats);
234 if (!dev->vstats) 236 if (!dev->vstats)
235 return -ENOMEM; 237 return -ENOMEM;
236 238
239 for_each_possible_cpu(i) {
240 struct pcpu_vstats *veth_stats;
241 veth_stats = per_cpu_ptr(dev->vstats, i);
242 u64_stats_init(&veth_stats->syncp);
243 }
244
237 return 0; 245 return 0;
238} 246}
239 247