Skip to content

mlx5 IPsec packet offload support in eswitch mode

Leon Romanovsky netdev 1 version Applied

Status from this message: This series was applied to netdev/net-next.git (main)

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest13 patches 0 repliesApplied 13/13

Changes in v1 from the cover letter

* Fixed ipv6 flow steering table destination in IPsec initialization routine.
* Removed Fixes line from "net/mlx5: Compare with..." patch as this fix is required for this series only.
* Added patch to enforce same order for HW and SW IPsec flows when TC is involved, which is "host <-> IPsec <-> TC <-> "wire"/switch".
v0: https://lore.kernel.org/all/[email protected]

Patches in v1 All 13 applied

#Subject and filesSizeRepliesApplied
1/13net/mlx5e: Add function to get IPsec offload namespacedrivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec_fs.c+22 -240 repliesApplied
2/13net/mlx5e: Change the parameter of IPsec RX skb handle functiondrivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec_rxtx.c drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec_rxtx.h drivers/net/ethernet/mellanox/mlx5/core/en_rx.c+5 -50 repliesApplied
3/13net/mlx5e: Prepare IPsec packet offload for switchdev modedrivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec.c drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec.h drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec_fs.c+184 -830 repliesApplied
4/13net/mlx5e: Refactor IPsec RX tables creation and destructiondrivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec.h drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec_fs.c+80 -310 repliesApplied
5/13net/mlx5e: Support IPsec packet offload for RX in switchdev modedrivers/net/ethernet/mellanox/mlx5/core/Makefile drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec.h drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec_fs.c +5 more+313 -470 repliesApplied
6/13net/mlx5e: Handle IPsec offload for RX datapath in switchdev modedrivers/net/ethernet/mellanox/mlx5/core/en/rep/tc.c drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec.h drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec_fs.c +5 more+139 -30 repliesApplied
7/13net/mlx5e: Refactor IPsec TX tables creationdrivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec.h drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec_fs.c+28 -60 repliesApplied
8/13net/mlx5e: Support IPsec packet offload for TX in switchdev modedrivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec_fs.c drivers/net/ethernet/mellanox/mlx5/core/esw/ipsec_fs.c drivers/net/ethernet/mellanox/mlx5/core/esw/ipsec_fs.h +4 more+101 -90 repliesApplied
9/13net/mlx5: Compare with old_dest param to modify rule destinationdrivers/net/ethernet/mellanox/mlx5/core/fs_core.c+1 -10 repliesApplied
10/13net/mlx5e: Make IPsec offload work together with eswitch and TCdrivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec_fs.c drivers/net/ethernet/mellanox/mlx5/core/eswitch.h drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c+128 -150 repliesApplied
11/13net/mlx5e: Modify and restore TC rules for IPSec TX rulesdrivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec_fs.c drivers/net/ethernet/mellanox/mlx5/core/esw/ipsec_fs.c drivers/net/ethernet/mellanox/mlx5/core/esw/ipsec_fs.h +2 more+154 -40 repliesApplied
12/13net/mlx5e: Add get IPsec offload stats for uplink representordrivers/net/ethernet/mellanox/mlx5/core/en_rep.c+1 -00 repliesApplied
13/13net/mlx5e: Make TC and IPsec offloads mutually exclusive on a netdevdrivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec_fs.c drivers/net/ethernet/mellanox/mlx5/core/en_tc.c include/linux/mlx5/driver.h+129 -40 repliesApplied

Reviews trailers per patch

2 of 13 patches have a Reviewed-by or Acked-by.

PatchLeon RomanovskyMark Bloch
1/13
2/13
3/13
4/13
5/13
6/13
7/13R-b
8/13
9/13R-b
10/13
11/13
12/13
13/13

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH net-next v1 00/13] mlx5 IPsec packet offload support in eswitch mode

From: Leon Romanovsky <[email protected]>

