diff mbox series

[SRU,Bionic,1/1] UBUNTU: SAUCE: net/mlx5e: IPoIB, initialize update_stat_work for ipoib devices

Message ID 20201125180735.511223-2-ian.may@canonical.com
State New
Headers show
Series Initialize update_stat_work for ipoib devices | expand

Commit Message

Ian May Nov. 25, 2020, 6:07 p.m. UTC
From: Amir Tzin <amirtz@nvidia.com>

BugLink: https://launchpad.net/bugs/1904848

mlx5e_detach_netdev cancels update_stats_work which was not initialized
in ipoib netdevice profile, as a result, unloading the ib_ipoib module
causes a call trace in the kernel ring buffer.
current implementation inits update_stats_work in each netdev profile->init
call back and cancels it in  mlx5e_detach_netdev, so lets follow this guideline
and init update_stat_work for ipoib netdev in it's profile->init callback.

Fixes: cd565b4b51e5 ("IB/IPoIB: Support acceleration options callbacks")
Signed-off-by: Amir Tzin <amirtz@nvidia.com>
Reviewed-by: Feras Daoud <ferasda@nvidia.com>
Signed-off-by: Ian May <ian.may@canonical.com>
---
 drivers/net/ethernet/mellanox/mlx5/core/ipoib/ipoib.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Stefan Bader Nov. 26, 2020, 9:14 a.m. UTC | #1
On 25.11.20 19:07, Ian May wrote:
> From: Amir Tzin <amirtz@nvidia.com>
> 
> BugLink: https://launchpad.net/bugs/1904848
> 
> mlx5e_detach_netdev cancels update_stats_work which was not initialized
> in ipoib netdevice profile, as a result, unloading the ib_ipoib module
> causes a call trace in the kernel ring buffer.
> current implementation inits update_stats_work in each netdev profile->init
> call back and cancels it in  mlx5e_detach_netdev, so lets follow this guideline
> and init update_stat_work for ipoib netdev in it's profile->init callback.
> 
> Fixes: cd565b4b51e5 ("IB/IPoIB: Support acceleration options callbacks")
> Signed-off-by: Amir Tzin <amirtz@nvidia.com>
> Reviewed-by: Feras Daoud <ferasda@nvidia.com>
> Signed-off-by: Ian May <ian.may@canonical.com>
Acked-by: Stefan Bader <stefan.bader@canonical.com>
> ---

Assuming we double check that nothing sticks out when looping over module load
and unload. Otherwise it looks like a sensible minimal approach.

-Stefan

>  drivers/net/ethernet/mellanox/mlx5/core/ipoib/ipoib.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/net/ethernet/mellanox/mlx5/core/ipoib/ipoib.c b/drivers/net/ethernet/mellanox/mlx5/core/ipoib/ipoib.c
> index e97e57c64902..f9110c8beddf 100644
> --- a/drivers/net/ethernet/mellanox/mlx5/core/ipoib/ipoib.c
> +++ b/drivers/net/ethernet/mellanox/mlx5/core/ipoib/ipoib.c
> @@ -83,6 +83,7 @@ void mlx5i_init(struct mlx5_core_dev *mdev,
>  	priv->hard_mtu = MLX5_IB_GRH_BYTES + MLX5_IPOIB_HARD_LEN;
>  	mutex_init(&priv->state_lock);
>  
> +	INIT_DELAYED_WORK(&priv->update_stats_work, mlx5e_update_stats_work);
>  	mlx5e_build_nic_params(mdev, &priv->channels.params, profile->max_nch(mdev));
>  	mlx5i_build_nic_params(mdev, &priv->channels.params);
>  
>
Kleber Souza Nov. 26, 2020, 10:22 a.m. UTC | #2
On 25.11.20 19:07, Ian May wrote:
> From: Amir Tzin <amirtz@nvidia.com>
> 
> BugLink: https://launchpad.net/bugs/1904848
> 
> mlx5e_detach_netdev cancels update_stats_work which was not initialized
> in ipoib netdevice profile, as a result, unloading the ib_ipoib module
> causes a call trace in the kernel ring buffer.
> current implementation inits update_stats_work in each netdev profile->init
> call back and cancels it in  mlx5e_detach_netdev, so lets follow this guideline
> and init update_stat_work for ipoib netdev in it's profile->init callback.
> 
> Fixes: cd565b4b51e5 ("IB/IPoIB: Support acceleration options callbacks")
> Signed-off-by: Amir Tzin <amirtz@nvidia.com>
> Reviewed-by: Feras Daoud <ferasda@nvidia.com>
> Signed-off-by: Ian May <ian.may@canonical.com>

Acked-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>

> ---
>   drivers/net/ethernet/mellanox/mlx5/core/ipoib/ipoib.c | 1 +
>   1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/net/ethernet/mellanox/mlx5/core/ipoib/ipoib.c b/drivers/net/ethernet/mellanox/mlx5/core/ipoib/ipoib.c
> index e97e57c64902..f9110c8beddf 100644
> --- a/drivers/net/ethernet/mellanox/mlx5/core/ipoib/ipoib.c
> +++ b/drivers/net/ethernet/mellanox/mlx5/core/ipoib/ipoib.c
> @@ -83,6 +83,7 @@ void mlx5i_init(struct mlx5_core_dev *mdev,
>   	priv->hard_mtu = MLX5_IB_GRH_BYTES + MLX5_IPOIB_HARD_LEN;
>   	mutex_init(&priv->state_lock);
>   
> +	INIT_DELAYED_WORK(&priv->update_stats_work, mlx5e_update_stats_work);
>   	mlx5e_build_nic_params(mdev, &priv->channels.params, profile->max_nch(mdev));
>   	mlx5i_build_nic_params(mdev, &priv->channels.params);
>   
>
diff mbox series

Patch

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/ipoib/ipoib.c b/drivers/net/ethernet/mellanox/mlx5/core/ipoib/ipoib.c
index e97e57c64902..f9110c8beddf 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/ipoib/ipoib.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/ipoib/ipoib.c
@@ -83,6 +83,7 @@  void mlx5i_init(struct mlx5_core_dev *mdev,
 	priv->hard_mtu = MLX5_IB_GRH_BYTES + MLX5_IPOIB_HARD_LEN;
 	mutex_init(&priv->state_lock);
 
+	INIT_DELAYED_WORK(&priv->update_stats_work, mlx5e_update_stats_work);
 	mlx5e_build_nic_params(mdev, &priv->channels.params, profile->max_nch(mdev));
 	mlx5i_build_nic_params(mdev, &priv->channels.params);