Browse Source

net/mlx5_core: Allocate firmware pages from device's NUMA node

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>
Eli Cohen 10 years ago
parent
commit
ad1891062a
1 changed files with 2 additions and 1 deletions
  1. 2 1
      drivers/net/ethernet/mellanox/mlx5/core/pagealloc.c

+ 2 - 1
drivers/net/ethernet/mellanox/mlx5/core/pagealloc.c

@@ -243,8 +243,9 @@ static int alloc_system_page(struct mlx5_core_dev *dev, u16 func_id)
 	struct page *page;
 	struct page *page;
 	u64 addr;
 	u64 addr;
 	int err;
 	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) {
 	if (!page) {
 		mlx5_core_warn(dev, "failed to allocate page\n");
 		mlx5_core_warn(dev, "failed to allocate page\n");
 		return -ENOMEM;
 		return -ENOMEM;