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

From: Vlad Dogaru
Date: Thu Apr 10 2025 - 05:41:27 EST


On Wed, Apr 09, 2025 at 11:23:04PM +0200, Michal Kubiak wrote:
> On Tue, Apr 08, 2025 at 05:00:49PM +0300, Tariq Toukan wrote:
> > From: Vlad Dogaru <vdogaru@xxxxxxxxxx>
> >
> > 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 <vdogaru@xxxxxxxxxx>
> > Reviewed-by: Yevgeny Kliteynik <kliteyn@xxxxxxxxxx>
> > Reviewed-by: Mark Bloch <mbloch@xxxxxxxxxx>
> > Signed-off-by: Tariq Toukan <tariqt@xxxxxxxxxx>
> > ---
> > .../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?

That's right, nice catch. Will fix up in v2.

Thanks,
Vlad