Skip to content

Commit

Permalink
hv_netvsc: Allocate the receive buffer from the correct NUMA node
Browse files Browse the repository at this point in the history
Allocate the receive bufer from the NUMA node assigned to the primary
channel.

Signed-off-by: K. Y. Srinivasan <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
kattisrinivasan authored and davem330 committed May 31, 2015
1 parent 282c320 commit 0a726c2
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion drivers/net/hyperv/netvsc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 0a726c2

Please sign in to comment.