]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commitdiff
net/mlx5e: Always initialize update stats delayed work
authorFeras Daoud <ferasda@mellanox.com>
Tue, 9 Oct 2018 10:06:02 +0000 (13:06 +0300)
committerSaeed Mahameed <saeedm@mellanox.com>
Thu, 11 Oct 2018 00:58:14 +0000 (17:58 -0700)
mlx5e_detach_netdev cancels update_stats work which was not initialized
in ipoib netdevice profile, as a result, the following assert occurs:

ODEBUG: assert_init not available (active state 0) object type:
timer_list hint:(null)

This change moves the update stats work to be initialized for all
mlx5e netdevices.

Fixes: cd565b4b51e5 ("IB/IPoIB: Support acceleration options callbacks")
Signed-off-by: Feras Daoud <ferasda@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
drivers/net/ethernet/mellanox/mlx5/core/en.h
drivers/net/ethernet/mellanox/mlx5/core/en_main.c
drivers/net/ethernet/mellanox/mlx5/core/en_rep.c

index 4b2737c613fe9b9e336f61499a4040d3da1ae93c..59d07a6fe7c511da6f23f9b5d2734dfb05b096ae 100644 (file)
@@ -926,7 +926,6 @@ int mlx5e_create_tises(struct mlx5e_priv *priv);
 void mlx5e_cleanup_nic_tx(struct mlx5e_priv *priv);
 int mlx5e_close(struct net_device *netdev);
 int mlx5e_open(struct net_device *netdev);
-void mlx5e_update_stats_work(struct work_struct *work);
 
 int mlx5e_bits_invert(unsigned long a, int size);
 
index 376197c97e3b9e0b447b97d9fc6de2eace061f78..9cf5863b79498afe12f13496fc5745c2fae24f79 100644 (file)
@@ -272,7 +272,7 @@ static void mlx5e_update_ndo_stats(struct mlx5e_priv *priv)
                        mlx5e_stats_grps[i].update_stats(priv);
 }
 
-void mlx5e_update_stats_work(struct work_struct *work)
+static void mlx5e_update_stats_work(struct work_struct *work)
 {
        struct delayed_work *dwork = to_delayed_work(work);
        struct mlx5e_priv *priv = container_of(dwork, struct mlx5e_priv,
@@ -4582,7 +4582,6 @@ static void mlx5e_build_nic_netdev_priv(struct mlx5_core_dev *mdev,
        INIT_WORK(&priv->update_carrier_work, mlx5e_update_carrier_work);
        INIT_WORK(&priv->set_rx_mode_work, mlx5e_set_rx_mode_work);
        INIT_WORK(&priv->tx_timeout_work, mlx5e_tx_timeout_work);
-       INIT_DELAYED_WORK(&priv->update_stats_work, mlx5e_update_stats_work);
 
        mlx5e_timestamp_init(priv);
 }
@@ -4955,6 +4954,8 @@ int mlx5e_netdev_init(struct net_device *netdev, struct mlx5e_priv *priv)
 {
        netif_carrier_off(netdev);
 
+       INIT_DELAYED_WORK(&priv->update_stats_work, mlx5e_update_stats_work);
+
        priv->wq = create_singlethread_workqueue("mlx5e");
        if (!priv->wq)
                return -ENOMEM;
index 6176e53c8b83d94456ed3d17ef8ef5d0e40a4d18..bd8caac2e572a950f7e30b3c22e407c828ad8bfb 100644 (file)
@@ -1095,8 +1095,6 @@ static int mlx5e_init_rep(struct mlx5_core_dev *mdev,
        if (err)
                return err;
 
-       INIT_DELAYED_WORK(&priv->update_stats_work, mlx5e_update_stats_work);
-
        mutex_init(&priv->state_lock);
 
        priv->channels.params.num_channels = profile->max_nch(mdev);