net/mlx5: Consider RoCE cap before init RDMA resources
[ Upstream commitc189716b2a
] Check if RoCE is supported by the device before enable it in the vport context and create all the RDMA steering objects. Fixes:80f09dfc23
("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>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
4b16118665
commit
0bb0270832
@ -156,6 +156,9 @@ void mlx5_rdma_enable_roce(struct mlx5_core_dev *dev)
|
|||||||
{
|
{
|
||||||
int err;
|
int err;
|
||||||
|
|
||||||
|
if (!MLX5_CAP_GEN(dev, roce))
|
||||||
|
return;
|
||||||
|
|
||||||
err = mlx5_nic_vport_enable_roce(dev);
|
err = mlx5_nic_vport_enable_roce(dev);
|
||||||
if (err) {
|
if (err) {
|
||||||
mlx5_core_err(dev, "Failed to enable RoCE: %d\n", err);
|
mlx5_core_err(dev, "Failed to enable RoCE: %d\n", err);
|
||||||
|
Reference in New Issue
Block a user