Subject: [net-next 12/15] net/mlx5: E-Switch, Use RoCE version 2 for loopback traffic

From: Saeed Mahameed <[email-masked]>
Date: Fri, 19 May 2023 10:55:54 -0700

From: Roi Dayan <[email-masked]>

Could be port initializing eswitch doesn't support RoCE version 1
but all ports should support RoCE version 2.

Signed-off-by: Roi Dayan <[email-masked]>
Reviewed-by: Maor Gottlieb <[email-masked]>
Signed-off-by: Saeed Mahameed <[email-masked]>
---
 drivers/net/ethernet/mellanox/mlx5/core/rdma.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/rdma.c b/drivers/net/ethernet/mellanox/mlx5/core/rdma.c
index 540cf05f6373..15bb562b3846 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/rdma.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/rdma.c
@@ -115,7 +115,7 @@ static int mlx5_rdma_enable_roce_steering(struct mlx5_core_dev *dev)
 
 static void mlx5_rdma_del_roce_addr(struct mlx5_core_dev *dev)
 {
-	mlx5_core_roce_gid_set(dev, 0, 0, 0,
+	mlx5_core_roce_gid_set(dev, 0, MLX5_ROCE_VERSION_2, 0,
 			       NULL, NULL, false, 0, 1);
 }
 
@@ -135,7 +135,7 @@ static int mlx5_rdma_add_roce_addr(struct mlx5_core_dev *dev)
 
 	mlx5_rdma_make_default_gid(dev, &gid);
 	return mlx5_core_roce_gid_set(dev, 0,
-				      MLX5_ROCE_VERSION_1,
+				      MLX5_ROCE_VERSION_2,
 				      0, gid.raw, mac,
 				      false, 0, 1);
 }
-- 
2.40.1