From: Adam Li <adamli@os.amperecomputing.com>
To: saeedm@nvidia.com, leon@kernel.org, tariqt@nvidia.com,
davem@davemloft.net, edumazet@google.com, kuba@kernel.org,
pabeni@redhat.com
Cc: netdev@vger.kernel.org, linux-rdma@vger.kernel.org,
linux-kernel@vger.kernel.org, patches@amperecomputing.com,
cl@os.amperecomputing.com, shijie@os.amperecomputing.com,
Adam Li <adamli@os.amperecomputing.com>,
Christoph Lameter <cl@linux.com>
Subject: [PATCH] net/mlx5: Node-aware allocation for mlx5_buf_list
Date: Fri, 6 Sep 2024 06:11:15 +0000 [thread overview]
Message-ID: <20240906061115.522074-1-adamli@os.amperecomputing.com> (raw)
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 <adamli@os.amperecomputing.com>
Reviewed-by: Christoph Lameter (Ampere) <cl@linux.com>
---
drivers/net/ethernet/mellanox/mlx5/core/alloc.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/alloc.c b/drivers/net/ethernet/mellanox/mlx5/core/alloc.c
index 6aca004e88cd..fda17b41ff17 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/alloc.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/alloc.c
@@ -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;
--
2.25.1
next reply other threads:[~2024-09-06 6:12 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-06 6:11 Adam Li [this message]
2024-09-10 12:11 ` [PATCH] net/mlx5: Node-aware allocation for mlx5_buf_list Leon Romanovsky
[not found] ` <ZuCv8VyJqoChZLIx@x130>
2024-10-12 2:39 ` Adam Li
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240906061115.522074-1-adamli@os.amperecomputing.com \
--to=adamli@os.amperecomputing.com \
--cc=cl@linux.com \
--cc=cl@os.amperecomputing.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=kuba@kernel.org \
--cc=leon@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rdma@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=patches@amperecomputing.com \
--cc=saeedm@nvidia.com \
--cc=shijie@os.amperecomputing.com \
--cc=tariqt@nvidia.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox