RDMA/mlx5: Handle link status event only for LAG device
authorYuyu Li <liyuyu6@huawei.com>
Fri, 22 Nov 2024 10:53:07 +0000 (18:53 +0800)
committerLeon Romanovsky <leon@kernel.org>
Thu, 26 Dec 2024 04:39:11 +0000 (23:39 -0500)
The link status events of non-LAG devices are now handled in ib_core,
so only LAG device events need to be handled in driver.

Signed-off-by: Yuyu Li <liyuyu6@huawei.com>
Signed-off-by: Junxian Huang <huangjunxian6@hisilicon.com>
Signed-off-by: Leon Romanovsky <leon@kernel.org>
drivers/infiniband/hw/mlx5/main.c

index bc7930d0c5647dfec94292e9e7723e75ed5f0911..e4010f871865bdaf41aa3ae3d4e77d3fc4f6aec7 100644 (file)
@@ -242,6 +242,9 @@ static int mlx5_netdev_event(struct notifier_block *this,
        case NETDEV_DOWN: {
                struct net_device *upper = NULL;
 
+               if (!netif_is_lag_master(ndev) && !netif_is_lag_port(ndev))
+                       return NOTIFY_DONE;
+
                if (mlx5_lag_is_roce(mdev) || mlx5_lag_is_sriov(mdev)) {
                        struct net_device *lag_ndev;