Subject: Re: [PATCH net-next 05/12] net/mlx5: HWS, Cleanup after pool refactoring

From: Michal Kubiak <[email-masked]>
Date: Wed, 9 Apr 2025 23:23:04 +0200

On Tue, Apr 08, 2025 at 05:00:49PM +0300, Tariq Toukan wrote:
> From: Vlad Dogaru <[email-masked]>
> 
> Remove members which are now no longer used. In fact, many of the
> `struct mlx5hws_pool_chunk` were not even written to beyond being
> initialized, but they were used in various internals.
> 
> Also cleanup some local variables which made more sense when the API was
> thicker.
> 
> Signed-off-by: Vlad Dogaru <[email-masked]>
> Reviewed-by: Yevgeny Kliteynik <[email-masked]>
> Reviewed-by: Mark Bloch <[email-masked]>
> Signed-off-by: Tariq Toukan <[email-masked]>
> ---
>  .../mellanox/mlx5/core/steering/hws/action.c  |  6 +--
>  .../mellanox/mlx5/core/steering/hws/matcher.c | 48 ++++++-------------
>  .../mellanox/mlx5/core/steering/hws/matcher.h |  2 -
>  3 files changed, 16 insertions(+), 40 deletions(-)
> 
> diff --git a/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/action.c b/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/action.c
> index 39904b337b81..44b4640b47db 100644
> --- a/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/action.c
> +++ b/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/action.c
> @@ -1583,7 +1583,6 @@ hws_action_create_dest_match_range_table(struct mlx5hws_context *ctx,
>  	struct mlx5hws_matcher_action_ste *table_ste;
>  	struct mlx5hws_pool_attr pool_attr = {0};
>  	struct mlx5hws_pool *ste_pool, *stc_pool;
> -	struct mlx5hws_pool_chunk *ste;
>  	u32 *rtc_0_id, *rtc_1_id;
>  	u32 obj_id;
>  	int ret;
> @@ -1613,8 +1612,6 @@ hws_action_create_dest_match_range_table(struct mlx5hws_context *ctx,
>  	rtc_0_id = &table_ste->rtc_0_id;
>  	rtc_1_id = &table_ste->rtc_1_id;
>  	ste_pool = table_ste->pool;
> -	ste = &table_ste->ste;
> -	ste->order = 1;
>  
>  	rtc_attr.log_size = 0;
>  	rtc_attr.log_depth = 0;
> @@ -1630,7 +1627,7 @@ hws_action_create_dest_match_range_table(struct mlx5hws_context *ctx,
>  
>  	rtc_attr.pd = ctx->pd_num;
>  	rtc_attr.ste_base = obj_id;
> -	rtc_attr.ste_offset = ste->offset;
> +	rtc_attr.ste_offset = 0;

Is the `rtc_attr.ste_offset` member still needed? Can it be removed from
the "cmd.h" header? It's always zero right now, isn't it?

>  	rtc_attr.reparse_mode = mlx5hws_context_get_reparse_mode(ctx);
>  	rtc_attr.table_type = mlx5hws_table_get_res_fw_ft_type(MLX5HWS_TABLE_TYPE_FDB, false);
>  

[...]

> @@ -300,21 +289,20 @@ static int hws_matcher_create_rtc(struct mlx5hws_matcher *matcher,
>  
>  	rtc_attr.pd = ctx->pd_num;
>  	rtc_attr.ste_base = obj_id;
> -	rtc_attr.ste_offset = ste->offset;
> +	rtc_attr.ste_offset = 0;

Same question here.

Thanks,
Michal