]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
net/mlx5: SF, Fix add port error handling
authorChris Mi <cmi@nvidia.com>
Wed, 15 Jan 2025 11:39:06 +0000 (13:39 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 4 Sep 2025 13:30:28 +0000 (15:30 +0200)
commit1b3ccc39480722fc0c11537858a47e0c8cc9ad3c
tree3e6ce31a958ea70384deefcfe44e48cf7e30719d
parentea687c003663d1698131b3c75e8a1286becd52b4
net/mlx5: SF, Fix add port error handling

commit 2011a2a18ef00b5b8e4b753acbe6451a8c5f2260 upstream.

If failed to add SF, error handling doesn't delete the SF from the
SF table. But the hw resources are deleted. So when unload driver,
hw resources will be deleted again. Firmware will report syndrome
0x68def3 which means "SF is not allocated can not deallocate".

Fix it by delete SF from SF table if failed to add SF.

Fixes: 2597ee190b4e ("net/mlx5: Call mlx5_sf_id_erase() once in mlx5_sf_dealloc()")
Signed-off-by: Chris Mi <cmi@nvidia.com>
Reviewed-by: Shay Drori <shayd@nvidia.com>
Reviewed-by: Jacob Keller <jacob.e.keller@intel.com>
Signed-off-by: Tariq Toukan <tariqt@nvidia.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/ethernet/mellanox/mlx5/core/sf/devlink.c