lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Thu, 2 Feb 2023 13:11:57 +0200
From:   Leon Romanovsky <leon@...nel.org>
To:     Paul Blakey <paulb@...dia.com>
Cc:     netdev@...r.kernel.org, Saeed Mahameed <saeedm@...dia.com>,
        Paolo Abeni <pabeni@...hat.com>,
        Jakub Kicinski <kuba@...nel.org>,
        Eric Dumazet <edumazet@...gle.com>,
        Jamal Hadi Salim <jhs@...atatu.com>,
        Cong Wang <xiyou.wangcong@...il.com>,
        "David S. Miller" <davem@...emloft.net>,
        Oz Shlomo <ozsh@...dia.com>, Jiri Pirko <jiri@...dia.com>,
        Roi Dayan <roid@...dia.com>, Vlad Buslov <vladbu@...dia.com>
Subject: Re: [PATCH net-next v7 6/6] net/mlx5e: TC, Set CT miss to the
 specific ct action instance

On Tue, Jan 31, 2023 at 11:10:27AM +0200, Paul Blakey wrote:
> Currently, CT misses restore the missed chain on the tc skb extension so
> tc will continue from the relevant chain. Instead, restore the CT action's
> miss cookie on the extension, which will instruct tc to continue from the
> this specific CT action instance on the relevant filter's action list.
> 
> Map the CT action's miss_cookie to a new miss object (ACT_MISS), and use
> this miss mapping instead of the current chain miss object (CHAIN_MISS)
> for CT action misses.
> 
> To restore this new miss mapping value, add a RX restore rule for each
> such mapping value.
> 
> Signed-off-by: Paul Blakey <paulb@...dia.com>
> Reviewed-by: Roi Dayan <roid@...dia.com>
> Reviewed-by: Oz Sholmo <ozsh@...dia.com>
> ---
>  .../ethernet/mellanox/mlx5/core/en/tc_ct.c    | 32 +++++-----
>  .../ethernet/mellanox/mlx5/core/en/tc_ct.h    |  2 +
>  .../net/ethernet/mellanox/mlx5/core/en_tc.c   | 61 ++++++++++++++++---
>  .../net/ethernet/mellanox/mlx5/core/en_tc.h   |  6 ++
>  .../net/ethernet/mellanox/mlx5/core/eswitch.h |  2 +
>  5 files changed, 79 insertions(+), 24 deletions(-)

<...>

> -static bool mlx5e_tc_restore_skb_chain(struct sk_buff *skb, struct mlx5_tc_ct_priv *ct_priv,
> -				       u32 chain, u32 zone_restore_id,
> -				       u32 tunnel_id,  struct mlx5e_tc_update_priv *tc_priv)
> +static bool mlx5e_tc_restore_skb_tc_meta(struct sk_buff *skb, struct mlx5_tc_ct_priv *ct_priv,
> +					 struct mlx5_mapped_obj *mapped_obj, u32 zone_restore_id,
> +					 u32 tunnel_id,  struct mlx5e_tc_update_priv *tc_priv)
>  {
> +	u32 chain = mapped_obj->type == MLX5_MAPPED_OBJ_CHAIN ? mapped_obj->chain : 0;
> +	u64 act_miss_cookie = mapped_obj->type == MLX5_MAPPED_OBJ_ACT_MISS ?
> +			      mapped_obj->act_miss_cookie : 0;

It will be easier for reader if such assignment is separated from
variables declarations.

>  	struct mlx5e_priv *priv = netdev_priv(skb->dev);
>  	struct tc_skb_ext *tc_skb_ext;

<...>

> +void mlx5e_tc_action_miss_mapping_put(struct mlx5e_priv *priv, struct mlx5_flow_attr *attr,
> +				      u32 act_miss_mapping)
> +{
> +	struct mlx5_eswitch *esw = priv->mdev->priv.eswitch;
> +	struct mapping_ctx *ctx = esw->offloads.reg_c0_obj_pool;

Reversed Christmas tree, please.

Thanks

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