From 33e6febfae1300f4388216274a3b8896f9277783 Mon Sep 17 00:00:00 2001 From: Christoph Lameter Date: Tue, 6 Nov 2007 11:33:56 -0800 Subject: [PATCH] cpu alloc: veth conversion Signed-off-by: Christoph Lameter --- drivers/net/veth.c | 10 +++++----- 1 files changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/net/veth.c b/drivers/net/veth.c index fdd1e03..0aba506 100644 --- a/drivers/net/veth.c +++ b/drivers/net/veth.c @@ -162,7 +162,7 @@ static int veth_xmit(struct sk_buff *skb, struct net_device *dev) rcv_priv = netdev_priv(rcv); cpu = smp_processor_id(); - stats = per_cpu_ptr(priv->stats, cpu); + stats = CPU_PTR(priv->stats, cpu); if (!(rcv->flags & IFF_UP)) goto outf; @@ -183,7 +183,7 @@ static int veth_xmit(struct sk_buff *skb, struct net_device *dev) stats->tx_bytes += length; stats->tx_packets++; - stats = per_cpu_ptr(rcv_priv->stats, cpu); + stats = CPU_PTR(rcv_priv->stats, cpu); stats->rx_bytes += length; stats->rx_packets++; @@ -217,7 +217,7 @@ static struct net_device_stats *veth_get_stats(struct net_device *dev) dev_stats->tx_dropped = 0; for_each_online_cpu(cpu) { - stats = per_cpu_ptr(priv->stats, cpu); + stats = CPU_PTR(priv->stats, cpu); dev_stats->rx_packets += stats->rx_packets; dev_stats->tx_packets += stats->tx_packets; @@ -261,7 +261,7 @@ static int veth_dev_init(struct net_device *dev) struct veth_net_stats *stats; struct veth_priv *priv; - stats = alloc_percpu(struct veth_net_stats); + stats = CPU_ALLOC(struct veth_net_stats, GFP_KERNEL | __GFP_ZER); if (stats == NULL) return -ENOMEM; @@ -275,7 +275,7 @@ static void veth_dev_free(struct net_device *dev) struct veth_priv *priv; priv = netdev_priv(dev); - free_percpu(priv->stats); + CPU_FREE(priv->stats); free_netdev(dev); } -- 1.5.3.4