hv_netvsc: Allocate the receive buffer from the correct NUMA node
authorK. Y. Srinivasan <kys@microsoft.com>
Fri, 29 May 2015 00:08:06 +0000 (17:08 -0700)
committerDavid S. Miller <davem@davemloft.net>
Sun, 31 May 2015 07:22:56 +0000 (00:22 -0700)
Allocate the receive bufer from the NUMA node assigned to the primary
channel.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/hyperv/netvsc.c

index b0249685139cc7b56840e50cdf8f5c569c59c54f..d187965eba367bfe595fc4137655b84bb18ee625 100644 (file)
@@ -227,13 +227,18 @@ static int netvsc_init_buf(struct hv_device *device)
        struct netvsc_device *net_device;
        struct nvsp_message *init_packet;
        struct net_device *ndev;
+       int node;
 
        net_device = get_outbound_net_device(device);
        if (!net_device)
                return -ENODEV;
        ndev = net_device->ndev;
 
-       net_device->recv_buf = vzalloc(net_device->recv_buf_size);
+       node = cpu_to_node(device->channel->target_cpu);
+       net_device->recv_buf = vzalloc_node(net_device->recv_buf_size, node);
+       if (!net_device->recv_buf)
+               net_device->recv_buf = vzalloc(net_device->recv_buf_size);
+
        if (!net_device->recv_buf) {
                netdev_err(ndev, "unable to allocate receive "
                        "buffer of size %d\n", net_device->recv_buf_size);