diff options
Diffstat (limited to 'drivers/net/ethernet/mellanox/mlx5/core/accel')
-rw-r--r-- | drivers/net/ethernet/mellanox/mlx5/core/accel/ipsec_offload.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/accel/ipsec_offload.c b/drivers/net/ethernet/mellanox/mlx5/core/accel/ipsec_offload.c index 1c8923f42b09..c49699d580ff 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/accel/ipsec_offload.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/accel/ipsec_offload.c @@ -4,9 +4,11 @@ #include "mlx5_core.h" #include "ipsec_offload.h" #include "lib/mlx5.h" +#include "en_accel/ipsec_fs.h" #define MLX5_IPSEC_DEV_BASIC_CAPS (MLX5_ACCEL_IPSEC_CAP_DEVICE | MLX5_ACCEL_IPSEC_CAP_IPV6 | \ MLX5_ACCEL_IPSEC_CAP_LSO) + struct mlx5_ipsec_sa_ctx { struct rhash_head hash; u32 enc_key_id; @@ -30,6 +32,10 @@ static u32 mlx5_ipsec_offload_device_caps(struct mlx5_core_dev *mdev) if (!mlx5_is_ipsec_device(mdev)) return 0; + if (!MLX5_CAP_FLOWTABLE_NIC_TX(mdev, ipsec_encrypt) || + !MLX5_CAP_FLOWTABLE_NIC_RX(mdev, ipsec_decrypt)) + return 0; + if (MLX5_CAP_IPSEC(mdev, ipsec_crypto_esp_aes_gcm_128_encrypt) && MLX5_CAP_IPSEC(mdev, ipsec_crypto_esp_aes_gcm_128_decrypt)) caps |= MLX5_ACCEL_IPSEC_CAP_ESP; |