mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-29 01:51:39 +00:00
Merge branch 'hv_netvsc-next'
K. Y. Srinivasan says: ==================== hv_netvsc: Implement NUMA aware memory allocation Allocate both receive buffer and send buffer from the NUMA node assigned to the primary channel. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
commit
d1f5f2bb91
1 changed files with 9 additions and 2 deletions
|
@ -227,13 +227,18 @@ static int netvsc_init_buf(struct hv_device *device)
|
||||||
struct netvsc_device *net_device;
|
struct netvsc_device *net_device;
|
||||||
struct nvsp_message *init_packet;
|
struct nvsp_message *init_packet;
|
||||||
struct net_device *ndev;
|
struct net_device *ndev;
|
||||||
|
int node;
|
||||||
|
|
||||||
net_device = get_outbound_net_device(device);
|
net_device = get_outbound_net_device(device);
|
||||||
if (!net_device)
|
if (!net_device)
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
ndev = net_device->ndev;
|
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);
|
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);
|
||||||
|
@ -321,6 +326,8 @@ static int netvsc_init_buf(struct hv_device *device)
|
||||||
|
|
||||||
/* Now setup the send buffer.
|
/* Now setup the send buffer.
|
||||||
*/
|
*/
|
||||||
|
net_device->send_buf = vzalloc_node(net_device->send_buf_size, node);
|
||||||
|
if (!net_device->send_buf)
|
||||||
net_device->send_buf = vzalloc(net_device->send_buf_size);
|
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 "
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue