[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230323111059.210634-1-dchumak@nvidia.com>
Date: Thu, 23 Mar 2023 13:10:55 +0200
From: Dima Chumak <dchumak@...dia.com>
To: Jakub Kicinski <kuba@...nel.org>
CC: "David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Paolo Abeni <pabeni@...hat.com>, Jiri Pirko <jiri@...nulli.us>,
Leon Romanovsky <leon@...nel.org>,
Saeed Mahameed <saeedm@...dia.com>, <netdev@...r.kernel.org>,
Dima Chumak <dchumak@...dia.com>
Subject: [PATCH net-next 0/4] devlink: Add port function attributes to enable/disable IPsec crypto and packet offloads
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
Powered by blists - more mailing lists