diff options
-rw-r--r-- | drivers/infiniband/hw/mlx4/main.c | 8 | ||||
-rw-r--r-- | drivers/net/ethernet/mellanox/mlx4/fw.c | 6 | ||||
-rw-r--r-- | include/linux/mlx4/device.h | 4 |
3 files changed, 10 insertions, 8 deletions
diff --git a/drivers/infiniband/hw/mlx4/main.c b/drivers/infiniband/hw/mlx4/main.c index 46303b209ce..e849347ef99 100644 --- a/drivers/infiniband/hw/mlx4/main.c +++ b/drivers/infiniband/hw/mlx4/main.c | |||
@@ -1293,11 +1293,15 @@ static void *mlx4_ib_add(struct mlx4_dev *dev) | |||
1293 | 1293 | ||
1294 | pr_info_once("%s", mlx4_ib_version); | 1294 | pr_info_once("%s", mlx4_ib_version); |
1295 | 1295 | ||
1296 | if (mlx4_is_mfunc(dev)) { | 1296 | mlx4_foreach_non_ib_transport_port(i, dev) |
1297 | pr_warn("IB not yet supported in SRIOV\n"); | 1297 | num_ports++; |
1298 | |||
1299 | if (mlx4_is_mfunc(dev) && num_ports) { | ||
1300 | dev_err(&dev->pdev->dev, "RoCE is not supported over SRIOV as yet\n"); | ||
1298 | return NULL; | 1301 | return NULL; |
1299 | } | 1302 | } |
1300 | 1303 | ||
1304 | num_ports = 0; | ||
1301 | mlx4_foreach_ib_transport_port(i, dev) | 1305 | mlx4_foreach_ib_transport_port(i, dev) |
1302 | num_ports++; | 1306 | num_ports++; |
1303 | 1307 | ||
diff --git a/drivers/net/ethernet/mellanox/mlx4/fw.c b/drivers/net/ethernet/mellanox/mlx4/fw.c index bf159c0fe82..1d74e854114 100644 --- a/drivers/net/ethernet/mellanox/mlx4/fw.c +++ b/drivers/net/ethernet/mellanox/mlx4/fw.c | |||
@@ -1391,9 +1391,6 @@ int mlx4_INIT_PORT_wrapper(struct mlx4_dev *dev, int slave, | |||
1391 | if (priv->mfunc.master.slave_state[slave].init_port_mask & (1 << port)) | 1391 | if (priv->mfunc.master.slave_state[slave].init_port_mask & (1 << port)) |
1392 | return 0; | 1392 | return 0; |
1393 | 1393 | ||
1394 | if (dev->caps.port_mask[port] == MLX4_PORT_TYPE_IB) | ||
1395 | return -ENODEV; | ||
1396 | |||
1397 | if (dev->caps.port_mask[port] != MLX4_PORT_TYPE_IB) { | 1394 | if (dev->caps.port_mask[port] != MLX4_PORT_TYPE_IB) { |
1398 | /* Enable port only if it was previously disabled */ | 1395 | /* Enable port only if it was previously disabled */ |
1399 | if (!priv->mfunc.master.init_port_ref[port]) { | 1396 | if (!priv->mfunc.master.init_port_ref[port]) { |
@@ -1489,9 +1486,6 @@ int mlx4_CLOSE_PORT_wrapper(struct mlx4_dev *dev, int slave, | |||
1489 | (1 << port))) | 1486 | (1 << port))) |
1490 | return 0; | 1487 | return 0; |
1491 | 1488 | ||
1492 | if (dev->caps.port_mask[port] == MLX4_PORT_TYPE_IB) | ||
1493 | return -ENODEV; | ||
1494 | |||
1495 | if (dev->caps.port_mask[port] != MLX4_PORT_TYPE_IB) { | 1489 | if (dev->caps.port_mask[port] != MLX4_PORT_TYPE_IB) { |
1496 | if (priv->mfunc.master.init_port_ref[port] == 1) { | 1490 | if (priv->mfunc.master.init_port_ref[port] == 1) { |
1497 | err = mlx4_cmd(dev, 0, port, 0, MLX4_CMD_CLOSE_PORT, | 1491 | err = mlx4_cmd(dev, 0, port, 0, MLX4_CMD_CLOSE_PORT, |
diff --git a/include/linux/mlx4/device.h b/include/linux/mlx4/device.h index b3f9b4500b9..9b243df789e 100644 --- a/include/linux/mlx4/device.h +++ b/include/linux/mlx4/device.h | |||
@@ -697,6 +697,10 @@ struct mlx4_init_port_param { | |||
697 | for ((port) = 1; (port) <= (dev)->caps.num_ports; (port)++) \ | 697 | for ((port) = 1; (port) <= (dev)->caps.num_ports; (port)++) \ |
698 | if ((type) == (dev)->caps.port_mask[(port)]) | 698 | if ((type) == (dev)->caps.port_mask[(port)]) |
699 | 699 | ||
700 | #define mlx4_foreach_non_ib_transport_port(port, dev) \ | ||
701 | for ((port) = 1; (port) <= (dev)->caps.num_ports; (port)++) \ | ||
702 | if (((dev)->caps.port_mask[port] != MLX4_PORT_TYPE_IB)) | ||
703 | |||
700 | #define mlx4_foreach_ib_transport_port(port, dev) \ | 704 | #define mlx4_foreach_ib_transport_port(port, dev) \ |
701 | for ((port) = 1; (port) <= (dev)->caps.num_ports; (port)++) \ | 705 | for ((port) = 1; (port) <= (dev)->caps.num_ports; (port)++) \ |
702 | if (((dev)->caps.port_mask[port] == MLX4_PORT_TYPE_IB) || \ | 706 | if (((dev)->caps.port_mask[port] == MLX4_PORT_TYPE_IB) || \ |