diff options
author | Or Gerlitz <ogerlitz@mellanox.com> | 2015-05-21 15:14:10 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-05-24 23:05:10 -0400 |
commit | be9b9eca257138b65c2864482a9edf6e2a8cedb6 (patch) | |
tree | a36e2dce979816c06259a56416e94524d34f5872 /drivers/net/ethernet/mellanox/mlx4/cmd.c | |
parent | e5dfbf9a7904b3e21e665bed923eda49ced732d4 (diff) | |
download | op-kernel-dev-be9b9eca257138b65c2864482a9edf6e2a8cedb6.zip op-kernel-dev-be9b9eca257138b65c2864482a9edf6e2a8cedb6.tar.gz |
net/mlx4_core: Enable single ported IB VFs
Remove the limitation that disallows configuring single ported VFs
in the presence of IB ports, after addressing the issues that
prevented that to work.
SMI (QP0) requests/responses are still not supported for single
ported IB VFs.
Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: Jack Morgenstein <jackm@dev.mellanox.co.il>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/mellanox/mlx4/cmd.c')
-rw-r--r-- | drivers/net/ethernet/mellanox/mlx4/cmd.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx4/cmd.c b/drivers/net/ethernet/mellanox/mlx4/cmd.c index 153fb15..7761045 100644 --- a/drivers/net/ethernet/mellanox/mlx4/cmd.c +++ b/drivers/net/ethernet/mellanox/mlx4/cmd.c @@ -3194,6 +3194,12 @@ int mlx4_vf_set_enable_smi_admin(struct mlx4_dev *dev, int slave, int port, int enabled) { struct mlx4_priv *priv = mlx4_priv(dev); + struct mlx4_active_ports actv_ports = mlx4_get_active_ports( + &priv->dev, slave); + int min_port = find_first_bit(actv_ports.ports, + priv->dev.caps.num_ports) + 1; + int max_port = min_port - 1 + + bitmap_weight(actv_ports.ports, priv->dev.caps.num_ports); if (slave == mlx4_master_func_num(dev)) return 0; @@ -3203,6 +3209,11 @@ int mlx4_vf_set_enable_smi_admin(struct mlx4_dev *dev, int slave, int port, enabled < 0 || enabled > 1) return -EINVAL; + if (min_port == max_port && dev->caps.num_ports > 1) { + mlx4_info(dev, "SMI access disallowed for single ported VFs\n"); + return -EPROTONOSUPPORT; + } + priv->mfunc.master.vf_admin[slave].enable_smi[port] = enabled; return 0; } |