]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
net/mlx5: Use devlink port pointer to get the pointer of container SF struct
authorJiri Pirko <jiri@nvidia.com>
Wed, 17 May 2023 11:59:34 +0000 (13:59 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 4 Sep 2025 13:30:24 +0000 (15:30 +0200)
commita7e9da4d3afb304dec9ab73880f4d55babebe215
treeaeb94d6249ee4d02c53dbcb1810704b40995b15c
parent25659835c7afb8c7f21656e285dea1e44a0a6a53
net/mlx5: Use devlink port pointer to get the pointer of container SF struct

[ Upstream commit 9caeb1475c3e852bcfa6332227c6bb2feaa8eb23 ]

Benefit from the fact that struct devlink_port is eventually embedded
in struct mlx5_sf and use container_of() macro to get it instead of the
xarray lookup in every devlink port op.

Signed-off-by: Jiri Pirko <jiri@nvidia.com>
Reviewed-by: Shay Drory <shayd@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
Stable-dep-of: 26e42ec7712d ("net/mlx5: Nack sync reset when SFs are present")
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/mellanox/mlx5/core/sf/devlink.c