[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID:
<IA0PR12MB8713EC167DC79275451864BADC6C2@IA0PR12MB8713.namprd12.prod.outlook.com>
Date: Fri, 20 Sep 2024 16:32:22 +0000
From: Parav Pandit <parav@...dia.com>
To: Sebastian Ott <sebott@...hat.com>, "netdev@...r.kernel.org"
<netdev@...r.kernel.org>, "linux-rdma@...r.kernel.org"
<linux-rdma@...r.kernel.org>, "linux-kernel@...r.kernel.org"
<linux-kernel@...r.kernel.org>
CC: Saeed Mahameed <saeedm@...dia.com>, Leon Romanovsky <leon@...nel.org>,
Tariq Toukan <tariqt@...dia.com>, "David S . Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>, Jakub Kicinski <kuba@...nel.org>, Paolo
Abeni <pabeni@...hat.com>
Subject: RE: [PATCH] net/mlx5: unique names for per device caches
Hi Sebastian,
> From: Sebastian Ott <sebott@...hat.com>
> Sent: Friday, September 20, 2024 8:04 PM
>
> Add the pci device name to the per device kmem_cache names to ensure
> their uniqueness. This fixes warnings like this:
> "kmem_cache of name 'mlx5_fs_fgs' already exists".
>
> Signed-off-by: Sebastian Ott <sebott@...hat.com>
> ---
> drivers/net/ethernet/mellanox/mlx5/core/fs_core.c | 7 +++++--
> 1 file changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/ethernet/mellanox/mlx5/core/fs_core.c
> b/drivers/net/ethernet/mellanox/mlx5/core/fs_core.c
> index 8505d5e241e1..5d54386a5669 100644
> --- a/drivers/net/ethernet/mellanox/mlx5/core/fs_core.c
> +++ b/drivers/net/ethernet/mellanox/mlx5/core/fs_core.c
> @@ -3689,6 +3689,7 @@ void mlx5_fs_core_free(struct mlx5_core_dev
> *dev) int mlx5_fs_core_alloc(struct mlx5_core_dev *dev) {
> struct mlx5_flow_steering *steering;
> + char name[80];
> int err = 0;
>
> err = mlx5_init_fc_stats(dev);
> @@ -3713,10 +3714,12 @@ int mlx5_fs_core_alloc(struct mlx5_core_dev
> *dev)
> else
> steering->mode = MLX5_FLOW_STEERING_MODE_DMFS;
>
> - steering->fgs_cache = kmem_cache_create("mlx5_fs_fgs",
> + snprintf(name, sizeof(name), "%s-mlx5_fs_fgs", pci_name(dev-
> >pdev));
> + steering->fgs_cache = kmem_cache_create(name,
> sizeof(struct
> mlx5_flow_group), 0,
> 0, NULL);
> - steering->ftes_cache = kmem_cache_create("mlx5_fs_ftes",
> sizeof(struct fs_fte), 0,
> + snprintf(name, sizeof(name), "%s-mlx5_fs_ftes", pci_name(dev-
> >pdev));
> + steering->ftes_cache = kmem_cache_create(name, sizeof(struct
> fs_fte),
> +0,
Mlx5 SFs are attached to the auxiliary bus. Hence, they will have duplicate name and this warning will persist.
Please change it to
pci_name(dev->pdev) to dev_name(dev->device)
This will uniformly work for PF, VF and SF.
> 0, NULL);
> if (!steering->ftes_cache || !steering->fgs_cache) {
> err = -ENOMEM;
> --
> 2.42.0
>
Powered by blists - more mailing lists