Skip to content

Commit

Permalink
net/mlx5: SF, Fix add port error handling
Browse files Browse the repository at this point in the history
[ Upstream commit 2011a2a ]

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: 2597ee1 ("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: Sasha Levin <sashal@kernel.org>
  • Loading branch information
Chris Mi authored and gregkh committed Jan 23, 2025
1 parent 6210f06 commit df0e2cd
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/net/ethernet/mellanox/mlx5/core/sf/devlink.c
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,7 @@ static int mlx5_sf_add(struct mlx5_core_dev *dev, struct mlx5_sf_table *table,
return 0;

esw_err:
mlx5_sf_function_id_erase(table, sf);
mlx5_sf_free(table, sf);
return err;
}
Expand Down

0 comments on commit df0e2cd

Please sign in to comment.