diff options
author | David S. Miller <davem@davemloft.net> | 2015-05-31 07:23:11 (GMT) |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-05-31 07:23:11 (GMT) |
commit | d1f5f2bb91094c9e6f7c98610d637ffdaedef116 (patch) | |
tree | 673fb2e8679129edfae28a0dd6b3b3001507a992 | |
parent | 282c320d33541d61f4ab91248448040c4ebab1fc (diff) | |
parent | 5defde5946676ee23cd6a9d0e1de899410f4a33f (diff) | |
download | linux-d1f5f2bb91094c9e6f7c98610d637ffdaedef116.tar.xz |
Merge branch 'hv_netvsc-next'
K. Y. Srinivasan says:
====================
hv_netvsc: Implement NUMA aware memory allocation
Allocate both receive buffer and send buffer from the NUMA node assigned to the
primary channel.
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/hyperv/netvsc.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/drivers/net/hyperv/netvsc.c b/drivers/net/hyperv/netvsc.c index b024968..06de98a 100644 --- a/drivers/net/hyperv/netvsc.c +++ b/drivers/net/hyperv/netvsc.c @@ -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); @@ -321,7 +326,9 @@ static int netvsc_init_buf(struct hv_device *device) /* Now setup the send buffer. */ - net_device->send_buf = vzalloc(net_device->send_buf_size); + net_device->send_buf = vzalloc_node(net_device->send_buf_size, node); + if (!net_device->send_buf) + net_device->send_buf = vzalloc(net_device->send_buf_size); if (!net_device->send_buf) { netdev_err(ndev, "unable to allocate send " "buffer of size %d\n", net_device->send_buf_size); |