4.7-stable review patch. If anyone has any objections, please let me know.
------------------ From: Noa Osherovich <no...@mellanox.com> commit 7fae6655a0c897875bd34501ec092232b526d3e4 upstream. 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 <dch...@suse.com> Signed-off-by: Noa Osherovich <no...@mellanox.com> Signed-off-by: Leon Romanovsky <l...@kernel.org> Signed-off-by: Doug Ledford <dledf...@redhat.com> Signed-off-by: Greg Kroah-Hartman <gre...@linuxfoundation.org> --- drivers/infiniband/hw/mlx5/main.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) --- a/drivers/infiniband/hw/mlx5/main.c +++ b/drivers/infiniband/hw/mlx5/main.c @@ -287,7 +287,9 @@ __be16 mlx5_get_roce_udp_sport(struct ml 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 {