Skip to content

Commit

Permalink
net/mlx5: Consider RoCE cap before init RDMA resources
Browse files Browse the repository at this point in the history
[ Upstream commit c189716 ]

Check if RoCE is supported by the device before enable it in
the vport context and create all the RDMA steering objects.

Fixes: 80f09df ("net/mlx5: Eswitch, enable RoCE loopback traffic")
Signed-off-by: Maor Gottlieb <maorg@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
maorgottlieb authored and gregkh committed Jun 23, 2021
1 parent be7f3f4 commit 792f16e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/net/ethernet/mellanox/mlx5/core/rdma.c
Expand Up @@ -156,6 +156,9 @@ void mlx5_rdma_enable_roce(struct mlx5_core_dev *dev)
{
int err;

if (!MLX5_CAP_GEN(dev, roce))
return;

err = mlx5_nic_vport_enable_roce(dev);
if (err) {
mlx5_core_err(dev, "Failed to enable RoCE: %d\n", err);
Expand Down

0 comments on commit 792f16e

Please sign in to comment.