Changelog:
v1:
* Fixed ipv6 flow steering table destination in IPsec initialization routine.
* Removed Fixes line from "net/mlx5: Compare with..." patch as this fix is required for this series only.
* Added patch to enforce same order for HW and SW IPsec flows when TC is involved, which is "host <-> IPsec <-> TC <-> "wire"/switch".
v0: https://lore.kernel.org/all/[email protected]

-------------------------------------------------------------------------
Hi,

This series from Jianbo adds mlx5 IPsec packet offload support in eswitch offloaded mode.

It works exactly like "regular" IPsec, nothing special, except now users can switch to switchdev before adding IPsec rules.

devlink dev eswitch set pci/0000:06:00.0 mode switchdev

Same configurations as here:
https://lore.kernel.org/netdev/[email protected]/
Packet offload mode:
ip xfrm state offload packet dev <if-name> dir <in|out> ip xfrm policy .... offload packet dev <if-name>
Crypto offload mode:
ip xfrm state offload crypto dev <if-name> dir <in|out>
or (backward compatibility)
ip xfrm state offload dev <if-name> dir <in|out>

Thanks

Jianbo Liu (13):
net/mlx5e: Add function to get IPsec offload namespace net/mlx5e: Change the parameter of IPsec RX skb handle function net/mlx5e: Prepare IPsec packet offload for switchdev mode net/mlx5e: Refactor IPsec RX tables creation and destruction net/mlx5e: Support IPsec packet offload for RX in switchdev mode net/mlx5e: Handle IPsec offload for RX datapath in switchdev mode net/mlx5e: Refactor IPsec TX tables creation
net/mlx5e: Support IPsec packet offload for TX in switchdev mode net/mlx5: Compare with old_dest param to modify rule destination net/mlx5e: Make IPsec offload work together with eswitch and TC net/mlx5e: Modify and restore TC rules for IPSec TX rules net/mlx5e: Add get IPsec offload stats for uplink representor net/mlx5e: Make TC and IPsec offloads mutually exclusive on a netdev

 .../net/ethernet/mellanox/mlx5/core/Makefile  |   4 +
 .../ethernet/mellanox/mlx5/core/en/rep/tc.c   |  17 +-
 .../mellanox/mlx5/core/en_accel/ipsec.c       |   2 +
 .../mellanox/mlx5/core/en_accel/ipsec.h       |  65 +-
 .../mellanox/mlx5/core/en_accel/ipsec_fs.c    | 708 +++++++++++++-----
 .../mlx5/core/en_accel/ipsec_offload.c        |   5 +-
 .../mellanox/mlx5/core/en_accel/ipsec_rxtx.c  |  25 +-
 .../mellanox/mlx5/core/en_accel/ipsec_rxtx.h  |   6 +-
 .../net/ethernet/mellanox/mlx5/core/en_rep.c  |   1 +
 .../net/ethernet/mellanox/mlx5/core/en_rx.c   |   3 +-
 .../net/ethernet/mellanox/mlx5/core/en_tc.c   |  47 ++
 .../mellanox/mlx5/core/esw/ipsec_fs.c         | 325 ++++++++
 .../mellanox/mlx5/core/esw/ipsec_fs.h         |  67 ++
 .../net/ethernet/mellanox/mlx5/core/eswitch.h |  17 +
 .../mellanox/mlx5/core/eswitch_offloads.c     | 174 ++++-
 .../net/ethernet/mellanox/mlx5/core/fs_core.c |  14 +-
 include/linux/mlx5/driver.h                   |   2 +
 include/linux/mlx5/eswitch.h                  |   3 +
 include/linux/mlx5/fs.h                       |   2 +
 19 files changed, 1270 insertions(+), 217 deletions(-)
 create mode 100644 drivers/net/ethernet/mellanox/mlx5/core/esw/ipsec_fs.c
 create mode 100644 drivers/net/ethernet/mellanox/mlx5/core/esw/ipsec_fs.h
Signature · 1 line
2.41.0