net/mlx5e: Add mqprio_rl cleanup and free in mlx5e_priv_cleanup()
authorJianbo Liu <jianbol@nvidia.com>
Thu, 27 Jun 2024 18:02:38 +0000 (21:02 +0300)
committerDavid S. Miller <davem@davemloft.net>
Fri, 28 Jun 2024 11:58:11 +0000 (12:58 +0100)
In the cited commit, mqprio_rl cleanup and free are mistakenly removed
in mlx5e_priv_cleanup(), and it causes the leakage of host memory and
firmware SCHEDULING_ELEMENT objects while changing eswitch mode. So,
add them back.

Fixes: 0bb7228f7096 ("net/mlx5e: Fix mqprio_rl handling on devlink reload")
Signed-off-by: Jianbo Liu <jianbol@nvidia.com>
Reviewed-by: Dragos Tatulea <dtatulea@nvidia.com>
Signed-off-by: Tariq Toukan <tariqt@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mellanox/mlx5/core/en_main.c

index a605eae56685df2ffb1344c8b0292fec224bd0f0..eedbcba22689486cf2f2922ef86370a25b3d3313 100644 (file)
@@ -5868,6 +5868,11 @@ void mlx5e_priv_cleanup(struct mlx5e_priv *priv)
                kfree(priv->htb_qos_sq_stats[i]);
        kvfree(priv->htb_qos_sq_stats);
 
+       if (priv->mqprio_rl) {
+               mlx5e_mqprio_rl_cleanup(priv->mqprio_rl);
+               mlx5e_mqprio_rl_free(priv->mqprio_rl);
+       }
+
        memset(priv, 0, sizeof(*priv));
 }