hv_netvsc: Allocate the receive buffer from the correct NUMA node
Subsystems (3)
PATCH 1/1 hv_netvsc: Allocate the receive buffer from the correct NUMA node
Allocate the receive bufer from the NUMA node assigned to the primary channel.
Signed-off-by K. Y. Srinivasan <[email protected]>
--- drivers/net/hyperv/netvsc.c | 7 ++++++- 1 files changed, 6 insertions(+), 1 deletions(-)
drivers/net/hyperv/netvsc.c +6 -1
@@ -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);
Signature · 1 line
1.7.4.1
Quoted 44 lines
-----Original Message-----
From: K. Y. Srinivasan [mailto:[email protected]]
Sent: Thursday, May 28, 2015 2:56 PM
To: [email protected]; [email protected]; linux- [email protected]; [email protected]; [email protected]; [email protected]; [email protected]
Cc: KY Srinivasan
Subject: [PATCH 1/1]hv_netvsc: Allocate the receive buffer from the correct NUMA nodeAllocate the receive bufer from the NUMA node assigned to the primary channel.
Signed-off-by K. Y. Srinivasan <[email protected]>--- drivers/net/hyperv/netvsc.c | 7 ++++++- 1 files changed, 6 insertions(+), 1 deletions(-)drivers/net/hyperv/netvsc.c +6
-1@@ -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 "
Quoted 3 lines
"buffer of size %d\n",
net_device->recv_buf_size);
--
1.7.4.1
David,
Please drop this patch; I am going to resend this with another patch.
Regards,
K. Y