net/mlx5e: Set default RX moderation parameters on driver load
authorSaeed Mahameed <saeedm@mellanox.com>
Thu, 30 Mar 2017 16:23:41 +0000 (19:23 +0300)
committerSaeed Mahameed <saeedm@mellanox.com>
Thu, 6 Apr 2017 22:21:28 +0000 (01:21 +0300)
RX moderation default parameters shouldn't be set in
mlx5e_build_rx_cq_param since it would reset the values every time on
netdev open/close.  Instead, it should be set in
mlx5e_set_rx_cq_mode_params which is called on driver load only.

Fixes: 6a9764efb255 ("net/mlx5e: Isolate open_channels from priv->params")
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
drivers/net/ethernet/mellanox/mlx5/core/en_main.c

index 57844ffca37f5bae4bc7f033b3536bd0b4d1c484..8b7b7e604ea03c190baf1f8adacb3152e1d03c30 100644 (file)
@@ -1944,10 +1944,6 @@ static void mlx5e_build_rx_cq_param(struct mlx5e_priv *priv,
        }
 
        mlx5e_build_common_cq_param(priv, param);
-
-       if (params->rx_am_enabled)
-               params->rx_cq_moderation =
-                       mlx5e_am_get_def_profile(params->rx_cq_period_mode);
 }
 
 static void mlx5e_build_tx_cq_param(struct mlx5e_priv *priv,
@@ -3787,6 +3783,10 @@ void mlx5e_set_rx_cq_mode_params(struct mlx5e_params *params, u8 cq_period_mode)
                params->rx_cq_moderation.usec =
                        MLX5E_PARAMS_DEFAULT_RX_CQ_MODERATION_USEC_FROM_CQE;
 
+       if (params->rx_am_enabled)
+               params->rx_cq_moderation =
+                       mlx5e_am_get_def_profile(params->rx_cq_period_mode);
+
        MLX5E_SET_PFLAG(params, MLX5E_PFLAG_RX_CQE_BASED_MODER,
                        params->rx_cq_period_mode == MLX5_CQ_PERIOD_MODE_START_FROM_CQE);
 }