Skip to content

Commit dd77abf

Browse files
majdmellanoxdledford
authored andcommitted
IB/mlx4: Support RAW Ethernet when RoCE is disabled
On some environments, such as certain SR-IOV VF configurations, RoCE isn't supported for mlx4 Ethernet ports. Currently the driver will not open IB device on that port. This is problematic since we do want user-space RAW Ethernet QPs functionality to remain in place. For that end, enhance the relevant driver flows such that we do create a device instance in that case. Signed-off-by: Majd Dibbiny <majd@mellanox.com> Signed-off-by: Leon Romanovsky <leon@kernel.org> Signed-off-by: Doug Ledford <dledford@redhat.com>
1 parent b312be3 commit dd77abf

2 files changed

Lines changed: 12 additions & 17 deletions

File tree

‎drivers/infiniband/hw/mlx4/main.c‎

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2867,23 +2867,19 @@ static void *mlx4_ib_add(struct mlx4_dev *dev)
28672867
if (mlx4_ib_init_sriov(ibdev))
28682868
goto err_mad;
28692869

2870-
if (dev->caps.flags & MLX4_DEV_CAP_FLAG_IBOE ||
2871-
dev->caps.flags2 & MLX4_DEV_CAP_FLAG2_ROCE_V1_V2) {
2872-
if (!iboe->nb.notifier_call) {
2873-
iboe->nb.notifier_call = mlx4_ib_netdev_event;
2874-
err = register_netdevice_notifier(&iboe->nb);
2875-
if (err) {
2876-
iboe->nb.notifier_call = NULL;
2877-
goto err_notif;
2878-
}
2879-
}
2880-
if (dev->caps.flags2 & MLX4_DEV_CAP_FLAG2_ROCE_V1_V2) {
2881-
err = mlx4_config_roce_v2_port(dev, ROCE_V2_UDP_DPORT);
2882-
if (err) {
2883-
goto err_notif;
2884-
}
2870+
if (!iboe->nb.notifier_call) {
2871+
iboe->nb.notifier_call = mlx4_ib_netdev_event;
2872+
err = register_netdevice_notifier(&iboe->nb);
2873+
if (err) {
2874+
iboe->nb.notifier_call = NULL;
2875+
goto err_notif;
28852876
}
28862877
}
2878+
if (dev->caps.flags2 & MLX4_DEV_CAP_FLAG2_ROCE_V1_V2) {
2879+
err = mlx4_config_roce_v2_port(dev, ROCE_V2_UDP_DPORT);
2880+
if (err)
2881+
goto err_notif;
2882+
}
28872883

28882884
for (j = 0; j < ARRAY_SIZE(mlx4_class_attributes); ++j) {
28892885
if (device_create_file(&ibdev->ib_dev.dev,

‎include/linux/mlx4/device.h‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1011,8 +1011,7 @@ struct mlx4_mad_ifc {
10111011
#define mlx4_foreach_ib_transport_port(port, dev) \
10121012
for ((port) = 1; (port) <= (dev)->caps.num_ports; (port)++) \
10131013
if (((dev)->caps.port_mask[port] == MLX4_PORT_TYPE_IB) || \
1014-
((dev)->caps.flags & MLX4_DEV_CAP_FLAG_IBOE) || \
1015-
((dev)->caps.flags2 & MLX4_DEV_CAP_FLAG2_ROCE_V1_V2))
1014+
((dev)->caps.port_mask[port] == MLX4_PORT_TYPE_ETH))
10161015

10171016
#define MLX4_INVALID_SLAVE_ID 0xFF
10181017
#define MLX4_SINK_COUNTER_INDEX(dev) (dev->caps.max_counters - 1)

0 commit comments

Comments
 (0)