netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Leon Romanovsky <leon@kernel.org>
To: Feng Wang <wangfe@google.com>
Cc: Steffen Klassert <steffen.klassert@secunet.com>,
	netdev@vger.kernel.org, antony.antony@secunet.com
Subject: Re: [PATCH] xfrm: add SA information to the offloaded packet
Date: Thu, 5 Sep 2024 10:49:28 +0300	[thread overview]
Message-ID: <20240905074928.GR4026@unreal> (raw)
In-Reply-To: <CADsK2K-vMvX0UzWboPMstCoZuzGsFf2Y3mYpm4nNU4GAXDum3Q@mail.gmail.com>

On Wed, Sep 04, 2024 at 10:41:38AM -0700, Feng Wang wrote:
> Hi Leon,
> 
> I'm looking at the MLX5 driver to understand how the SA information is
> used. In mlx5e_ipsec_handle_tx_skb(), it appears we might leverage the
> current MLX5 implementation to verify the xfrm id.
> https://elixir.bootlin.com/linux/v6.10/source/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec_rxtx.c#L271
> 
> During the mlx5e_xfrm_add_state() function, the xfrm ID (x->if_id) is
> passed to the driver along with the associated xfrm_state pointer.
> Therefore, by checking the if_id within the skb tx function like
> mlx5e_ipsec_handle_tx_skb(), we should be able to demonstrate the use
> case effectively.
> 
> What’s your opinion?

Packet offloaded packets don't pass mlx5e_ipsec_handle_tx_skb() because SKB is
treated as plain text and not encrypted.

In order to support this feature in mlx5, you will need to do two things:
1. Create rule which matches x->if_id in mlx5 flow steering, while
creating SAs (see tx_add_rule()->setup_fte_reg_a()).

This register is used in the transmit steering tables, and is loaded with
the value of flow_table_metadata field in the Ethernet Segment of the WQE.

2. Set x->if_id from SKB in flow_table_metadata to allow HW to catch
these packets. It means change mlx5e datapath to set this value from
SKB.

The first item is easy, just move setup_fte_reg_a() to the right place,
but the second one is more complex as whole packet offload assumption
that we are working with plain text packets.

I'm not even talking about eswitch mode, which will bring more
complexity.

Thanks

> 
> Thanks for your help.
> 
> Feng

  reply	other threads:[~2024-09-05  7:49 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-22 20:02 [PATCH] xfrm: add SA information to the offloaded packet Feng Wang
2024-08-28  5:32 ` Steffen Klassert
2024-08-28 11:26   ` Leon Romanovsky
2024-08-28 21:25     ` Feng Wang
2024-08-29 10:38       ` Leon Romanovsky
2024-08-29 21:19         ` Feng Wang
2024-08-30 14:30           ` Leon Romanovsky
2024-08-31  0:27             ` Feng Wang
2024-08-31 17:36               ` Leon Romanovsky
2024-08-31 17:39   ` Leon Romanovsky
2024-09-02  7:44     ` Steffen Klassert
2024-09-02  9:44       ` Leon Romanovsky
2024-09-03 18:19         ` Feng Wang
2024-09-03 19:04           ` Leon Romanovsky
2024-09-04 17:41             ` Feng Wang
2024-09-05  7:49               ` Leon Romanovsky [this message]
2024-09-05 18:18                 ` Feng Wang
2024-09-09  9:09         ` Steffen Klassert
2024-09-09 10:02           ` Steffen Klassert
2024-09-11 10:40           ` Leon Romanovsky
2024-09-11 23:43             ` Feng Wang
2024-09-16  8:10               ` Leon Romanovsky
2024-09-24 10:07               ` Steffen Klassert
2024-09-24 10:34             ` Steffen Klassert
2024-09-24 17:57               ` Feng Wang
2024-09-24 18:10                 ` Steffen Klassert
2024-09-25  8:19                   ` Leon Romanovsky
2024-09-25  8:29               ` Leon Romanovsky
2024-09-02  7:47 ` Steffen Klassert
  -- strict thread matches above, loose matches on Subject: below --
2024-11-12 19:22 Feng Wang
2024-11-14 10:27 ` Leon Romanovsky
2024-11-18 19:28   ` Feng Wang
2024-11-19 12:51     ` Leon Romanovsky
2024-11-19 19:15   ` Feng Wang
2024-08-12 18:23 Feng Wang
2024-08-19  6:06 ` Steffen Klassert
2024-08-22 20:11   ` Feng Wang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240905074928.GR4026@unreal \
    --to=leon@kernel.org \
    --cc=antony.antony@secunet.com \
    --cc=netdev@vger.kernel.org \
    --cc=steffen.klassert@secunet.com \
    --cc=wangfe@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).