public inbox for linux-rdma@vger.kernel.org
 help / color / mirror / Atom feed
From: Adam Li <adamli@os.amperecomputing.com>
To: Saeed Mahameed <saeed@kernel.org>
Cc: leon@kernel.org, tariqt@nvidia.com, davem@davemloft.net,
	edumazet@google.com, kuba@kernel.org, pabeni@redhat.com,
	netdev@vger.kernel.org, linux-rdma@vger.kernel.org,
	linux-kernel@vger.kernel.org, patches@amperecomputing.com,
	"Lameter, Christopher" <cl@os.amperecomputing.com>,
	shijie@os.amperecomputing.com, cl@linux.com,
	Adam Li <adam.li@amperecomputing.com>
Subject: Re: [PATCH] net/mlx5: Node-aware allocation for mlx5_buf_list
Date: Sat, 12 Oct 2024 10:39:45 +0800	[thread overview]
Message-ID: <9782df45-b0da-46fa-9e0d-1c8f8b0e05d0@os.amperecomputing.com> (raw)
In-Reply-To: <ZuCv8VyJqoChZLIx@x130>

Hi Saeed,

Very sorry for the slow reply.

On 9/11/2024 4:45 AM, Saeed Mahameed wrote:
> On 06 Sep 06:11, Adam Li wrote:
>> 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().

>> 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
>>
>>

Thanks,
-adam


      parent reply	other threads:[~2024-10-12  2:39 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-06  6:11 [PATCH] net/mlx5: Node-aware allocation for mlx5_buf_list Adam Li
2024-09-10 12:11 ` Leon Romanovsky
     [not found] ` <ZuCv8VyJqoChZLIx@x130>
2024-10-12  2:39   ` Adam Li [this message]

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=9782df45-b0da-46fa-9e0d-1c8f8b0e05d0@os.amperecomputing.com \
    --to=adamli@os.amperecomputing.com \
    --cc=adam.li@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=saeed@kernel.org \
    --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