netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next 0/4] devlink: Add port function attributes to enable/disable IPsec crypto and packet offloads
@ 2023-03-23 11:10 Dima Chumak
  2023-03-23 11:10 ` [PATCH net-next 1/4] devlink: Expose port function commands to control IPsec crypto offloads Dima Chumak
                   ` (8 more replies)
  0 siblings, 9 replies; 17+ messages in thread
From: Dima Chumak @ 2023-03-23 11:10 UTC (permalink / raw)
  To: Jakub Kicinski
  Cc: David S. Miller, Eric Dumazet, Paolo Abeni, Jiri Pirko,
	Leon Romanovsky, Saeed Mahameed, netdev, Dima Chumak

Currently, mlx5 PCI VFs are disabled by default for IPsec functionality.
A user does not have the ability to enable IPsec support for a PCI VF
device.

It is desirable to provide a user with a fine grained control of the PCI
VF device IPsec capabilities. 

The above are a hypervisor level control, to set the functionality of
devices passed through to guests.

This is achieved by extending existing 'port function' object to control
capabilities of a function. It enables users to control capability of
the device before enumeration.

The series introduces two new boolean attributes of port function:
ipsec_crypto and ipsec_packet. They can be controlled independently.
Each to provide a distinct level of IPsec offload support that may
require different system and/or device firmware resources. 

Examples when user prefers to enable IPsec packet offload for a VF when
using switchdev mode:

  $ devlink port show pci/0000:06:00.0/1
      pci/0000:06:00.0/1: type eth netdev enp6s0pf0vf0 flavour pcivf pfnum 0 vfnum 0
          function:
          hw_addr 00:00:00:00:00:00 roce enable migratable disable ipsec_crypto disable ipsec_packet disable

  $ devlink port function set pci/0000:06:00.0/1 ipsec_packet enable

  $ devlink port show pci/0000:06:00.0/1
      pci/0000:06:00.0/1: type eth netdev enp6s0pf0vf0 flavour pcivf pfnum 0 vfnum 0
          function:
          hw_addr 00:00:00:00:00:00 roce enable migratable disable ipsec_crypto disable ipsec_packet enable

This enables corresponding IPsec capability of the function before it's
enumerated, so when driver reads the capability from the device
firmware, it is enabled. The driver then is able to configure
corresponding feature flags of the VF net device to support IPsec state
and policy offloading.

Dima Chumak (4):
  devlink: Expose port function commands to control IPsec crypto
    offloads
  net/mlx5: Implement devlink port function cmds to control ipsec_crypto
  devlink: Expose port function commands to control IPsec packet
    offloads
  net/mlx5: Implement devlink port function cmds to control ipsec_packet

 .../ethernet/mellanox/mlx5/switchdev.rst      |  16 +
 .../networking/devlink/devlink-port.rst       |  54 ++++
 .../net/ethernet/mellanox/mlx5/core/Makefile  |   2 +-
 .../net/ethernet/mellanox/mlx5/core/devlink.c |   4 +
 .../mellanox/mlx5/core/en_accel/ipsec.c       |  18 ++
 .../ethernet/mellanox/mlx5/core/esw/ipsec.c   | 299 ++++++++++++++++++
 .../net/ethernet/mellanox/mlx5/core/eswitch.c |  34 ++
 .../net/ethernet/mellanox/mlx5/core/eswitch.h |  27 ++
 .../mellanox/mlx5/core/eswitch_offloads.c     | 200 ++++++++++++
 .../ethernet/mellanox/mlx5/core/lib/ipsec.h   |  41 +++
 include/linux/mlx5/driver.h                   |   1 +
 include/linux/mlx5/mlx5_ifc.h                 |   3 +
 include/net/devlink.h                         |  42 +++
 include/uapi/linux/devlink.h                  |   4 +
 net/devlink/leftover.c                        | 110 +++++++
 15 files changed, 854 insertions(+), 1 deletion(-)
 create mode 100644 drivers/net/ethernet/mellanox/mlx5/core/esw/ipsec.c
 create mode 100644 drivers/net/ethernet/mellanox/mlx5/core/lib/ipsec.h

-- 
2.40.0


^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2023-03-29 19:11 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-03-23 11:10 [PATCH net-next 0/4] devlink: Add port function attributes to enable/disable IPsec crypto and packet offloads Dima Chumak
2023-03-23 11:10 ` [PATCH net-next 1/4] devlink: Expose port function commands to control IPsec crypto offloads Dima Chumak
2023-03-23 11:10 ` [PATCH net-next 2/4] net/mlx5: Implement devlink port function cmds to control ipsec_crypto Dima Chumak
2023-03-23 21:49   ` kernel test robot
2023-03-29  8:01   ` Leon Romanovsky
2023-03-23 11:10 ` [PATCH net-next 3/4] devlink: Expose port function commands to control IPsec packet offloads Dima Chumak
2023-03-23 11:10 ` [PATCH net-next 4/4] net/mlx5: Implement devlink port function cmds to control ipsec_packet Dima Chumak
2023-03-23 11:13 ` [PATCH iproute2-next 1/3] Update kernel headers Dima Chumak
2023-03-23 11:13 ` [PATCH iproute2-next 2/3] devlink: Support setting port function ipsec_crypto cap Dima Chumak
2023-03-23 11:13 ` [PATCH iproute2-next 3/3] devlink: Support setting port function ipsec_packet cap Dima Chumak
2023-03-23 17:05 ` [PATCH net-next 0/4] devlink: Add port function attributes to enable/disable IPsec crypto and packet offloads Jakub Kicinski
2023-03-29  7:45   ` Leon Romanovsky
2023-03-29 17:09     ` Jakub Kicinski
2023-03-29 19:11       ` Leon Romanovsky
2023-03-23 17:23 ` Jakub Kicinski
2023-03-29  7:42   ` Dima Chumak
2023-03-29 17:05     ` Jakub Kicinski

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).