diff options
author | Tariq Toukan <tariqt@nvidia.com> | 2020-12-30 11:42:46 +0200 |
---|---|---|
committer | Saeed Mahameed <saeedm@nvidia.com> | 2022-03-10 23:38:22 -0800 |
commit | b5e4c3079490638dafa59413a51f9aef3df120d9 (patch) | |
tree | f86bdf82d6fb2f06699e7171f88a45dd5664bec4 /drivers/net/ethernet/mellanox/mlx5/core/uar.c | |
parent | 7f880719b953eba8c13b4e2ebe8c1f9d5fd44848 (diff) | |
download | linux-stable-b5e4c3079490638dafa59413a51f9aef3df120d9.tar.gz linux-stable-b5e4c3079490638dafa59413a51f9aef3df120d9.tar.bz2 linux-stable-b5e4c3079490638dafa59413a51f9aef3df120d9.zip |
net/mlx5: Node-aware allocation for UAR
Prefer the aware allocation, use the device NUMA node.
Signed-off-by: Tariq Toukan <tariqt@nvidia.com>
Reviewed-by: Moshe Shemesh <moshe@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
Diffstat (limited to 'drivers/net/ethernet/mellanox/mlx5/core/uar.c')
-rw-r--r-- | drivers/net/ethernet/mellanox/mlx5/core/uar.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/uar.c b/drivers/net/ethernet/mellanox/mlx5/core/uar.c index 9c81fb7c2c3c..8455e79bc44a 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/uar.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/uar.c @@ -99,19 +99,21 @@ static struct mlx5_uars_page *alloc_uars_page(struct mlx5_core_dev *mdev, int err = -ENOMEM; phys_addr_t pfn; int bfregs; + int node; int i; bfregs = uars_per_sys_page(mdev) * MLX5_BFREGS_PER_UAR; - up = kzalloc(sizeof(*up), GFP_KERNEL); + node = mdev->priv.numa_node; + up = kzalloc_node(sizeof(*up), GFP_KERNEL, node); if (!up) return ERR_PTR(err); up->mdev = mdev; - up->reg_bitmap = bitmap_zalloc(bfregs, GFP_KERNEL); + up->reg_bitmap = bitmap_zalloc_node(bfregs, GFP_KERNEL, node); if (!up->reg_bitmap) goto error1; - up->fp_bitmap = bitmap_zalloc(bfregs, GFP_KERNEL); + up->fp_bitmap = bitmap_zalloc_node(bfregs, GFP_KERNEL, node); if (!up->fp_bitmap) goto error1; |