* [PATCH 1/1] hv_netvsc: Allocate the receive buffer from the correct NUMA node
@ 2015-05-28 21:56 K. Y. Srinivasan
2015-05-28 22:29 ` KY Srinivasan
0 siblings, 1 reply; 2+ messages in thread
From: K. Y. Srinivasan @ 2015-05-28 21:56 UTC (permalink / raw)
To: davem, netdev, linux-kernel, devel, olaf, apw, jasowang; +Cc: K. Y. Srinivasan
Allocate the receive bufer from the NUMA node assigned to the primary
channel.
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
---
drivers/net/hyperv/netvsc.c | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletions(-)
diff --git a/drivers/net/hyperv/netvsc.c b/drivers/net/hyperv/netvsc.c
index b024968..d187965 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);
--
1.7.4.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* RE: [PATCH 1/1] hv_netvsc: Allocate the receive buffer from the correct NUMA node
2015-05-28 21:56 [PATCH 1/1] hv_netvsc: Allocate the receive buffer from the correct NUMA node K. Y. Srinivasan
@ 2015-05-28 22:29 ` KY Srinivasan
0 siblings, 0 replies; 2+ messages in thread
From: KY Srinivasan @ 2015-05-28 22:29 UTC (permalink / raw)
To: KY Srinivasan, davem@davemloft.net, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org, devel@linuxdriverproject.org,
olaf@aepfle.de, apw@canonical.com, jasowang@redhat.com
> -----Original Message-----
> From: K. Y. Srinivasan [mailto:kys@microsoft.com]
> Sent: Thursday, May 28, 2015 2:56 PM
> To: davem@davemloft.net; netdev@vger.kernel.org; linux-
> kernel@vger.kernel.org; devel@linuxdriverproject.org; olaf@aepfle.de;
> apw@canonical.com; jasowang@redhat.com
> Cc: KY Srinivasan
> Subject: [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 <kys@microsoft.com>
> ---
> drivers/net/hyperv/netvsc.c | 7 ++++++-
> 1 files changed, 6 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/net/hyperv/netvsc.c b/drivers/net/hyperv/netvsc.c
> index b024968..d187965 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);
> --
> 1.7.4.1
David,
Please drop this patch; I am going to resend this with another patch.
Regards,
K. Y
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-05-28 22:29 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-05-28 21:56 [PATCH 1/1] hv_netvsc: Allocate the receive buffer from the correct NUMA node K. Y. Srinivasan
2015-05-28 22:29 ` KY Srinivasan
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).