net/mlx5_core: Allocate firmware pages from device's NUMA node
authorEli Cohen <eli@dev.mellanox.co.il>
Thu, 2 Apr 2015 14:07:19 +0000 (17:07 +0300)
committerDavid S. Miller <davem@davemloft.net>
Thu, 2 Apr 2015 20:33:40 +0000 (16:33 -0400)
Allocate firmware pages from the NUMA node which is close to the device.

Signed-off-by: Eli Cohen <eli@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mellanox/mlx5/core/pagealloc.c

index 4fdaae9b54d99f56f21a78706776805303ba5ed9..cf8591a0c48d5a718d5ec8c33637b443f72b5486 100644 (file)
@@ -243,8 +243,9 @@ static int alloc_system_page(struct mlx5_core_dev *dev, u16 func_id)
        struct page *page;
        u64 addr;
        int err;
+       int nid = dev_to_node(&dev->pdev->dev);
 
-       page = alloc_page(GFP_HIGHUSER);
+       page = alloc_pages_node(nid, GFP_HIGHUSER, 0);
        if (!page) {
                mlx5_core_warn(dev, "failed to allocate page\n");
                return -ENOMEM;