Subject: Re: [PATCH net-next v1 09/17] net/mlx5: Simplify HW context interfaces by using SA entry

From: Leon Romanovsky <[email-masked]>
Date: Sun, 1 May 2022 11:56:35 +0300

On Fri, Apr 22, 2022 at 03:19:35PM -0700, Saeed Mahameed wrote:
> On 19 Apr 13:13, Leon Romanovsky wrote:
> > From: Leon Romanovsky <[email-masked]>
> > 
> > SA context logic used multiple structures to store same data
> > over and over. By simplifying the SA context interfaces, we
> > can remove extra structs.
> > 
> > Reviewed-by: Raed Salem <[email-masked]>
> > Signed-off-by: Leon Romanovsky <[email-masked]>
> > ---
> > .../mellanox/mlx5/core/en_accel/ipsec.c       |  50 ++---
> > .../mellanox/mlx5/core/en_accel/ipsec.h       |  27 ++-
> > .../mlx5/core/en_accel/ipsec_offload.c        | 182 ++++--------------
> > 3 files changed, 62 insertions(+), 197 deletions(-)

<...>

> > -static int mlx5_create_ipsec_obj(struct mlx5_core_dev *mdev,
> > -				 struct mlx5_ipsec_obj_attrs *attrs,
> > -				 u32 *ipsec_id)
> 
> I don't see the point of this change, the function used to receive two
> primitives, now it receives a god object, just to grab the two primitives,
> this breaks the bottom up design, and contaminates the code with the
> sa_entry container, that only should be visible by high-level ipsec module and
> the SA DB, all service and low level functions should remain as
> primitive and simple as possible to avoid future abuse and reduce the scope
> and visibility of god objects. The effect of this change is more severe in
> the next patch.
> 
> Even within the same file, i still recommend a monotonic bottom up
> design and keep the complex objects usage to as few hight level functions
> as possible.

Like you said: same file, same data copied in and out - it is not bottom
up design for me.

Thanks