net/mlx5e: Move params kernel log print to probe function
authorTariq Toukan <tariqt@nvidia.com>
Wed, 18 May 2022 08:46:35 +0000 (11:46 +0300)
committerSaeed Mahameed <saeedm@nvidia.com>
Sat, 12 Nov 2022 10:20:19 +0000 (02:20 -0800)
Params info print was meant to be printed on load.
With time, new calls to mlx5e_init_rq_type_params and
mlx5e_build_rq_params were added, mistakenly printing
the params once again.

Move the print to were it belongs, in mlx5e_probe.

Signed-off-by: Tariq Toukan <tariqt@nvidia.com>
Reviewed-by: Gal Pressman <gal@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
drivers/net/ethernet/mellanox/mlx5/core/en/params.c
drivers/net/ethernet/mellanox/mlx5/core/en/params.h
drivers/net/ethernet/mellanox/mlx5/core/en_main.c

index 1a2de9b..9ec9662 100644 (file)
@@ -607,16 +607,6 @@ void mlx5e_init_rq_type_params(struct mlx5_core_dev *mdev,
        params->log_rq_mtu_frames = is_kdump_kernel() ?
                MLX5E_PARAMS_MINIMUM_LOG_RQ_SIZE :
                MLX5E_PARAMS_DEFAULT_LOG_RQ_SIZE;
-
-       mlx5_core_info(mdev, "MLX5E: StrdRq(%d) RqSz(%ld) StrdSz(%ld) RxCqeCmprss(%d %s)\n",
-                      params->rq_wq_type == MLX5_WQ_TYPE_LINKED_LIST_STRIDING_RQ,
-                      params->rq_wq_type == MLX5_WQ_TYPE_LINKED_LIST_STRIDING_RQ ?
-                      BIT(mlx5e_mpwqe_get_log_rq_size(mdev, params, NULL)) :
-                      BIT(params->log_rq_mtu_frames),
-                      BIT(mlx5e_mpwqe_get_log_stride_size(mdev, params, NULL)),
-                      MLX5E_GET_PFLAG(params, MLX5E_PFLAG_RX_CQE_COMPRESS),
-                      MLX5_CAP_GEN(mdev, enhanced_cqe_compression) ?
-                                      "enhanced" : "basic");
 }
 
 void mlx5e_set_rq_type(struct mlx5_core_dev *mdev, struct mlx5e_params *params)
index 034debd..c9be6eb 100644 (file)
@@ -154,4 +154,18 @@ int mlx5e_build_channel_param(struct mlx5_core_dev *mdev,
 u16 mlx5e_calc_sq_stop_room(struct mlx5_core_dev *mdev, struct mlx5e_params *params);
 int mlx5e_validate_params(struct mlx5_core_dev *mdev, struct mlx5e_params *params);
 
+static inline void mlx5e_params_print_info(struct mlx5_core_dev *mdev,
+                                          struct mlx5e_params *params)
+{
+       mlx5_core_info(mdev, "MLX5E: StrdRq(%d) RqSz(%ld) StrdSz(%ld) RxCqeCmprss(%d %s)\n",
+                      params->rq_wq_type == MLX5_WQ_TYPE_LINKED_LIST_STRIDING_RQ,
+                      params->rq_wq_type == MLX5_WQ_TYPE_LINKED_LIST_STRIDING_RQ ?
+                      BIT(mlx5e_mpwqe_get_log_rq_size(mdev, params, NULL)) :
+                      BIT(params->log_rq_mtu_frames),
+                      BIT(mlx5e_mpwqe_get_log_stride_size(mdev, params, NULL)),
+                      MLX5E_GET_PFLAG(params, MLX5E_PFLAG_RX_CQE_COMPRESS),
+                      MLX5_CAP_GEN(mdev, enhanced_cqe_compression) ?
+                                      "enhanced" : "basic");
+};
+
 #endif /* __MLX5_EN_PARAMS_H__ */
index c462b76..5df04e0 100644 (file)
@@ -5955,6 +5955,7 @@ static int mlx5e_probe(struct auxiliary_device *adev,
 
        mlx5e_dcbnl_init_app(priv);
        mlx5_uplink_netdev_set(mdev, netdev);
+       mlx5e_params_print_info(mdev, &priv->channels.params);
        return 0;
 
 err_resume: