From: Saeed Mahameed <saeed@kernel.org>
To: "David S. Miller" <davem@davemloft.net>,
Jakub Kicinski <kuba@kernel.org>
Cc: netdev@vger.kernel.org, Tariq Toukan <tariqt@nvidia.com>,
Moshe Shemesh <moshe@nvidia.com>,
Saeed Mahameed <saeedm@nvidia.com>
Subject: [net-next 06/15] net/mlx5: Node-aware allocation for UAR
Date: Thu, 10 Mar 2022 23:40:22 -0800 [thread overview]
Message-ID: <20220311074031.645168-7-saeed@kernel.org> (raw)
In-Reply-To: <20220311074031.645168-1-saeed@kernel.org>
From: Tariq Toukan <tariqt@nvidia.com>
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>
---
drivers/net/ethernet/mellanox/mlx5/core/uar.c | 8 +++++---
1 file 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;
--
2.35.1
next prev parent reply other threads:[~2022-03-11 7:40 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-11 7:40 [pull request][net-next 00/15] mlx5 updates 2022-03-10 Saeed Mahameed
2022-03-11 7:40 ` [net-next 01/15] net/mlx4: Delete useless moduleparam include Saeed Mahameed
2022-03-11 11:00 ` patchwork-bot+netdevbpf
2022-03-11 7:40 ` [net-next 02/15] net/mlx5: Delete useless module.h include Saeed Mahameed
2022-03-11 7:40 ` [net-next 03/15] net/mlx5: Node-aware allocation for the IRQ table Saeed Mahameed
2022-03-11 7:40 ` [net-next 04/15] net/mlx5: Node-aware allocation for the EQ table Saeed Mahameed
2022-03-11 7:40 ` [net-next 05/15] net/mlx5: Node-aware allocation for the EQs Saeed Mahameed
2022-03-11 7:40 ` Saeed Mahameed [this message]
2022-03-11 7:40 ` [net-next 07/15] net/mlx5: Node-aware allocation for the doorbell pgdir Saeed Mahameed
2022-03-11 7:40 ` [net-next 08/15] net/mlx5: CT: Introduce a platform for multiple flow steering providers Saeed Mahameed
2022-03-11 7:40 ` [net-next 09/15] net/mlx5: DR, Add helper to get backing dr table from a mlx5 flow table Saeed Mahameed
2022-03-11 7:40 ` [net-next 10/15] net/mlx5: Add smfs lib to export direct steering API to CT Saeed Mahameed
2022-03-11 7:40 ` [net-next 11/15] net/mlx5: CT: Add software steering ct flow steering provider Saeed Mahameed
2022-03-11 7:40 ` [net-next 12/15] net/mlx5: CT: Create smfs dr matchers dynamically Saeed Mahameed
2022-03-11 7:40 ` [net-next 13/15] net/mlx5: Query the maximum MCIA register read size from firmware Saeed Mahameed
2022-03-11 7:40 ` [net-next 14/15] net/mlx5: Parse module mapping using mlx5_ifc Saeed Mahameed
2022-03-11 7:40 ` [net-next 15/15] net/mlx5e: Remove overzealous validations in netlink EEPROM query Saeed Mahameed
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=20220311074031.645168-7-saeed@kernel.org \
--to=saeed@kernel.org \
--cc=davem@davemloft.net \
--cc=kuba@kernel.org \
--cc=moshe@nvidia.com \
--cc=netdev@vger.kernel.org \
--cc=saeedm@nvidia.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;
as well as URLs for NNTP newsgroup(s).