Commit 71a39bbb authored by Moni Shoua's avatar Moni Shoua Committed by Doug Ledford

IB/mlx4: Enable RoCE v2 when the IB device is added

If the hardware supports RoCE v2, we configure the hardware UDP
port according to the RoCE v2 Annex when mlx4_ib device is added.
Signed-off-by: default avatarMoni Shoua <monis@mellanox.com>
Signed-off-by: default avatarMatan Barak <matanb@mellanox.com>
Signed-off-by: default avatarDoug Ledford <dledford@redhat.com>
parent 3b5daf28
...@@ -2488,7 +2488,8 @@ static void *mlx4_ib_add(struct mlx4_dev *dev) ...@@ -2488,7 +2488,8 @@ static void *mlx4_ib_add(struct mlx4_dev *dev)
if (mlx4_ib_init_sriov(ibdev)) if (mlx4_ib_init_sriov(ibdev))
goto err_mad; goto err_mad;
if (dev->caps.flags & MLX4_DEV_CAP_FLAG_IBOE) { if (dev->caps.flags & MLX4_DEV_CAP_FLAG_IBOE ||
dev->caps.flags2 & MLX4_DEV_CAP_FLAG2_ROCE_V1_V2) {
if (!iboe->nb.notifier_call) { if (!iboe->nb.notifier_call) {
iboe->nb.notifier_call = mlx4_ib_netdev_event; iboe->nb.notifier_call = mlx4_ib_netdev_event;
err = register_netdevice_notifier(&iboe->nb); err = register_netdevice_notifier(&iboe->nb);
...@@ -2497,6 +2498,12 @@ static void *mlx4_ib_add(struct mlx4_dev *dev) ...@@ -2497,6 +2498,12 @@ static void *mlx4_ib_add(struct mlx4_dev *dev)
goto err_notif; goto err_notif;
} }
} }
if (dev->caps.flags2 & MLX4_DEV_CAP_FLAG2_ROCE_V1_V2) {
err = mlx4_config_roce_v2_port(dev, ROCE_V2_UDP_DPORT);
if (err) {
goto err_notif;
}
}
} }
for (j = 0; j < ARRAY_SIZE(mlx4_class_attributes); ++j) { for (j = 0; j < ARRAY_SIZE(mlx4_class_attributes); ++j) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment