OSDN Git Service

mlx5: Use dev_net netdevice notifier registrations
[tomoyo/tomoyo-test1.git] / drivers / net / ethernet / mellanox / mlx5 / core / lag.c
index fc0d958..b91eabc 100644 (file)
@@ -586,7 +586,8 @@ void mlx5_lag_add(struct mlx5_core_dev *dev, struct net_device *netdev)
 
        if (!ldev->nb.notifier_call) {
                ldev->nb.notifier_call = mlx5_lag_netdev_event;
-               if (register_netdevice_notifier(&ldev->nb)) {
+               if (register_netdevice_notifier_dev_net(netdev, &ldev->nb,
+                                                       &ldev->nn)) {
                        ldev->nb.notifier_call = NULL;
                        mlx5_core_err(dev, "Failed to register LAG netdev notifier\n");
                }
@@ -599,7 +600,7 @@ void mlx5_lag_add(struct mlx5_core_dev *dev, struct net_device *netdev)
 }
 
 /* Must be called with intf_mutex held */
-void mlx5_lag_remove(struct mlx5_core_dev *dev)
+void mlx5_lag_remove(struct mlx5_core_dev *dev, struct net_device *netdev)
 {
        struct mlx5_lag *ldev;
        int i;
@@ -619,7 +620,8 @@ void mlx5_lag_remove(struct mlx5_core_dev *dev)
 
        if (i == MLX5_MAX_PORTS) {
                if (ldev->nb.notifier_call)
-                       unregister_netdevice_notifier(&ldev->nb);
+                       unregister_netdevice_notifier_dev_net(netdev, &ldev->nb,
+                                                             &ldev->nn);
                mlx5_lag_mp_cleanup(ldev);
                cancel_delayed_work_sync(&ldev->bond_work);
                mlx5_lag_dev_free(ldev);