Commit 84a6a7a9 authored by Parav Pandit's avatar Parav Pandit Committed by Doug Ledford

IB/mlx5: Fix represent correct netdevice in dual port RoCE

In commit bcf87f1d ("IB/mlx5: Listen to netdev register/unresiter events in switchdev mode")
incorrectly mapped primary device's netdevice to 2nd port netdevice.
It always represented primary port's netdevice for 2nd port netdevice
when ib representors were not used.

This results into failing to process CM request arriving on 2nd port due
to incorrect mapping of netdevice.

This fix corrects it by considering the right mdev.

Cc: <stable@vger.kernel.org> # 4.16
Fixes: bcf87f1d ("IB/mlx5: Listen to netdev register/unresiter events in switchdev mode")
Reviewed-by: default avatarMark Bloch <markb@mellanox.com>
Signed-off-by: default avatarParav Pandit <parav@mellanox.com>
Signed-off-by: default avatarLeon Romanovsky <leonro@mellanox.com>
Signed-off-by: default avatarDoug Ledford <dledford@redhat.com>
parent 4f32ac2e
...@@ -179,7 +179,7 @@ static int mlx5_netdev_event(struct notifier_block *this, ...@@ -179,7 +179,7 @@ static int mlx5_netdev_event(struct notifier_block *this,
if (rep_ndev == ndev) if (rep_ndev == ndev)
roce->netdev = (event == NETDEV_UNREGISTER) ? roce->netdev = (event == NETDEV_UNREGISTER) ?
NULL : ndev; NULL : ndev;
} else if (ndev->dev.parent == &ibdev->mdev->pdev->dev) { } else if (ndev->dev.parent == &mdev->pdev->dev) {
roce->netdev = (event == NETDEV_UNREGISTER) ? roce->netdev = (event == NETDEV_UNREGISTER) ?
NULL : ndev; NULL : ndev;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment