Commit edfe00b9 authored by Sebastian Ott's avatar Sebastian Ott Committed by Wen Zhiwei
Browse files

net/mlx5: unique names for per device caches

stable inclusion
from stable-v6.6.70
commit d6616dcd87216e444dda10de1c84e5ecb8c510b1
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/IBOHV1

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=d6616dcd87216e444dda10de1c84e5ecb8c510b1



--------------------------------

[ Upstream commit 25872a079bbbe952eb660249cc9f40fa75623e68 ]

Add the 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: default avatarSebastian Ott <sebott@redhat.com>
Reviewed-by: default avatarBreno Leitao <leitao@debian.org>
Reviewed-by: default avatarTariq Toukan <tariqt@nvidia.com>
Link: https://patch.msgid.link/20241023134146.28448-1-sebott@redhat.com


Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarWen Zhiwei <wenzhiwei@kylinos.cn>
parent 40a70aea
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -3478,6 +3478,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);
@@ -3502,10 +3503,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", dev_name(dev->device));
	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", dev_name(dev->device));
	steering->ftes_cache = kmem_cache_create(name, sizeof(struct fs_fte), 0,
						 0, NULL);
	if (!steering->ftes_cache || !steering->fgs_cache) {
		err = -ENOMEM;