]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
net/mlx5e: SHAMPO: Remove redundant params
authorSaeed Mahameed <saeedm@nvidia.com>
Mon, 16 Jun 2025 14:14:34 +0000 (17:14 +0300)
committerJakub Kicinski <kuba@kernel.org>
Wed, 18 Jun 2025 01:34:12 +0000 (18:34 -0700)
Two SHAMPO params are static and always the same, remove them from the
global mlx5e_params struct.

Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
Reviewed-by: Dragos Tatulea <dtatulea@nvidia.com>
Signed-off-by: Cosmin Ratiu <cratiu@nvidia.com>
Signed-off-by: Tariq Toukan <tariqt@nvidia.com>
Signed-off-by: Mark Bloch <mbloch@nvidia.com>
Link: https://patch.msgid.link/20250616141441.1243044-6-mbloch@nvidia.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/mellanox/mlx5/core/en.h
drivers/net/ethernet/mellanox/mlx5/core/en/params.c
drivers/net/ethernet/mellanox/mlx5/core/en_main.c

index 211ea429ea89399639ead5c0f5d6baf5345eb268..581eef34f5127341fa20f5652828bae54551369a 100644 (file)
@@ -278,10 +278,6 @@ enum packet_merge {
 struct mlx5e_packet_merge_param {
        enum packet_merge type;
        u32 timeout;
-       struct {
-               u8 match_criteria_type;
-               u8 alignment_granularity;
-       } shampo;
 };
 
 struct mlx5e_params {
index 58ec5e44aa7adadab3b3781ef2d0086707fb52cc..fc945bce933abae1dd8726c57031ae0590f679cd 100644 (file)
@@ -901,6 +901,7 @@ int mlx5e_build_rq_param(struct mlx5_core_dev *mdev,
 {
        void *rqc = param->rqc;
        void *wq = MLX5_ADDR_OF(rqc, rqc, wq);
+       u32 lro_timeout;
        int ndsegs = 1;
        int err;
 
@@ -926,22 +927,25 @@ int mlx5e_build_rq_param(struct mlx5_core_dev *mdev,
                MLX5_SET(wq, wq, log_wqe_stride_size,
                         log_wqe_stride_size - MLX5_MPWQE_LOG_STRIDE_SZ_BASE);
                MLX5_SET(wq, wq, log_wq_sz, mlx5e_mpwqe_get_log_rq_size(mdev, params, xsk));
-               if (params->packet_merge.type == MLX5E_PACKET_MERGE_SHAMPO) {
-                       MLX5_SET(wq, wq, shampo_enable, true);
-                       MLX5_SET(wq, wq, log_reservation_size,
-                                mlx5e_shampo_get_log_rsrv_size(mdev, params));
-                       MLX5_SET(wq, wq,
-                                log_max_num_of_packets_per_reservation,
-                                mlx5e_shampo_get_log_pkt_per_rsrv(mdev, params));
-                       MLX5_SET(wq, wq, log_headers_entry_size,
-                                mlx5e_shampo_get_log_hd_entry_size(mdev, params));
-                       MLX5_SET(rqc, rqc, reservation_timeout,
-                                mlx5e_choose_lro_timeout(mdev, MLX5E_DEFAULT_SHAMPO_TIMEOUT));
-                       MLX5_SET(rqc, rqc, shampo_match_criteria_type,
-                                params->packet_merge.shampo.match_criteria_type);
-                       MLX5_SET(rqc, rqc, shampo_no_match_alignment_granularity,
-                                params->packet_merge.shampo.alignment_granularity);
-               }
+               if (params->packet_merge.type != MLX5E_PACKET_MERGE_SHAMPO)
+                       break;
+
+               MLX5_SET(wq, wq, shampo_enable, true);
+               MLX5_SET(wq, wq, log_reservation_size,
+                        mlx5e_shampo_get_log_rsrv_size(mdev, params));
+               MLX5_SET(wq, wq,
+                        log_max_num_of_packets_per_reservation,
+                        mlx5e_shampo_get_log_pkt_per_rsrv(mdev, params));
+               MLX5_SET(wq, wq, log_headers_entry_size,
+                        mlx5e_shampo_get_log_hd_entry_size(mdev, params));
+               lro_timeout =
+                       mlx5e_choose_lro_timeout(mdev,
+                                                MLX5E_DEFAULT_SHAMPO_TIMEOUT);
+               MLX5_SET(rqc, rqc, reservation_timeout, lro_timeout);
+               MLX5_SET(rqc, rqc, shampo_match_criteria_type,
+                        MLX5_RQC_SHAMPO_MATCH_CRITERIA_TYPE_EXTENDED);
+               MLX5_SET(rqc, rqc, shampo_no_match_alignment_granularity,
+                        MLX5_RQC_SHAMPO_NO_MATCH_ALIGNMENT_GRANULARITY_STRIDE);
                break;
        }
        default: /* MLX5_WQ_TYPE_CYCLIC */
index 3d11c9f87171f7e8bcb1e102b52d6786e4c57c32..e1e44533b7444806f4a86a67adc8d83102402779 100644 (file)
@@ -4040,10 +4040,6 @@ static int set_feature_hw_gro(struct net_device *netdev, bool enable)
 
        if (enable) {
                new_params.packet_merge.type = MLX5E_PACKET_MERGE_SHAMPO;
-               new_params.packet_merge.shampo.match_criteria_type =
-                       MLX5_RQC_SHAMPO_MATCH_CRITERIA_TYPE_EXTENDED;
-               new_params.packet_merge.shampo.alignment_granularity =
-                       MLX5_RQC_SHAMPO_NO_MATCH_ALIGNMENT_GRANULARITY_STRIDE;
        } else if (new_params.packet_merge.type == MLX5E_PACKET_MERGE_SHAMPO) {
                new_params.packet_merge.type = MLX5E_PACKET_MERGE_NONE;
        } else {