Commit b5e4c307 authored by Tariq Toukan's avatar Tariq Toukan Committed by Saeed Mahameed

net/mlx5: Node-aware allocation for UAR

Prefer the aware allocation, use the device NUMA node.
Signed-off-by: default avatarTariq Toukan <tariqt@nvidia.com>
Reviewed-by: default avatarMoshe Shemesh <moshe@nvidia.com>
Signed-off-by: default avatarSaeed Mahameed <saeedm@nvidia.com>
parent 7f880719
...@@ -99,19 +99,21 @@ static struct mlx5_uars_page *alloc_uars_page(struct mlx5_core_dev *mdev, ...@@ -99,19 +99,21 @@ static struct mlx5_uars_page *alloc_uars_page(struct mlx5_core_dev *mdev,
int err = -ENOMEM; int err = -ENOMEM;
phys_addr_t pfn; phys_addr_t pfn;
int bfregs; int bfregs;
int node;
int i; int i;
bfregs = uars_per_sys_page(mdev) * MLX5_BFREGS_PER_UAR; 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) if (!up)
return ERR_PTR(err); return ERR_PTR(err);
up->mdev = mdev; 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) if (!up->reg_bitmap)
goto error1; goto error1;
up->fp_bitmap = bitmap_zalloc(bfregs, GFP_KERNEL); up->fp_bitmap = bitmap_zalloc_node(bfregs, GFP_KERNEL, node);
if (!up->fp_bitmap) if (!up->fp_bitmap)
goto error1; goto error1;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment