Commit 95833370 authored by stephen hemminger's avatar stephen hemminger Committed by David S. Miller

netvsc: no need to allocate send/receive on numa node

The send and receive buffers are both per-device (not per-channel).
The associated NUMA node is a property of the CPU which is per-channel
therefore it makes no sense to force the receive/send buffer to be
allocated on a particular node (since it is a shared resource).
Signed-off-by: default avatarStephen Hemminger <sthemmin@microsoft.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 68d715f6
...@@ -246,20 +246,13 @@ int netvsc_alloc_recv_comp_ring(struct netvsc_device *net_device, u32 q_idx) ...@@ -246,20 +246,13 @@ int netvsc_alloc_recv_comp_ring(struct netvsc_device *net_device, u32 q_idx)
static int netvsc_init_buf(struct hv_device *device, static int netvsc_init_buf(struct hv_device *device,
struct netvsc_device *net_device) struct netvsc_device *net_device)
{ {
int ret = 0;
struct nvsp_message *init_packet;
struct nvsp_1_message_send_receive_buffer_complete *resp; struct nvsp_1_message_send_receive_buffer_complete *resp;
struct net_device *ndev; struct net_device *ndev = hv_get_drvdata(device);
struct nvsp_message *init_packet;
size_t map_words; size_t map_words;
int node; int ret = 0;
ndev = hv_get_drvdata(device);
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);
net_device->recv_buf = vzalloc(net_device->recv_buf_size);
if (!net_device->recv_buf) { if (!net_device->recv_buf) {
netdev_err(ndev, "unable to allocate receive " netdev_err(ndev, "unable to allocate receive "
"buffer of size %d\n", net_device->recv_buf_size); "buffer of size %d\n", net_device->recv_buf_size);
...@@ -340,9 +333,7 @@ static int netvsc_init_buf(struct hv_device *device, ...@@ -340,9 +333,7 @@ static int netvsc_init_buf(struct hv_device *device,
goto cleanup; goto cleanup;
/* Now setup the send buffer. */ /* Now setup the send buffer. */
net_device->send_buf = vzalloc_node(net_device->send_buf_size, node); net_device->send_buf = vzalloc(net_device->send_buf_size);
if (!net_device->send_buf)
net_device->send_buf = vzalloc(net_device->send_buf_size);
if (!net_device->send_buf) { if (!net_device->send_buf) {
netdev_err(ndev, "unable to allocate send " netdev_err(ndev, "unable to allocate send "
"buffer of size %d\n", net_device->send_buf_size); "buffer of size %d\n", net_device->send_buf_size);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment