提交 026149cb 编写于 作者: J Jack Morgenstein 提交者: Roland Dreier

mlx4: Activate SR-IOV mode for IB

Remove the error returns for IB ports from mlx4_ib_add,
mlx4_INIT_PORT_wrapper, and mlx4_CLOSE_PORT_wrapper.

Currently, SRIOV is supported only for devices for which the
link layer is IB on all ports; RoCE support will be added later.
Signed-off-by: NJack Morgenstein <jackm@dev.mellanox.co.il>
Signed-off-by: NRoland Dreier <roland@purestorage.com>
上级 992e8e6e
...@@ -1293,11 +1293,15 @@ static void *mlx4_ib_add(struct mlx4_dev *dev) ...@@ -1293,11 +1293,15 @@ static void *mlx4_ib_add(struct mlx4_dev *dev)
pr_info_once("%s", mlx4_ib_version); pr_info_once("%s", mlx4_ib_version);
if (mlx4_is_mfunc(dev)) { mlx4_foreach_non_ib_transport_port(i, dev)
pr_warn("IB not yet supported in SRIOV\n"); num_ports++;
if (mlx4_is_mfunc(dev) && num_ports) {
dev_err(&dev->pdev->dev, "RoCE is not supported over SRIOV as yet\n");
return NULL; return NULL;
} }
num_ports = 0;
mlx4_foreach_ib_transport_port(i, dev) mlx4_foreach_ib_transport_port(i, dev)
num_ports++; num_ports++;
......
...@@ -1391,9 +1391,6 @@ int mlx4_INIT_PORT_wrapper(struct mlx4_dev *dev, int slave, ...@@ -1391,9 +1391,6 @@ int mlx4_INIT_PORT_wrapper(struct mlx4_dev *dev, int slave,
if (priv->mfunc.master.slave_state[slave].init_port_mask & (1 << port)) if (priv->mfunc.master.slave_state[slave].init_port_mask & (1 << port))
return 0; return 0;
if (dev->caps.port_mask[port] == MLX4_PORT_TYPE_IB)
return -ENODEV;
if (dev->caps.port_mask[port] != MLX4_PORT_TYPE_IB) { if (dev->caps.port_mask[port] != MLX4_PORT_TYPE_IB) {
/* Enable port only if it was previously disabled */ /* Enable port only if it was previously disabled */
if (!priv->mfunc.master.init_port_ref[port]) { if (!priv->mfunc.master.init_port_ref[port]) {
...@@ -1489,9 +1486,6 @@ int mlx4_CLOSE_PORT_wrapper(struct mlx4_dev *dev, int slave, ...@@ -1489,9 +1486,6 @@ int mlx4_CLOSE_PORT_wrapper(struct mlx4_dev *dev, int slave,
(1 << port))) (1 << port)))
return 0; return 0;
if (dev->caps.port_mask[port] == MLX4_PORT_TYPE_IB)
return -ENODEV;
if (dev->caps.port_mask[port] != MLX4_PORT_TYPE_IB) { if (dev->caps.port_mask[port] != MLX4_PORT_TYPE_IB) {
if (priv->mfunc.master.init_port_ref[port] == 1) { if (priv->mfunc.master.init_port_ref[port] == 1) {
err = mlx4_cmd(dev, 0, port, 0, MLX4_CMD_CLOSE_PORT, err = mlx4_cmd(dev, 0, port, 0, MLX4_CMD_CLOSE_PORT,
......
...@@ -697,6 +697,10 @@ struct mlx4_init_port_param { ...@@ -697,6 +697,10 @@ struct mlx4_init_port_param {
for ((port) = 1; (port) <= (dev)->caps.num_ports; (port)++) \ for ((port) = 1; (port) <= (dev)->caps.num_ports; (port)++) \
if ((type) == (dev)->caps.port_mask[(port)]) if ((type) == (dev)->caps.port_mask[(port)])
#define mlx4_foreach_non_ib_transport_port(port, dev) \
for ((port) = 1; (port) <= (dev)->caps.num_ports; (port)++) \
if (((dev)->caps.port_mask[port] != MLX4_PORT_TYPE_IB))
#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) || \
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册