On Wed, Aug 16, 2023 at 09:52:23AM +0300, Leon Romanovsky wrote: > From: Mark Bloch <mbloch@xxxxxxxxxx> > > If the RDMA device isn't in LAG mode there is no need > to try to get the upper device. > > Signed-off-by: Mark Bloch <mbloch@xxxxxxxxxx> > Signed-off-by: Leon Romanovsky <leonro@xxxxxxxxxx> > --- > drivers/infiniband/hw/mlx5/main.c | 22 +++++++++++++++------- > 1 file changed, 15 insertions(+), 7 deletions(-) > > diff --git a/drivers/infiniband/hw/mlx5/main.c b/drivers/infiniband/hw/mlx5/main.c > index f0b394ed7452..215d7b0add8f 100644 > --- a/drivers/infiniband/hw/mlx5/main.c > +++ b/drivers/infiniband/hw/mlx5/main.c > @@ -195,12 +195,18 @@ static int mlx5_netdev_event(struct notifier_block *this, > case NETDEV_CHANGE: > case NETDEV_UP: > case NETDEV_DOWN: { > - struct net_device *lag_ndev = mlx5_lag_get_roce_netdev(mdev); > struct net_device *upper = NULL; > > - if (lag_ndev) { > - upper = netdev_master_upper_dev_get(lag_ndev); > - dev_put(lag_ndev); > + if (ibdev->lag_active) { Needs locking to read lag_active Jason