Enable support for arm64 architecture in ipsec_mb. x86 specific code is conditionally compiled only for x86 architecture builds. Other architectures will be unsupported.
Signed-off-by: Ashwin Sekhar T K <asek...@marvell.com> --- drivers/crypto/ipsec_mb/ipsec_mb_private.c | 7 +++++++ drivers/crypto/ipsec_mb/ipsec_mb_private.h | 3 ++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/drivers/crypto/ipsec_mb/ipsec_mb_private.c b/drivers/crypto/ipsec_mb/ipsec_mb_private.c index aab42c360c..b555a28a0b 100644 --- a/drivers/crypto/ipsec_mb/ipsec_mb_private.c +++ b/drivers/crypto/ipsec_mb/ipsec_mb_private.c @@ -53,6 +53,9 @@ ipsec_mb_create(struct rte_vdev_device *vdev, const char *name, *args; int retval; +#if defined(RTE_ARCH_ARM64) + vector_mode = IPSEC_MB_ARM64; +#elif defined(RTE_ARCH_X86_64) if (vector_mode == IPSEC_MB_NOT_SUPPORTED) { /* Check CPU for supported vector instruction set */ if (rte_cpu_get_flag_enabled(RTE_CPUFLAG_AVX512F)) @@ -64,6 +67,10 @@ ipsec_mb_create(struct rte_vdev_device *vdev, else vector_mode = IPSEC_MB_SSE; } +#else + /* Unsupported architecture */ + return -ENOTSUP; +#endif init_params.private_data_size = sizeof(struct ipsec_mb_dev_private) + pmd_data->internals_priv_size; diff --git a/drivers/crypto/ipsec_mb/ipsec_mb_private.h b/drivers/crypto/ipsec_mb/ipsec_mb_private.h index e2c240dfc0..d0a1bcc360 100644 --- a/drivers/crypto/ipsec_mb/ipsec_mb_private.h +++ b/drivers/crypto/ipsec_mb/ipsec_mb_private.h @@ -26,7 +26,8 @@ enum ipsec_mb_vector_mode { IPSEC_MB_SSE, IPSEC_MB_AVX, IPSEC_MB_AVX2, - IPSEC_MB_AVX512 + IPSEC_MB_AVX512, + IPSEC_MB_ARM64, }; extern enum ipsec_mb_vector_mode vector_mode; -- 2.25.1