Commit dd77abf8 authored by Majd Dibbiny's avatar Majd Dibbiny Committed by Doug Ledford

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: default avatarMajd Dibbiny <majd@mellanox.com>
Signed-off-by: default avatarLeon Romanovsky <leon@kernel.org>
Signed-off-by: default avatarDoug Ledford <dledford@redhat.com>
parent b312be3d
...@@ -2867,23 +2867,19 @@ static void *mlx4_ib_add(struct mlx4_dev *dev) ...@@ -2867,23 +2867,19 @@ 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 (!iboe->nb.notifier_call) {
dev->caps.flags2 & MLX4_DEV_CAP_FLAG2_ROCE_V1_V2) { iboe->nb.notifier_call = mlx4_ib_netdev_event;
if (!iboe->nb.notifier_call) { err = register_netdevice_notifier(&iboe->nb);
iboe->nb.notifier_call = mlx4_ib_netdev_event; if (err) {
err = register_netdevice_notifier(&iboe->nb); iboe->nb.notifier_call = NULL;
if (err) { goto err_notif;
iboe->nb.notifier_call = NULL;
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;
}
} }
} }
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) {
if (device_create_file(&ibdev->ib_dev.dev, if (device_create_file(&ibdev->ib_dev.dev,
......
...@@ -1011,8 +1011,7 @@ struct mlx4_mad_ifc { ...@@ -1011,8 +1011,7 @@ struct mlx4_mad_ifc {
#define mlx4_foreach_ib_transport_port(port, dev) \ #define mlx4_foreach_ib_transport_port(port, dev) \
for ((port) = 1; (port) <= (dev)->caps.num_ports; (port)++) \ for ((port) = 1; (port) <= (dev)->caps.num_ports; (port)++) \
if (((dev)->caps.port_mask[port] == MLX4_PORT_TYPE_IB) || \ if (((dev)->caps.port_mask[port] == MLX4_PORT_TYPE_IB) || \
((dev)->caps.flags & MLX4_DEV_CAP_FLAG_IBOE) || \ ((dev)->caps.port_mask[port] == MLX4_PORT_TYPE_ETH))
((dev)->caps.flags2 & MLX4_DEV_CAP_FLAG2_ROCE_V1_V2))
#define MLX4_INVALID_SLAVE_ID 0xFF #define MLX4_INVALID_SLAVE_ID 0xFF
#define MLX4_SINK_COUNTER_INDEX(dev) (dev->caps.max_counters - 1) #define MLX4_SINK_COUNTER_INDEX(dev) (dev->caps.max_counters - 1)
......
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