]> git.hungrycats.org Git - linux/commit
net/mlx5: Fix RoCE setting at HCA level
authorShay Drory <shayd@nvidia.com>
Wed, 9 Nov 2022 12:42:59 +0000 (14:42 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 12 Jan 2023 11:00:35 +0000 (12:00 +0100)
commita6f3e37a5cd7e232b8762c4799a1bb4c4c0182aa
tree2d0e0397f5ffde0f366efb86c526020023aff585
parent53c1b82e565d65d6d0555eb7fea2da8d9650ad85
net/mlx5: Fix RoCE setting at HCA level

[ Upstream commit c4ad5f2bdad56265b23d3635494ecdb205431807 ]

mlx5 PF can disable RoCE for its VFs and SFs. In such case RoCE is
marked as unsupported on those VFs/SFs.
The cited patch added an option for disable (and enable) RoCE at HCA
level. However, that commit didn't check whether RoCE is supported on
the HCA and enabled user to try and set RoCE to on.
Fix it by checking whether the HCA supports RoCE.

Fixes: fbfa97b4d79f ("net/mlx5: Disable roce at HCA level")
Signed-off-by: Shay Drory <shayd@nvidia.com>
Reviewed-by: Moshe Shemesh <moshe@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/mellanox/mlx5/core/devlink.c
drivers/net/ethernet/mellanox/mlx5/core/main.c