net/mlx5: Node-aware allocation for mlx5_buf_list
Subsystems (4)
PATCH 1/1 net/mlx5: Node-aware allocation for mlx5_buf_list
Allocation for mlx5_frag_buf.frags[i].buf is node-aware. Make mlx5_frag_buf.frags allocation node-aware too.
--- drivers/net/ethernet/mellanox/mlx5/core/alloc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/ethernet/mellanox/mlx5/core/alloc.c +2 -2
@@ -79,8 +79,8 @@ int mlx5_frag_buf_alloc_node(struct mlx5_core_dev *dev, int size, buf->size = size; buf->npages =DIV_ROUND_UP (size,PAGE_SIZE ); buf->page_shift =PAGE_SHIFT ; - buf->frags =kcalloc (buf->npages,sizeof (struct mlx5_buf_list ), -GFP_KERNEL ); + buf->frags =kcalloc_node (buf->npages,sizeof (struct mlx5_buf_list ), +GFP_KERNEL , node);if (!buf->frags) goto err_out;
Signature · 1 line
2.25.1
Quoted 9 lines · Adam Li
Allocation for mlx5_frag_buf.frags[i].buf is node-aware. Make mlx5_frag_buf.frags allocation node-aware too.
Signed-off-by Adam Li <[email protected]>Reviewed-by Christoph Lameter (Ampere) <[email protected]>--- drivers/net/ethernet/mellanox/mlx5/core/alloc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
Thanks,
A message that is not in the archive (sent off-list or not yet received): ZuCv8VyJqoChZLIx@x130
Hi Saeed,
Very sorry for the slow reply.
Quoted 7 lines · Saeed Mahameed
Quoted 3 lines · Adam Li
Allocation for mlx5_frag_buf.frags[i].buf is node-aware. Make mlx5_frag_buf.frags allocation node-aware too.
Why ? buf is accessed by the device but "frags" only accessed by CPU.
Yes, this patch hopes to minimize CPU cross node memory access. I observed 'frags' is accessed on RX path from mlx5e_alloc_rx_mpwqe().
Quoted 21 lines
Quoted 21 lines
Signed-off-by Adam Li <[email protected]>Reviewed-by Christoph Lameter (Ampere) <[email protected]>---
drivers/net/ethernet/mellanox/mlx5/core/alloc.c| 4 ++--1 file changed, 2 insertions(+), 2 deletions(-)drivers/net/ethernet/mellanox/mlx5/core/alloc.c +2
-2@@ -79,8 +79,8 @@ int mlx5_frag_buf_alloc_node(struct mlx5_core_dev *dev, int size, buf->size = size; buf->npages = DIV_ROUND_UP(size, PAGE_SIZE); buf->page_shift = PAGE_SHIFT; - buf->frags = kcalloc(buf->npages, sizeof(struct mlx5_buf_list), - GFP_KERNEL); + buf->frags = kcalloc_node(buf->npages, sizeof(struct mlx5_buf_list), + GFP_KERNEL, node); if (!buf->frags) goto err_out;
Quoted 4 lines
Quoted 4 lines
--
2.25.1
Thanks,
-adam