diff options
author | Noa Osherovich <noaos@mellanox.com> | 2016-09-12 18:16:23 +0200 |
---|---|---|
committer | Doug Ledford <dledford@redhat.com> | 2016-09-16 20:14:08 +0200 |
commit | 7fae6655a0c897875bd34501ec092232b526d3e4 (patch) | |
tree | fef1bb265517c0a5297f4d8cd6524ff9734ecc74 /drivers/infiniband/hw/mlx5/main.c | |
parent | IB/mlx4: Diagnostic HW counters are not supported in slave mode (diff) | |
download | linux-7fae6655a0c897875bd34501ec092232b526d3e4.tar.xz linux-7fae6655a0c897875bd34501ec092232b526d3e4.zip |
IB/mlx5: Enable MAD_IFC commands for IB ports only
MAD_IFC command is supported only for physical functions (PF)
and when physical port is IB. The proposed fix enforces it.
Fixes: d603c809ef91 ("IB/mlx5: Fix decision on using MAD_IFC")
Reported-by: David Chang <dchang@suse.com>
Signed-off-by: Noa Osherovich <noaos@mellanox.com>
Signed-off-by: Leon Romanovsky <leon@kernel.org>
Signed-off-by: Doug Ledford <dledford@redhat.com>
Diffstat (limited to '')
-rw-r--r-- | drivers/infiniband/hw/mlx5/main.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/infiniband/hw/mlx5/main.c b/drivers/infiniband/hw/mlx5/main.c index 8150ea372c53..0480b643fb9c 100644 --- a/drivers/infiniband/hw/mlx5/main.c +++ b/drivers/infiniband/hw/mlx5/main.c @@ -288,7 +288,9 @@ __be16 mlx5_get_roce_udp_sport(struct mlx5_ib_dev *dev, u8 port_num, static int mlx5_use_mad_ifc(struct mlx5_ib_dev *dev) { - return !MLX5_CAP_GEN(dev->mdev, ib_virt); + if (MLX5_CAP_GEN(dev->mdev, port_type) == MLX5_CAP_PORT_TYPE_IB) + return !MLX5_CAP_GEN(dev->mdev, ib_virt); + return 0; } enum { |