Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0a726c2b authored by K. Y. Srinivasan's avatar K. Y. Srinivasan Committed by David S. Miller
Browse files

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: default avatarK. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 282c320d
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -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;

	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);