diff options
author | Aviad Yehezkel <aviadye@mellanox.com> | 2018-01-16 16:12:22 +0200 |
---|---|---|
committer | Saeed Mahameed <saeedm@mellanox.com> | 2018-03-07 15:53:18 -0800 |
commit | 65802f480008066636a43173b12388bb3fb7bd3a (patch) | |
tree | 9191cd0530bc0d8d848719ce1bcc25007a37e1b4 /drivers/net/ethernet/mellanox/mlx5/core/accel/ipsec.c | |
parent | 788a8210764ce2977095010931959c87b60c2f51 (diff) | |
download | linux-rt-65802f480008066636a43173b12388bb3fb7bd3a.tar.gz |
net/mlx5: IPSec, Add command V2 support
This patch adds V2 command support.
New fpga devices support extended features (udp encap, esn etc...), this
features require new hardware sadb format therefore we have a new version
of commands to manipulate it.
Signed-off-by: Yossef Efraim <yossefe@mellanox.com>
Signed-off-by: Aviad Yehezkel <aviadye@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
Diffstat (limited to 'drivers/net/ethernet/mellanox/mlx5/core/accel/ipsec.c')
-rw-r--r-- | drivers/net/ethernet/mellanox/mlx5/core/accel/ipsec.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/accel/ipsec.c b/drivers/net/ethernet/mellanox/mlx5/core/accel/ipsec.c index 53e69edaedde..b88ae12d9066 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/accel/ipsec.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/accel/ipsec.c @@ -40,10 +40,17 @@ void *mlx5_accel_ipsec_sa_cmd_exec(struct mlx5_core_dev *mdev, struct mlx5_accel_ipsec_sa *cmd) { + int cmd_size; + if (!MLX5_IPSEC_DEV(mdev)) return ERR_PTR(-EOPNOTSUPP); - return mlx5_fpga_ipsec_sa_cmd_exec(mdev, cmd); + if (mlx5_accel_ipsec_device_caps(mdev) & MLX5_ACCEL_IPSEC_V2_CMD) + cmd_size = sizeof(*cmd); + else + cmd_size = sizeof(cmd->ipsec_sa_v1); + + return mlx5_fpga_ipsec_sa_cmd_exec(mdev, cmd, cmd_size); } int mlx5_accel_ipsec_sa_cmd_wait(void *ctx) |