diff mbox series

[v2] crypto/ipsec_mb: enable support for arm64

Message ID 20220630154123.2565439-1-asekhar@marvell.com (mailing list archive)
State New
Delegated to: akhil goyal
Headers show
Series [v2] crypto/ipsec_mb: enable support for arm64 | expand

Checks

Context Check Description
ci/iol-abi-testing success Testing PASS
ci/iol-x86_64-unit-testing success Testing PASS
ci/iol-aarch64-compile-testing success Testing PASS
ci/iol-aarch64-unit-testing success Testing PASS
ci/iol-x86_64-compile-testing success Testing PASS
ci/github-robot: build success github build: passed
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/intel-Testing success Testing PASS
ci/Intel-compilation success Compilation OK
ci/checkpatch success coding style OK

Commit Message

Ashwin Sekhar T K June 30, 2022, 3:41 p.m. UTC
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 <asekhar@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(-)

Comments

Zhang, Roy Fan July 4, 2022, 2:47 p.m. UTC | #1
> -----Original Message-----
> From: Ashwin Sekhar T K <asekhar@marvell.com>
> Sent: Thursday, June 30, 2022 4:41 PM
> To: dev@dpdk.org; Zhang, Roy Fan <roy.fan.zhang@intel.com>; De Lara Guarch,
> Pablo <pablo.de.lara.guarch@intel.com>
> Cc: jerinj@marvell.com; skori@marvell.com; skoteshwar@marvell.com;
> pbhagavatula@marvell.com; kirankumark@marvell.com;
> psatheesh@marvell.com; asekhar@marvell.com; anoobj@marvell.com;
> gakhil@marvell.com; hkalra@marvell.com; ndabilpuram@marvell.com
> Subject: [PATCH v2] crypto/ipsec_mb: enable support for arm64
> 
> 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 <asekhar@marvell.com>
> ---
Acked-by: Fan Zhang <roy.fan.zhang@intel.com>
Ruifeng Wang July 27, 2022, 8:29 a.m. UTC | #2
> -----Original Message-----
> From: Ashwin Sekhar T K <asekhar@marvell.com>
> Sent: Thursday, June 30, 2022 11:41 PM
> To: dev@dpdk.org; Fan Zhang <roy.fan.zhang@intel.com>; Pablo de Lara
> <pablo.de.lara.guarch@intel.com>
> Cc: jerinj@marvell.com; skori@marvell.com; skoteshwar@marvell.com;
> pbhagavatula@marvell.com; kirankumark@marvell.com;
> psatheesh@marvell.com; asekhar@marvell.com; anoobj@marvell.com;
> gakhil@marvell.com; hkalra@marvell.com; ndabilpuram@marvell.com
> Subject: [PATCH v2] crypto/ipsec_mb: enable support for arm64

Code change looks good to me.
Arm64 support is not fully enabled with this patch alone.
There is a patch to fix the remaining:
http://patches.dpdk.org/project/dpdk/patch/20220727081352.1333695-3-ruifeng.wang@arm.com/
Appreciate it if you can review that one.

Thanks.
> 
> 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 <asekhar@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(-)
> 

<snip>
Ashwin Sekhar T K July 27, 2022, 8:48 a.m. UTC | #3
Hi Ruifeng,

Thanks for this. Initially, I had made a local hack to my IPSEC MB build script which was creating intel-ipsec-mb.h as a softlink to ipsec-mb.h .

Later I forgot to remove this hack. So I didn't catch this. 

Regards,
Ashwin Sekhar T K 

> -----Original Message-----
> From: Ruifeng Wang <Ruifeng.Wang@arm.com>
> Sent: Wednesday, July 27, 2022 1:59 PM
> To: Ashwin Sekhar Thalakalath Kottilveetil <asekhar@marvell.com>;
> dev@dpdk.org; Fan Zhang <roy.fan.zhang@intel.com>; Pablo de Lara
> <pablo.de.lara.guarch@intel.com>
> Cc: Jerin Jacob Kollanukkaran <jerinj@marvell.com>; Sunil Kumar Kori
> <skori@marvell.com>; Satha Koteswara Rao Kottidi
> <skoteshwar@marvell.com>; Pavan Nikhilesh Bhagavatula
> <pbhagavatula@marvell.com>; Kiran Kumar Kokkilagadda
> <kirankumark@marvell.com>; Satheesh Paul Antonysamy
> <psatheesh@marvell.com>; Anoob Joseph <anoobj@marvell.com>; Akhil
> Goyal <gakhil@marvell.com>; Harman Kalra <hkalra@marvell.com>; Nithin
> Kumar Dabilpuram <ndabilpuram@marvell.com>; nd <nd@arm.com>
> Subject: [EXT] RE: [PATCH v2] crypto/ipsec_mb: enable support for arm64
> 
> External Email
> 
> ----------------------------------------------------------------------
> > -----Original Message-----
> > From: Ashwin Sekhar T K <asekhar@marvell.com>
> > Sent: Thursday, June 30, 2022 11:41 PM
> > To: dev@dpdk.org; Fan Zhang <roy.fan.zhang@intel.com>; Pablo de Lara
> > <pablo.de.lara.guarch@intel.com>
> > Cc: jerinj@marvell.com; skori@marvell.com; skoteshwar@marvell.com;
> > pbhagavatula@marvell.com; kirankumark@marvell.com;
> > psatheesh@marvell.com; asekhar@marvell.com; anoobj@marvell.com;
> > gakhil@marvell.com; hkalra@marvell.com; ndabilpuram@marvell.com
> > Subject: [PATCH v2] crypto/ipsec_mb: enable support for arm64
> 
> Code change looks good to me.
> Arm64 support is not fully enabled with this patch alone.
> There is a patch to fix the remaining:
> https://urldefense.proofpoint.com/v2/url?u=http-
> 3A__patches.dpdk.org_project_dpdk_patch_20220727081352.1333695-2D3-
> 2Druifeng.wang-
> 40arm.com_&d=DwIFAg&c=nKjWec2b6R0mOyPaz7xtfQ&r=pYk-QOhvnkU-
> _75y0NKSn535ZotEGI_E69Py3Ppondk&m=nIGG87_fioLU92q775kMzq4KXXGT
> 5MnFSBch7NESxGBy-cjDWvDRIxpVc-
> 1bktjm&s=cMiUUrOKfZfSMCLVfjm77R8K0aIB6lhpWhmNh_o0SGM&e=
> Appreciate it if you can review that one.
> 
> Thanks.
> >
> > 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 <asekhar@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(-)
> >
> 
> <snip>
diff mbox series

Patch

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;