* [dpdk-dev] [RFC PATCH 0/3] armv8 crypto PMD update
@ 2019-12-10 8:28 Ruifeng Wang
2019-12-10 8:28 ` [dpdk-dev] [RFC PATCH 1/3] crypto/armv8: link PMD to crypto library hosted by Arm Ruifeng Wang
` (5 more replies)
0 siblings, 6 replies; 20+ messages in thread
From: Ruifeng Wang @ 2019-12-10 8:28 UTC (permalink / raw)
To: gavin.hu; +Cc: dev, jerinj, honnappa.nagarahalli, nd, Ruifeng Wang
Maintainance of armv8_crypto library created by Marvell/Cavium will
be discontinued. Going forward, Armv8 crypto PMD will link to AArch64
crypto library hosted by Arm.
Patch 1/3, 2/3 update source code and document respectively to reflect
the change.
Patch 3/3 fixed Clang build issue when Armv8 crypto PMD is enabled.
Ruifeng Wang (3):
crypto/armv8: link PMD to crypto library hosted by Arm
doc: update link to the crypto library for armv8 PMD
crypto/armv8: fix clang build
doc/guides/cryptodevs/armv8.rst | 7 ++-
drivers/crypto/armv8/Makefile | 3 +-
drivers/crypto/armv8/armv8_pmd_private.h | 4 +-
drivers/crypto/armv8/rte_armv8_pmd.c | 55 ++++++++++++++++--------
drivers/crypto/armv8/rte_armv8_pmd_ops.c | 2 -
mk/rte.app.mk | 2 +-
6 files changed, 44 insertions(+), 29 deletions(-)
--
2.17.1
^ permalink raw reply [flat|nested] 20+ messages in thread
* [dpdk-dev] [RFC PATCH 1/3] crypto/armv8: link PMD to crypto library hosted by Arm
2019-12-10 8:28 [dpdk-dev] [RFC PATCH 0/3] armv8 crypto PMD update Ruifeng Wang
@ 2019-12-10 8:28 ` Ruifeng Wang
2019-12-10 8:28 ` [dpdk-dev] [RFC PATCH 2/3] doc: update link to the crypto library for armv8 PMD Ruifeng Wang
` (4 subsequent siblings)
5 siblings, 0 replies; 20+ messages in thread
From: Ruifeng Wang @ 2019-12-10 8:28 UTC (permalink / raw)
To: gavin.hu; +Cc: dev, jerinj, honnappa.nagarahalli, nd, Ruifeng Wang
Armv8 crypto PMD linked to armv8_crypto library created by Marvell.
Maintenance of armv8_crypto library will be discontinued.
Change Armv8 PMD to link to AArch64 crypto library hosted by Arm.
Signed-off-by: Ruifeng Wang <ruifeng.wang@arm.com>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Reviewed-by: Gavin Hu <gavin.hu@arm.com>
Reviewed-by: Ola Liljedahl <ola.liljedahl@arm.com>
---
drivers/crypto/armv8/Makefile | 3 +-
drivers/crypto/armv8/armv8_pmd_private.h | 4 ++-
drivers/crypto/armv8/rte_armv8_pmd.c | 40 ++++++++++++++----------
drivers/crypto/armv8/rte_armv8_pmd_ops.c | 2 --
mk/rte.app.mk | 2 +-
5 files changed, 29 insertions(+), 22 deletions(-)
diff --git a/drivers/crypto/armv8/Makefile b/drivers/crypto/armv8/Makefile
index 125283664..7f20a28d4 100644
--- a/drivers/crypto/armv8/Makefile
+++ b/drivers/crypto/armv8/Makefile
@@ -24,9 +24,8 @@ EXPORT_MAP := rte_pmd_armv8_version.map
# external library dependencies
CFLAGS += -I$(ARMV8_CRYPTO_LIB_PATH)
-CFLAGS += -I$(ARMV8_CRYPTO_LIB_PATH)/asm/include
CFLAGS += -DALLOW_EXPERIMENTAL_API
-LDLIBS += -L$(ARMV8_CRYPTO_LIB_PATH) -larmv8_crypto
+LDLIBS += -L$(ARMV8_CRYPTO_LIB_PATH) -lAArch64crypto
LDLIBS += -lrte_eal -lrte_mbuf -lrte_mempool -lrte_ring
LDLIBS += -lrte_cryptodev
LDLIBS += -lrte_bus_vdev
diff --git a/drivers/crypto/armv8/armv8_pmd_private.h b/drivers/crypto/armv8/armv8_pmd_private.h
index 24040dda2..9caf9e13f 100644
--- a/drivers/crypto/armv8/armv8_pmd_private.h
+++ b/drivers/crypto/armv8/armv8_pmd_private.h
@@ -5,6 +5,8 @@
#ifndef _ARMV8_PMD_PRIVATE_H_
#define _ARMV8_PMD_PRIVATE_H_
+#include "AArch64cryptolib.h"
+
#define CRYPTODEV_NAME_ARMV8_PMD crypto_armv8
/**< ARMv8 Crypto PMD device name */
@@ -98,7 +100,7 @@ enum armv8_crypto_auth_mode {
typedef int (*crypto_func_t)(uint8_t *, uint8_t *, uint64_t,
uint8_t *, uint8_t *, uint64_t,
- crypto_arg_t *);
+ AArch64crypto_cipher_digest_t *);
typedef void (*crypto_key_sched_t)(uint8_t *, const uint8_t *);
diff --git a/drivers/crypto/armv8/rte_armv8_pmd.c b/drivers/crypto/armv8/rte_armv8_pmd.c
index 7dc83e69e..2b2c5a3bf 100644
--- a/drivers/crypto/armv8/rte_armv8_pmd.c
+++ b/drivers/crypto/armv8/rte_armv8_pmd.c
@@ -12,7 +12,7 @@
#include <rte_malloc.h>
#include <rte_cpuflags.h>
-#include "armv8_crypto_defs.h"
+#include "AArch64cryptolib.h"
#include "armv8_pmd_private.h"
@@ -78,8 +78,10 @@ crypto_func_tbl_t[CRYPTO_CIPHER_MAX][CRYPTO_AUTH_MAX][CRYPTO_CIPHER_KEYLEN_MAX];
static const crypto_func_tbl_t
crypto_op_ca_encrypt = {
/* [cipher alg][auth alg][key length] = crypto_function, */
- [CIPH_AES_CBC][AUTH_SHA1_HMAC][KEYL(128)] = aes128cbc_sha1_hmac,
- [CIPH_AES_CBC][AUTH_SHA256_HMAC][KEYL(128)] = aes128cbc_sha256_hmac,
+ [CIPH_AES_CBC][AUTH_SHA1_HMAC][KEYL(128)] =
+ AArch64crypto_encrypt_aes128cbc_sha1,
+ [CIPH_AES_CBC][AUTH_SHA256_HMAC][KEYL(128)] =
+ AArch64crypto_encrypt_aes128cbc_sha256,
};
static const crypto_func_tbl_t
@@ -95,8 +97,10 @@ crypto_op_ac_encrypt = {
static const crypto_func_tbl_t
crypto_op_ac_decrypt = {
/* [cipher alg][auth alg][key length] = crypto_function, */
- [CIPH_AES_CBC][AUTH_SHA1_HMAC][KEYL(128)] = sha1_hmac_aes128cbc_dec,
- [CIPH_AES_CBC][AUTH_SHA256_HMAC][KEYL(128)] = sha256_hmac_aes128cbc_dec,
+ [CIPH_AES_CBC][AUTH_SHA1_HMAC][KEYL(128)] =
+ AArch64crypto_decrypt_aes128cbc_sha1,
+ [CIPH_AES_CBC][AUTH_SHA256_HMAC][KEYL(128)] =
+ AArch64crypto_decrypt_aes128cbc_sha256,
};
/**
@@ -155,13 +159,13 @@ crypto_key_sched_tbl_t[CRYPTO_CIPHER_MAX][CRYPTO_CIPHER_KEYLEN_MAX];
static const crypto_key_sched_tbl_t
crypto_key_sched_encrypt = {
/* [cipher alg][key length] = key_expand_func, */
- [CIPH_AES_CBC][KEYL(128)] = aes128_key_sched_enc,
+ [CIPH_AES_CBC][KEYL(128)] = AArch64crypto_aes_cbc_expandkeys_128_enc,
};
static const crypto_key_sched_tbl_t
crypto_key_sched_decrypt = {
/* [cipher alg][key length] = key_expand_func, */
- [CIPH_AES_CBC][KEYL(128)] = aes128_key_sched_dec,
+ [CIPH_AES_CBC][KEYL(128)] = AArch64crypto_aes_cbc_expandkeys_128_dec,
};
/**
@@ -277,14 +281,16 @@ auth_set_prerequisites(struct armv8_crypto_session *sess,
* Calculate partial hash values for i_key_pad and o_key_pad.
* Will be used as initialization state for final HMAC.
*/
- error = sha1_block_partial(NULL, sess->auth.hmac.i_key_pad,
- partial, SHA1_BLOCK_SIZE);
+ error = AArch64crypto_sha1_block_partial(NULL,
+ sess->auth.hmac.i_key_pad,
+ partial, SHA1_BLOCK_SIZE);
if (error != 0)
return -1;
memcpy(sess->auth.hmac.i_key_pad, partial, SHA1_BLOCK_SIZE);
- error = sha1_block_partial(NULL, sess->auth.hmac.o_key_pad,
- partial, SHA1_BLOCK_SIZE);
+ error = AArch64crypto_sha1_block_partial(NULL,
+ sess->auth.hmac.o_key_pad,
+ partial, SHA1_BLOCK_SIZE);
if (error != 0)
return -1;
memcpy(sess->auth.hmac.o_key_pad, partial, SHA1_BLOCK_SIZE);
@@ -310,14 +316,16 @@ auth_set_prerequisites(struct armv8_crypto_session *sess,
* Calculate partial hash values for i_key_pad and o_key_pad.
* Will be used as initialization state for final HMAC.
*/
- error = sha256_block_partial(NULL, sess->auth.hmac.i_key_pad,
- partial, SHA256_BLOCK_SIZE);
+ error = AArch64crypto_sha256_block_partial(NULL,
+ sess->auth.hmac.i_key_pad,
+ partial, SHA256_BLOCK_SIZE);
if (error != 0)
return -1;
memcpy(sess->auth.hmac.i_key_pad, partial, SHA256_BLOCK_SIZE);
- error = sha256_block_partial(NULL, sess->auth.hmac.o_key_pad,
- partial, SHA256_BLOCK_SIZE);
+ error = AArch64crypto_sha256_block_partial(NULL,
+ sess->auth.hmac.o_key_pad,
+ partial, SHA256_BLOCK_SIZE);
if (error != 0)
return -1;
memcpy(sess->auth.hmac.o_key_pad, partial, SHA256_BLOCK_SIZE);
@@ -552,7 +560,7 @@ process_armv8_chained_op(struct armv8_crypto_qp *qp, struct rte_crypto_op *op,
struct rte_mbuf *mbuf_src, struct rte_mbuf *mbuf_dst)
{
crypto_func_t crypto_func;
- crypto_arg_t arg;
+ AArch64crypto_cipher_digest_t arg;
struct rte_mbuf *m_asrc, *m_adst;
uint8_t *csrc, *cdst;
uint8_t *adst, *asrc;
diff --git a/drivers/crypto/armv8/rte_armv8_pmd_ops.c b/drivers/crypto/armv8/rte_armv8_pmd_ops.c
index 57952bef5..4fd384d1a 100644
--- a/drivers/crypto/armv8/rte_armv8_pmd_ops.c
+++ b/drivers/crypto/armv8/rte_armv8_pmd_ops.c
@@ -8,8 +8,6 @@
#include <rte_malloc.h>
#include <rte_cryptodev_pmd.h>
-#include "armv8_crypto_defs.h"
-
#include "armv8_pmd_private.h"
static const struct rte_cryptodev_capabilities
diff --git a/mk/rte.app.mk b/mk/rte.app.mk
index 05ea034b9..ab47e4cee 100644
--- a/mk/rte.app.mk
+++ b/mk/rte.app.mk
@@ -274,7 +274,7 @@ _LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_KASUMI) += -L$(LIBSSO_KASUMI_PATH)/build -l
_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_ZUC) += -lrte_pmd_zuc
_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_ZUC) += -L$(LIBSSO_ZUC_PATH)/build -lsso_zuc
_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_ARMV8_CRYPTO) += -lrte_pmd_armv8
-_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_ARMV8_CRYPTO) += -L$(ARMV8_CRYPTO_LIB_PATH) -larmv8_crypto
+_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_ARMV8_CRYPTO) += -L$(ARMV8_CRYPTO_LIB_PATH) -lAArch64crypto
_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_MVSAM_CRYPTO) += -L$(LIBMUSDK_PATH)/lib -lrte_pmd_mvsam_crypto -lmusdk
_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_NITROX) += -lrte_pmd_nitrox
_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_OCTEONTX_CRYPTO) += -lrte_pmd_octeontx_crypto
--
2.17.1
^ permalink raw reply [flat|nested] 20+ messages in thread
* [dpdk-dev] [RFC PATCH 2/3] doc: update link to the crypto library for armv8 PMD
2019-12-10 8:28 [dpdk-dev] [RFC PATCH 0/3] armv8 crypto PMD update Ruifeng Wang
2019-12-10 8:28 ` [dpdk-dev] [RFC PATCH 1/3] crypto/armv8: link PMD to crypto library hosted by Arm Ruifeng Wang
@ 2019-12-10 8:28 ` Ruifeng Wang
2019-12-10 10:07 ` Jerin Jacob
2019-12-10 8:28 ` [dpdk-dev] [RFC PATCH 3/3] crypto/armv8: fix clang build Ruifeng Wang
` (3 subsequent siblings)
5 siblings, 1 reply; 20+ messages in thread
From: Ruifeng Wang @ 2019-12-10 8:28 UTC (permalink / raw)
To: gavin.hu; +Cc: dev, jerinj, honnappa.nagarahalli, nd, Ruifeng Wang
Armv8 crypto PMD now uses crypto library hosted by Arm.
Update doc with the crypto library link to reflect the change.
Signed-off-by: Ruifeng Wang <ruifeng.wang@arm.com>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
---
doc/guides/cryptodevs/armv8.rst | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/doc/guides/cryptodevs/armv8.rst b/doc/guides/cryptodevs/armv8.rst
index 1ab40096e..fee85354b 100644
--- a/doc/guides/cryptodevs/armv8.rst
+++ b/doc/guides/cryptodevs/armv8.rst
@@ -28,12 +28,11 @@ Installation
In order to enable this virtual crypto PMD, user must:
-* Download ARMv8 crypto library source code from
- `here <https://github.com/caviumnetworks/armv8_crypto>`_
+* Download AArch64 crypto library source code from
+ `here <https://github.com/ARM-software/AArch64cryptolib>`_
* Export the environmental variable ARMV8_CRYPTO_LIB_PATH with
- the path where the ``armv8_crypto`` library was downloaded
- or cloned.
+ the path to ``AArch64cryptolib`` library.
* Build the library by invoking:
--
2.17.1
^ permalink raw reply [flat|nested] 20+ messages in thread
* [dpdk-dev] [RFC PATCH 3/3] crypto/armv8: fix clang build
2019-12-10 8:28 [dpdk-dev] [RFC PATCH 0/3] armv8 crypto PMD update Ruifeng Wang
2019-12-10 8:28 ` [dpdk-dev] [RFC PATCH 1/3] crypto/armv8: link PMD to crypto library hosted by Arm Ruifeng Wang
2019-12-10 8:28 ` [dpdk-dev] [RFC PATCH 2/3] doc: update link to the crypto library for armv8 PMD Ruifeng Wang
@ 2019-12-10 8:28 ` Ruifeng Wang
2020-01-17 12:11 ` [dpdk-dev] [RFC PATCH 0/3] armv8 crypto PMD update Akhil Goyal
` (2 subsequent siblings)
5 siblings, 0 replies; 20+ messages in thread
From: Ruifeng Wang @ 2019-12-10 8:28 UTC (permalink / raw)
To: gavin.hu; +Cc: dev, jerinj, honnappa.nagarahalli, nd, Ruifeng Wang, stable
1. Clang requires braces around initialization of subobject.
2. Clang complains implicit conversion of enumeration type.
Trapped issue with Clang version 8.0 and CONFIG_RTE_LIBRTE_PMD_ARMV8_CRYPTO
was set.
Error messages:
rte_armv8_pmd.c:144:2: error: suggest braces around initialization of
subobject [-Werror,-Wmissing-braces]
NULL
^~~~
{ }
/usr/lib/llvm-8/lib/clang/8.0.0/include/stddef.h:105:16: note: expanded
from macro 'NULL'
^~~~~~~~~~
rte_armv8_pmd.c:429:21: error: implicit conversion from enumeration
type 'enum rte_crypto_cipher_operation' to different enumeration type
'enum armv8_crypto_cipher_operation' [-Werror,-Wenum-conversion]
cop = sess->cipher.direction;
~ ~~~~~~~~~~~~~^~~~~~~~~
Fixes: 169ca3db550c ("crypto/armv8: add PMD optimized for ARMv8 processors")
Cc: stable@dpdk.org
Signed-off-by: Ruifeng Wang <ruifeng.wang@arm.com>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Reviewed-by: Gavin Hu <gavin.hu@arm.com>
---
drivers/crypto/armv8/rte_armv8_pmd.c | 15 ++++++++++++---
1 file changed, 12 insertions(+), 3 deletions(-)
diff --git a/drivers/crypto/armv8/rte_armv8_pmd.c b/drivers/crypto/armv8/rte_armv8_pmd.c
index 2b2c5a3bf..f6997e2e9 100644
--- a/drivers/crypto/armv8/rte_armv8_pmd.c
+++ b/drivers/crypto/armv8/rte_armv8_pmd.c
@@ -86,12 +86,12 @@ crypto_op_ca_encrypt = {
static const crypto_func_tbl_t
crypto_op_ca_decrypt = {
- NULL
+ {{NULL}}
};
static const crypto_func_tbl_t
crypto_op_ac_encrypt = {
- NULL
+ {{NULL}}
};
static const crypto_func_tbl_t
@@ -377,7 +377,16 @@ armv8_crypto_set_session_chained_parameters(struct armv8_crypto_session *sess,
/* Select cipher key */
sess->cipher.key.length = cipher_xform->cipher.key.length;
/* Set cipher direction */
- cop = sess->cipher.direction;
+ switch (sess->cipher.direction) {
+ case RTE_CRYPTO_CIPHER_OP_ENCRYPT:
+ cop = ARMV8_CRYPTO_CIPHER_OP_ENCRYPT;
+ break;
+ case RTE_CRYPTO_CIPHER_OP_DECRYPT:
+ cop = ARMV8_CRYPTO_CIPHER_OP_DECRYPT;
+ break;
+ default:
+ return -ENOTSUP;
+ }
/* Set cipher algorithm */
calg = cipher_xform->cipher.algo;
--
2.17.1
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [dpdk-dev] [RFC PATCH 2/3] doc: update link to the crypto library for armv8 PMD
2019-12-10 8:28 ` [dpdk-dev] [RFC PATCH 2/3] doc: update link to the crypto library for armv8 PMD Ruifeng Wang
@ 2019-12-10 10:07 ` Jerin Jacob
0 siblings, 0 replies; 20+ messages in thread
From: Jerin Jacob @ 2019-12-10 10:07 UTC (permalink / raw)
To: Ruifeng Wang; +Cc: Gavin Hu, dpdk-dev, Jerin Jacob, Honnappa Nagarahalli, nd
On Tue, Dec 10, 2019 at 1:59 PM Ruifeng Wang <ruifeng.wang@arm.com> wrote:
>
> Armv8 crypto PMD now uses crypto library hosted by Arm.
> Update doc with the crypto library link to reflect the change.
>
> Signed-off-by: Ruifeng Wang <ruifeng.wang@arm.com>
> Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
> ---
> doc/guides/cryptodevs/armv8.rst | 7 +++----
> 1 file changed, 3 insertions(+), 4 deletions(-)
>
> diff --git a/doc/guides/cryptodevs/armv8.rst b/doc/guides/cryptodevs/armv8.rst
> index 1ab40096e..fee85354b 100644
> --- a/doc/guides/cryptodevs/armv8.rst
> +++ b/doc/guides/cryptodevs/armv8.rst
> @@ -28,12 +28,11 @@ Installation
>
> In order to enable this virtual crypto PMD, user must:
>
> -* Download ARMv8 crypto library source code from
> - `here <https://github.com/caviumnetworks/armv8_crypto>`_
> +* Download AArch64 crypto library source code from
> + `here <https://github.com/ARM-software/AArch64cryptolib>`_
>
> * Export the environmental variable ARMV8_CRYPTO_LIB_PATH with
> - the path where the ``armv8_crypto`` library was downloaded
> - or cloned.
> + the path to ``AArch64cryptolib`` library.
>
> * Build the library by invoking:
>
> --
> 2.17.1
>
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [dpdk-dev] [RFC PATCH 0/3] armv8 crypto PMD update
2019-12-10 8:28 [dpdk-dev] [RFC PATCH 0/3] armv8 crypto PMD update Ruifeng Wang
` (2 preceding siblings ...)
2019-12-10 8:28 ` [dpdk-dev] [RFC PATCH 3/3] crypto/armv8: fix clang build Ruifeng Wang
@ 2020-01-17 12:11 ` Akhil Goyal
2020-01-17 14:28 ` Ruifeng Wang
2020-01-19 7:40 ` [dpdk-dev] [PATCH v2 " Ruifeng Wang
2020-01-23 3:45 ` [dpdk-dev] [PATCH v3 0/5] " Ruifeng Wang
5 siblings, 1 reply; 20+ messages in thread
From: Akhil Goyal @ 2020-01-17 12:11 UTC (permalink / raw)
To: Ruifeng Wang, gavin.hu; +Cc: dev, jerinj, honnappa.nagarahalli, nd
Hi Ruifeng,
> Maintainance of armv8_crypto library created by Marvell/Cavium will
> be discontinued. Going forward, Armv8 crypto PMD will link to AArch64
> crypto library hosted by Arm.
>
> Patch 1/3, 2/3 update source code and document respectively to reflect
> the change.
> Patch 3/3 fixed Clang build issue when Armv8 crypto PMD is enabled.
>
>
> Ruifeng Wang (3):
> crypto/armv8: link PMD to crypto library hosted by Arm
> doc: update link to the crypto library for armv8 PMD
> crypto/armv8: fix clang build
>
> doc/guides/cryptodevs/armv8.rst | 7 ++-
> drivers/crypto/armv8/Makefile | 3 +-
> drivers/crypto/armv8/armv8_pmd_private.h | 4 +-
> drivers/crypto/armv8/rte_armv8_pmd.c | 55 ++++++++++++++++--------
> drivers/crypto/armv8/rte_armv8_pmd_ops.c | 2 -
> mk/rte.app.mk | 2 +-
> 6 files changed, 44 insertions(+), 29 deletions(-)
>
This patchset was sent as RFC. Do you intend to send a formal patchset or this was the final patch and RFC was mentioned by mistake?
Regards,
Akhil
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [dpdk-dev] [RFC PATCH 0/3] armv8 crypto PMD update
2020-01-17 12:11 ` [dpdk-dev] [RFC PATCH 0/3] armv8 crypto PMD update Akhil Goyal
@ 2020-01-17 14:28 ` Ruifeng Wang
0 siblings, 0 replies; 20+ messages in thread
From: Ruifeng Wang @ 2020-01-17 14:28 UTC (permalink / raw)
To: Akhil.goyal@nxp.com, Gavin Hu; +Cc: dev, jerinj, Honnappa Nagarahalli, nd, nd
> -----Original Message-----
> From: Akhil Goyal <akhil.goyal@nxp.com>
> Sent: Friday, January 17, 2020 20:12
> To: Ruifeng Wang <Ruifeng.Wang@arm.com>; Gavin Hu
> <Gavin.Hu@arm.com>
> Cc: dev@dpdk.org; jerinj@marvell.com; Honnappa Nagarahalli
> <Honnappa.Nagarahalli@arm.com>; nd <nd@arm.com>
> Subject: RE: [dpdk-dev] [RFC PATCH 0/3] armv8 crypto PMD update
>
> Hi Ruifeng,
>
> > Maintainance of armv8_crypto library created by Marvell/Cavium will be
> > discontinued. Going forward, Armv8 crypto PMD will link to AArch64
> > crypto library hosted by Arm.
> >
> > Patch 1/3, 2/3 update source code and document respectively to reflect
> > the change.
> > Patch 3/3 fixed Clang build issue when Armv8 crypto PMD is enabled.
> >
> >
> > Ruifeng Wang (3):
> > crypto/armv8: link PMD to crypto library hosted by Arm
> > doc: update link to the crypto library for armv8 PMD
> > crypto/armv8: fix clang build
> >
> > doc/guides/cryptodevs/armv8.rst | 7 ++-
> > drivers/crypto/armv8/Makefile | 3 +-
> > drivers/crypto/armv8/armv8_pmd_private.h | 4 +-
> > drivers/crypto/armv8/rte_armv8_pmd.c | 55 ++++++++++++++++-------
> -
> > drivers/crypto/armv8/rte_armv8_pmd_ops.c | 2 -
> > mk/rte.app.mk | 2 +-
> > 6 files changed, 44 insertions(+), 29 deletions(-)
> >
>
> This patchset was sent as RFC. Do you intend to send a formal patchset or
> this was the final patch and RFC was mentioned by mistake?
>
Hi Akhil,
Thanks for asking.
I will send a formal patchset, in couple of days.
/Ruifeng
> Regards,
> Akhil
^ permalink raw reply [flat|nested] 20+ messages in thread
* [dpdk-dev] [PATCH v2 0/3] armv8 crypto PMD update
2019-12-10 8:28 [dpdk-dev] [RFC PATCH 0/3] armv8 crypto PMD update Ruifeng Wang
` (3 preceding siblings ...)
2020-01-17 12:11 ` [dpdk-dev] [RFC PATCH 0/3] armv8 crypto PMD update Akhil Goyal
@ 2020-01-19 7:40 ` Ruifeng Wang
2020-01-19 7:40 ` [dpdk-dev] [PATCH v2 1/3] crypto/armv8: link PMD to crypto library hosted by Arm Ruifeng Wang
` (3 more replies)
2020-01-23 3:45 ` [dpdk-dev] [PATCH v3 0/5] " Ruifeng Wang
5 siblings, 4 replies; 20+ messages in thread
From: Ruifeng Wang @ 2020-01-19 7:40 UTC (permalink / raw)
To: akhil.goyal, gavin.hu; +Cc: dev, jerinj, honnappa.nagarahalli, nd, Ruifeng Wang
Maintainance of armv8_crypto library created by Marvell/Cavium will
be discontinued. Going forward, Armv8 crypto PMD will link to AArch64
crypto library hosted by Arm.
Patch 1/3, 2/3 update source code and document respectively to reflect
the change.
Patch 3/3 fixs Clang build issue when Armv8 crypto PMD is enabled.
v2:
Convert to formal patches from RFC.
API and public structure renaming.
Ruifeng Wang (3):
crypto/armv8: link PMD to crypto library hosted by Arm
doc: update link to the crypto library for armv8 PMD
crypto/armv8: fix clang build
doc/guides/cryptodevs/armv8.rst | 7 ++-
drivers/crypto/armv8/Makefile | 3 +-
drivers/crypto/armv8/armv8_pmd_private.h | 4 +-
drivers/crypto/armv8/rte_armv8_pmd.c | 55 ++++++++++++++++--------
drivers/crypto/armv8/rte_armv8_pmd_ops.c | 2 -
mk/rte.app.mk | 2 +-
6 files changed, 44 insertions(+), 29 deletions(-)
--
2.17.1
^ permalink raw reply [flat|nested] 20+ messages in thread
* [dpdk-dev] [PATCH v2 1/3] crypto/armv8: link PMD to crypto library hosted by Arm
2020-01-19 7:40 ` [dpdk-dev] [PATCH v2 " Ruifeng Wang
@ 2020-01-19 7:40 ` Ruifeng Wang
2020-01-19 7:40 ` [dpdk-dev] [PATCH v2 2/3] doc: update link to the crypto library for armv8 PMD Ruifeng Wang
` (2 subsequent siblings)
3 siblings, 0 replies; 20+ messages in thread
From: Ruifeng Wang @ 2020-01-19 7:40 UTC (permalink / raw)
To: akhil.goyal, gavin.hu; +Cc: dev, jerinj, honnappa.nagarahalli, nd, Ruifeng Wang
Armv8 crypto PMD linked to armv8_crypto library created by Marvell.
Maintenance of armv8_crypto library will be discontinued.
Change Armv8 PMD to link to AArch64 crypto library hosted by Arm.
Signed-off-by: Ruifeng Wang <ruifeng.wang@arm.com>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Reviewed-by: Gavin Hu <gavin.hu@arm.com>
Reviewed-by: Ola Liljedahl <ola.liljedahl@arm.com>
---
drivers/crypto/armv8/Makefile | 3 +-
drivers/crypto/armv8/armv8_pmd_private.h | 4 ++-
drivers/crypto/armv8/rte_armv8_pmd.c | 40 ++++++++++++++----------
drivers/crypto/armv8/rte_armv8_pmd_ops.c | 2 --
mk/rte.app.mk | 2 +-
5 files changed, 29 insertions(+), 22 deletions(-)
diff --git a/drivers/crypto/armv8/Makefile b/drivers/crypto/armv8/Makefile
index 125283664..7f20a28d4 100644
--- a/drivers/crypto/armv8/Makefile
+++ b/drivers/crypto/armv8/Makefile
@@ -24,9 +24,8 @@ EXPORT_MAP := rte_pmd_armv8_version.map
# external library dependencies
CFLAGS += -I$(ARMV8_CRYPTO_LIB_PATH)
-CFLAGS += -I$(ARMV8_CRYPTO_LIB_PATH)/asm/include
CFLAGS += -DALLOW_EXPERIMENTAL_API
-LDLIBS += -L$(ARMV8_CRYPTO_LIB_PATH) -larmv8_crypto
+LDLIBS += -L$(ARMV8_CRYPTO_LIB_PATH) -lAArch64crypto
LDLIBS += -lrte_eal -lrte_mbuf -lrte_mempool -lrte_ring
LDLIBS += -lrte_cryptodev
LDLIBS += -lrte_bus_vdev
diff --git a/drivers/crypto/armv8/armv8_pmd_private.h b/drivers/crypto/armv8/armv8_pmd_private.h
index 24040dda2..e08d0df78 100644
--- a/drivers/crypto/armv8/armv8_pmd_private.h
+++ b/drivers/crypto/armv8/armv8_pmd_private.h
@@ -5,6 +5,8 @@
#ifndef _ARMV8_PMD_PRIVATE_H_
#define _ARMV8_PMD_PRIVATE_H_
+#include "AArch64cryptolib.h"
+
#define CRYPTODEV_NAME_ARMV8_PMD crypto_armv8
/**< ARMv8 Crypto PMD device name */
@@ -98,7 +100,7 @@ enum armv8_crypto_auth_mode {
typedef int (*crypto_func_t)(uint8_t *, uint8_t *, uint64_t,
uint8_t *, uint8_t *, uint64_t,
- crypto_arg_t *);
+ armv8_cipher_digest_t *);
typedef void (*crypto_key_sched_t)(uint8_t *, const uint8_t *);
diff --git a/drivers/crypto/armv8/rte_armv8_pmd.c b/drivers/crypto/armv8/rte_armv8_pmd.c
index 7dc83e69e..fd8140896 100644
--- a/drivers/crypto/armv8/rte_armv8_pmd.c
+++ b/drivers/crypto/armv8/rte_armv8_pmd.c
@@ -12,7 +12,7 @@
#include <rte_malloc.h>
#include <rte_cpuflags.h>
-#include "armv8_crypto_defs.h"
+#include "AArch64cryptolib.h"
#include "armv8_pmd_private.h"
@@ -78,8 +78,10 @@ crypto_func_tbl_t[CRYPTO_CIPHER_MAX][CRYPTO_AUTH_MAX][CRYPTO_CIPHER_KEYLEN_MAX];
static const crypto_func_tbl_t
crypto_op_ca_encrypt = {
/* [cipher alg][auth alg][key length] = crypto_function, */
- [CIPH_AES_CBC][AUTH_SHA1_HMAC][KEYL(128)] = aes128cbc_sha1_hmac,
- [CIPH_AES_CBC][AUTH_SHA256_HMAC][KEYL(128)] = aes128cbc_sha256_hmac,
+ [CIPH_AES_CBC][AUTH_SHA1_HMAC][KEYL(128)] =
+ armv8_enc_aes_cbc_sha1_128,
+ [CIPH_AES_CBC][AUTH_SHA256_HMAC][KEYL(128)] =
+ armv8_enc_aes_cbc_sha256_128,
};
static const crypto_func_tbl_t
@@ -95,8 +97,10 @@ crypto_op_ac_encrypt = {
static const crypto_func_tbl_t
crypto_op_ac_decrypt = {
/* [cipher alg][auth alg][key length] = crypto_function, */
- [CIPH_AES_CBC][AUTH_SHA1_HMAC][KEYL(128)] = sha1_hmac_aes128cbc_dec,
- [CIPH_AES_CBC][AUTH_SHA256_HMAC][KEYL(128)] = sha256_hmac_aes128cbc_dec,
+ [CIPH_AES_CBC][AUTH_SHA1_HMAC][KEYL(128)] =
+ armv8_dec_aes_cbc_sha1_128,
+ [CIPH_AES_CBC][AUTH_SHA256_HMAC][KEYL(128)] =
+ armv8_dec_aes_cbc_sha256_128,
};
/**
@@ -155,13 +159,13 @@ crypto_key_sched_tbl_t[CRYPTO_CIPHER_MAX][CRYPTO_CIPHER_KEYLEN_MAX];
static const crypto_key_sched_tbl_t
crypto_key_sched_encrypt = {
/* [cipher alg][key length] = key_expand_func, */
- [CIPH_AES_CBC][KEYL(128)] = aes128_key_sched_enc,
+ [CIPH_AES_CBC][KEYL(128)] = armv8_expandkeys_enc_aes_cbc_128,
};
static const crypto_key_sched_tbl_t
crypto_key_sched_decrypt = {
/* [cipher alg][key length] = key_expand_func, */
- [CIPH_AES_CBC][KEYL(128)] = aes128_key_sched_dec,
+ [CIPH_AES_CBC][KEYL(128)] = armv8_expandkeys_dec_aes_cbc_128,
};
/**
@@ -277,14 +281,16 @@ auth_set_prerequisites(struct armv8_crypto_session *sess,
* Calculate partial hash values for i_key_pad and o_key_pad.
* Will be used as initialization state for final HMAC.
*/
- error = sha1_block_partial(NULL, sess->auth.hmac.i_key_pad,
- partial, SHA1_BLOCK_SIZE);
+ error = armv8_sha1_block_partial(NULL,
+ sess->auth.hmac.i_key_pad,
+ partial, SHA1_BLOCK_SIZE);
if (error != 0)
return -1;
memcpy(sess->auth.hmac.i_key_pad, partial, SHA1_BLOCK_SIZE);
- error = sha1_block_partial(NULL, sess->auth.hmac.o_key_pad,
- partial, SHA1_BLOCK_SIZE);
+ error = armv8_sha1_block_partial(NULL,
+ sess->auth.hmac.o_key_pad,
+ partial, SHA1_BLOCK_SIZE);
if (error != 0)
return -1;
memcpy(sess->auth.hmac.o_key_pad, partial, SHA1_BLOCK_SIZE);
@@ -310,14 +316,16 @@ auth_set_prerequisites(struct armv8_crypto_session *sess,
* Calculate partial hash values for i_key_pad and o_key_pad.
* Will be used as initialization state for final HMAC.
*/
- error = sha256_block_partial(NULL, sess->auth.hmac.i_key_pad,
- partial, SHA256_BLOCK_SIZE);
+ error = armv8_sha256_block_partial(NULL,
+ sess->auth.hmac.i_key_pad,
+ partial, SHA256_BLOCK_SIZE);
if (error != 0)
return -1;
memcpy(sess->auth.hmac.i_key_pad, partial, SHA256_BLOCK_SIZE);
- error = sha256_block_partial(NULL, sess->auth.hmac.o_key_pad,
- partial, SHA256_BLOCK_SIZE);
+ error = armv8_sha256_block_partial(NULL,
+ sess->auth.hmac.o_key_pad,
+ partial, SHA256_BLOCK_SIZE);
if (error != 0)
return -1;
memcpy(sess->auth.hmac.o_key_pad, partial, SHA256_BLOCK_SIZE);
@@ -552,7 +560,7 @@ process_armv8_chained_op(struct armv8_crypto_qp *qp, struct rte_crypto_op *op,
struct rte_mbuf *mbuf_src, struct rte_mbuf *mbuf_dst)
{
crypto_func_t crypto_func;
- crypto_arg_t arg;
+ armv8_cipher_digest_t arg;
struct rte_mbuf *m_asrc, *m_adst;
uint8_t *csrc, *cdst;
uint8_t *adst, *asrc;
diff --git a/drivers/crypto/armv8/rte_armv8_pmd_ops.c b/drivers/crypto/armv8/rte_armv8_pmd_ops.c
index 57952bef5..4fd384d1a 100644
--- a/drivers/crypto/armv8/rte_armv8_pmd_ops.c
+++ b/drivers/crypto/armv8/rte_armv8_pmd_ops.c
@@ -8,8 +8,6 @@
#include <rte_malloc.h>
#include <rte_cryptodev_pmd.h>
-#include "armv8_crypto_defs.h"
-
#include "armv8_pmd_private.h"
static const struct rte_cryptodev_capabilities
diff --git a/mk/rte.app.mk b/mk/rte.app.mk
index 05ea034b9..ab47e4cee 100644
--- a/mk/rte.app.mk
+++ b/mk/rte.app.mk
@@ -274,7 +274,7 @@ _LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_KASUMI) += -L$(LIBSSO_KASUMI_PATH)/build -l
_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_ZUC) += -lrte_pmd_zuc
_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_ZUC) += -L$(LIBSSO_ZUC_PATH)/build -lsso_zuc
_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_ARMV8_CRYPTO) += -lrte_pmd_armv8
-_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_ARMV8_CRYPTO) += -L$(ARMV8_CRYPTO_LIB_PATH) -larmv8_crypto
+_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_ARMV8_CRYPTO) += -L$(ARMV8_CRYPTO_LIB_PATH) -lAArch64crypto
_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_MVSAM_CRYPTO) += -L$(LIBMUSDK_PATH)/lib -lrte_pmd_mvsam_crypto -lmusdk
_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_NITROX) += -lrte_pmd_nitrox
_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_OCTEONTX_CRYPTO) += -lrte_pmd_octeontx_crypto
--
2.17.1
^ permalink raw reply [flat|nested] 20+ messages in thread
* [dpdk-dev] [PATCH v2 2/3] doc: update link to the crypto library for armv8 PMD
2020-01-19 7:40 ` [dpdk-dev] [PATCH v2 " Ruifeng Wang
2020-01-19 7:40 ` [dpdk-dev] [PATCH v2 1/3] crypto/armv8: link PMD to crypto library hosted by Arm Ruifeng Wang
@ 2020-01-19 7:40 ` Ruifeng Wang
2020-01-19 7:40 ` [dpdk-dev] [PATCH v2 3/3] crypto/armv8: fix clang build Ruifeng Wang
2020-01-21 7:09 ` [dpdk-dev] [PATCH v2 0/3] armv8 crypto PMD update Akhil Goyal
3 siblings, 0 replies; 20+ messages in thread
From: Ruifeng Wang @ 2020-01-19 7:40 UTC (permalink / raw)
To: akhil.goyal, gavin.hu; +Cc: dev, jerinj, honnappa.nagarahalli, nd, Ruifeng Wang
Armv8 crypto PMD now uses crypto library hosted by Arm.
Update doc with the crypto library link to reflect the change.
Signed-off-by: Ruifeng Wang <ruifeng.wang@arm.com>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
---
doc/guides/cryptodevs/armv8.rst | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/doc/guides/cryptodevs/armv8.rst b/doc/guides/cryptodevs/armv8.rst
index 1ab40096e..fee85354b 100644
--- a/doc/guides/cryptodevs/armv8.rst
+++ b/doc/guides/cryptodevs/armv8.rst
@@ -28,12 +28,11 @@ Installation
In order to enable this virtual crypto PMD, user must:
-* Download ARMv8 crypto library source code from
- `here <https://github.com/caviumnetworks/armv8_crypto>`_
+* Download AArch64 crypto library source code from
+ `here <https://github.com/ARM-software/AArch64cryptolib>`_
* Export the environmental variable ARMV8_CRYPTO_LIB_PATH with
- the path where the ``armv8_crypto`` library was downloaded
- or cloned.
+ the path to ``AArch64cryptolib`` library.
* Build the library by invoking:
--
2.17.1
^ permalink raw reply [flat|nested] 20+ messages in thread
* [dpdk-dev] [PATCH v2 3/3] crypto/armv8: fix clang build
2020-01-19 7:40 ` [dpdk-dev] [PATCH v2 " Ruifeng Wang
2020-01-19 7:40 ` [dpdk-dev] [PATCH v2 1/3] crypto/armv8: link PMD to crypto library hosted by Arm Ruifeng Wang
2020-01-19 7:40 ` [dpdk-dev] [PATCH v2 2/3] doc: update link to the crypto library for armv8 PMD Ruifeng Wang
@ 2020-01-19 7:40 ` Ruifeng Wang
2020-01-21 7:09 ` [dpdk-dev] [PATCH v2 0/3] armv8 crypto PMD update Akhil Goyal
3 siblings, 0 replies; 20+ messages in thread
From: Ruifeng Wang @ 2020-01-19 7:40 UTC (permalink / raw)
To: akhil.goyal, gavin.hu
Cc: dev, jerinj, honnappa.nagarahalli, nd, Ruifeng Wang, stable
1. Clang requires braces around initialization of subobject.
2. Clang complains implicit conversion of enumeration type.
Trapped issue with Clang version 8.0 and CONFIG_RTE_LIBRTE_PMD_ARMV8_CRYPTO
was set.
Error messages:
rte_armv8_pmd.c:144:2: error: suggest braces around initialization of
subobject [-Werror,-Wmissing-braces]
NULL
^~~~
{ }
/usr/lib/llvm-8/lib/clang/8.0.0/include/stddef.h:105:16: note: expanded
from macro 'NULL'
^~~~~~~~~~
rte_armv8_pmd.c:429:21: error: implicit conversion from enumeration
type 'enum rte_crypto_cipher_operation' to different enumeration type
'enum armv8_crypto_cipher_operation' [-Werror,-Wenum-conversion]
cop = sess->cipher.direction;
~ ~~~~~~~~~~~~~^~~~~~~~~
Fixes: 169ca3db550c ("crypto/armv8: add PMD optimized for ARMv8 processors")
Cc: stable@dpdk.org
Signed-off-by: Ruifeng Wang <ruifeng.wang@arm.com>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Reviewed-by: Gavin Hu <gavin.hu@arm.com>
---
drivers/crypto/armv8/rte_armv8_pmd.c | 15 ++++++++++++---
1 file changed, 12 insertions(+), 3 deletions(-)
diff --git a/drivers/crypto/armv8/rte_armv8_pmd.c b/drivers/crypto/armv8/rte_armv8_pmd.c
index fd8140896..d2b7ab5e0 100644
--- a/drivers/crypto/armv8/rte_armv8_pmd.c
+++ b/drivers/crypto/armv8/rte_armv8_pmd.c
@@ -86,12 +86,12 @@ crypto_op_ca_encrypt = {
static const crypto_func_tbl_t
crypto_op_ca_decrypt = {
- NULL
+ { {NULL} }
};
static const crypto_func_tbl_t
crypto_op_ac_encrypt = {
- NULL
+ { {NULL} }
};
static const crypto_func_tbl_t
@@ -377,7 +377,16 @@ armv8_crypto_set_session_chained_parameters(struct armv8_crypto_session *sess,
/* Select cipher key */
sess->cipher.key.length = cipher_xform->cipher.key.length;
/* Set cipher direction */
- cop = sess->cipher.direction;
+ switch (sess->cipher.direction) {
+ case RTE_CRYPTO_CIPHER_OP_ENCRYPT:
+ cop = ARMV8_CRYPTO_CIPHER_OP_ENCRYPT;
+ break;
+ case RTE_CRYPTO_CIPHER_OP_DECRYPT:
+ cop = ARMV8_CRYPTO_CIPHER_OP_DECRYPT;
+ break;
+ default:
+ return -ENOTSUP;
+ }
/* Set cipher algorithm */
calg = cipher_xform->cipher.algo;
--
2.17.1
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [dpdk-dev] [PATCH v2 0/3] armv8 crypto PMD update
2020-01-19 7:40 ` [dpdk-dev] [PATCH v2 " Ruifeng Wang
` (2 preceding siblings ...)
2020-01-19 7:40 ` [dpdk-dev] [PATCH v2 3/3] crypto/armv8: fix clang build Ruifeng Wang
@ 2020-01-21 7:09 ` Akhil Goyal
2020-01-21 9:49 ` Ruifeng Wang
3 siblings, 1 reply; 20+ messages in thread
From: Akhil Goyal @ 2020-01-21 7:09 UTC (permalink / raw)
To: Ruifeng Wang, gavin.hu; +Cc: dev, jerinj, honnappa.nagarahalli, nd
Hi,
Please also enable meson build for armv8 PMD.
There was a patch in last release which was not applied. That need a rebase and can be included in this series if more changes need to be done for the changes in this patchset.
http://patches.dpdk.org/patch/60499/
Please also update the release notes that the hosting for armv8 crypto has changed and the name has also changed.
I sent out a mail for the compilation issue that I face. Could you please reply to that as well and add any missing info required in the patchset.
Regards,
Akhil
> -----Original Message-----
> From: Ruifeng Wang <ruifeng.wang@arm.com>
> Sent: Sunday, January 19, 2020 1:10 PM
> To: Akhil Goyal <akhil.goyal@nxp.com>; gavin.hu@arm.com
> Cc: dev@dpdk.org; jerinj@marvell.com; honnappa.nagarahalli@arm.com;
> nd@arm.com; Ruifeng Wang <ruifeng.wang@arm.com>
> Subject: [PATCH v2 0/3] armv8 crypto PMD update
>
> Maintainance of armv8_crypto library created by Marvell/Cavium will
> be discontinued. Going forward, Armv8 crypto PMD will link to AArch64
> crypto library hosted by Arm.
>
> Patch 1/3, 2/3 update source code and document respectively to reflect
> the change.
> Patch 3/3 fixs Clang build issue when Armv8 crypto PMD is enabled.
>
>
> v2:
> Convert to formal patches from RFC.
> API and public structure renaming.
>
> Ruifeng Wang (3):
> crypto/armv8: link PMD to crypto library hosted by Arm
> doc: update link to the crypto library for armv8 PMD
> crypto/armv8: fix clang build
>
> doc/guides/cryptodevs/armv8.rst | 7 ++-
> drivers/crypto/armv8/Makefile | 3 +-
> drivers/crypto/armv8/armv8_pmd_private.h | 4 +-
> drivers/crypto/armv8/rte_armv8_pmd.c | 55 ++++++++++++++++--------
> drivers/crypto/armv8/rte_armv8_pmd_ops.c | 2 -
> mk/rte.app.mk | 2 +-
> 6 files changed, 44 insertions(+), 29 deletions(-)
>
> --
> 2.17.1
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [dpdk-dev] [PATCH v2 0/3] armv8 crypto PMD update
2020-01-21 7:09 ` [dpdk-dev] [PATCH v2 0/3] armv8 crypto PMD update Akhil Goyal
@ 2020-01-21 9:49 ` Ruifeng Wang
0 siblings, 0 replies; 20+ messages in thread
From: Ruifeng Wang @ 2020-01-21 9:49 UTC (permalink / raw)
To: Akhil.goyal@nxp.com, Gavin Hu; +Cc: dev, jerinj, Honnappa Nagarahalli, nd, nd
> -----Original Message-----
> From: Akhil Goyal <akhil.goyal@nxp.com>
> Sent: Tuesday, January 21, 2020 15:09
> To: Ruifeng Wang <Ruifeng.Wang@arm.com>; Gavin Hu
> <Gavin.Hu@arm.com>
> Cc: dev@dpdk.org; jerinj@marvell.com; Honnappa Nagarahalli
> <Honnappa.Nagarahalli@arm.com>; nd <nd@arm.com>
> Subject: RE: [PATCH v2 0/3] armv8 crypto PMD update
>
> Hi,
>
> Please also enable meson build for armv8 PMD.
> There was a patch in last release which was not applied. That need a rebase
> and can be included in this series if more changes need to be done for the
> changes in this patchset.
> http://patches.dpdk.org/patch/60499/
>
Yes, I will include this patch in this series.
> Please also update the release notes that the hosting for armv8 crypto has
> changed and the name has also changed.
>
OK.
> I sent out a mail for the compilation issue that I face. Could you please reply
> to that as well and add any missing info required in the patchset.
OK.
>
> Regards,
> Akhil
>
> > -----Original Message-----
> > From: Ruifeng Wang <ruifeng.wang@arm.com>
> > Sent: Sunday, January 19, 2020 1:10 PM
> > To: Akhil Goyal <akhil.goyal@nxp.com>; gavin.hu@arm.com
> > Cc: dev@dpdk.org; jerinj@marvell.com; honnappa.nagarahalli@arm.com;
> > nd@arm.com; Ruifeng Wang <ruifeng.wang@arm.com>
> > Subject: [PATCH v2 0/3] armv8 crypto PMD update
> >
> > Maintainance of armv8_crypto library created by Marvell/Cavium will be
> > discontinued. Going forward, Armv8 crypto PMD will link to AArch64
> > crypto library hosted by Arm.
> >
> > Patch 1/3, 2/3 update source code and document respectively to reflect
> > the change.
> > Patch 3/3 fixs Clang build issue when Armv8 crypto PMD is enabled.
> >
> >
> > v2:
> > Convert to formal patches from RFC.
> > API and public structure renaming.
> >
> > Ruifeng Wang (3):
> > crypto/armv8: link PMD to crypto library hosted by Arm
> > doc: update link to the crypto library for armv8 PMD
> > crypto/armv8: fix clang build
> >
> > doc/guides/cryptodevs/armv8.rst | 7 ++-
> > drivers/crypto/armv8/Makefile | 3 +-
> > drivers/crypto/armv8/armv8_pmd_private.h | 4 +-
> > drivers/crypto/armv8/rte_armv8_pmd.c | 55 ++++++++++++++++-------
> -
> > drivers/crypto/armv8/rte_armv8_pmd_ops.c | 2 -
> > mk/rte.app.mk | 2 +-
> > 6 files changed, 44 insertions(+), 29 deletions(-)
> >
> > --
> > 2.17.1
^ permalink raw reply [flat|nested] 20+ messages in thread
* [dpdk-dev] [PATCH v3 0/5] armv8 crypto PMD update
2019-12-10 8:28 [dpdk-dev] [RFC PATCH 0/3] armv8 crypto PMD update Ruifeng Wang
` (4 preceding siblings ...)
2020-01-19 7:40 ` [dpdk-dev] [PATCH v2 " Ruifeng Wang
@ 2020-01-23 3:45 ` Ruifeng Wang
2020-01-23 3:45 ` [dpdk-dev] [PATCH v3 1/5] crypto/armv8: link PMD to crypto library hosted by Arm Ruifeng Wang
` (5 more replies)
5 siblings, 6 replies; 20+ messages in thread
From: Ruifeng Wang @ 2020-01-23 3:45 UTC (permalink / raw)
To: akhil.goyal, gavin.hu; +Cc: dev, jerinj, honnappa.nagarahalli, nd, Ruifeng Wang
Maintainance of armv8_crypto library created by Marvell/Cavium will
be discontinued. Going forward, Armv8 crypto PMD will link to AArch64
crypto library hosted by Arm.
Patch 1/5, 3/5 update source code and document respectively to reflect
the change.
Patch 2/5 adds meson build support for this PMD.
Patch 5/5 fixs Clang build issue when Armv8 crypto PMD is enabled.
v3:
Include meson build support patch.
Add release notes.
v2:
Convert to formal patches from RFC.
API and public structure renaming.
Dharmik Thakkar (1):
crypto/armv8: enable meson build
Ruifeng Wang (4):
crypto/armv8: link PMD to crypto library hosted by Arm
doc: update link to the crypto library for armv8 PMD
doc: update release notes for armv8 crypto PMD
crypto/armv8: fix clang build
doc/guides/cryptodevs/armv8.rst | 7 ++-
doc/guides/rel_notes/release_20_02.rst | 5 +++
drivers/crypto/armv8/Makefile | 3 +-
drivers/crypto/armv8/armv8_pmd_private.h | 4 +-
drivers/crypto/armv8/meson.build | 25 +++++++++++
drivers/crypto/armv8/rte_armv8_pmd.c | 55 ++++++++++++++++--------
drivers/crypto/armv8/rte_armv8_pmd_ops.c | 2 -
drivers/crypto/meson.build | 1 +
meson_options.txt | 2 +
mk/rte.app.mk | 2 +-
10 files changed, 77 insertions(+), 29 deletions(-)
create mode 100644 drivers/crypto/armv8/meson.build
--
2.17.1
^ permalink raw reply [flat|nested] 20+ messages in thread
* [dpdk-dev] [PATCH v3 1/5] crypto/armv8: link PMD to crypto library hosted by Arm
2020-01-23 3:45 ` [dpdk-dev] [PATCH v3 0/5] " Ruifeng Wang
@ 2020-01-23 3:45 ` Ruifeng Wang
2020-01-23 3:45 ` [dpdk-dev] [PATCH v3 2/5] crypto/armv8: enable meson build Ruifeng Wang
` (4 subsequent siblings)
5 siblings, 0 replies; 20+ messages in thread
From: Ruifeng Wang @ 2020-01-23 3:45 UTC (permalink / raw)
To: akhil.goyal, gavin.hu; +Cc: dev, jerinj, honnappa.nagarahalli, nd, Ruifeng Wang
Armv8 crypto PMD linked to armv8_crypto library created by Marvell.
Maintenance of armv8_crypto library will be discontinued.
Change Armv8 PMD to link to AArch64 crypto library hosted by Arm.
Signed-off-by: Ruifeng Wang <ruifeng.wang@arm.com>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Reviewed-by: Gavin Hu <gavin.hu@arm.com>
Reviewed-by: Ola Liljedahl <ola.liljedahl@arm.com>
---
drivers/crypto/armv8/Makefile | 3 +-
drivers/crypto/armv8/armv8_pmd_private.h | 4 ++-
drivers/crypto/armv8/rte_armv8_pmd.c | 40 ++++++++++++++----------
drivers/crypto/armv8/rte_armv8_pmd_ops.c | 2 --
mk/rte.app.mk | 2 +-
5 files changed, 29 insertions(+), 22 deletions(-)
diff --git a/drivers/crypto/armv8/Makefile b/drivers/crypto/armv8/Makefile
index 125283664..7f20a28d4 100644
--- a/drivers/crypto/armv8/Makefile
+++ b/drivers/crypto/armv8/Makefile
@@ -24,9 +24,8 @@ EXPORT_MAP := rte_pmd_armv8_version.map
# external library dependencies
CFLAGS += -I$(ARMV8_CRYPTO_LIB_PATH)
-CFLAGS += -I$(ARMV8_CRYPTO_LIB_PATH)/asm/include
CFLAGS += -DALLOW_EXPERIMENTAL_API
-LDLIBS += -L$(ARMV8_CRYPTO_LIB_PATH) -larmv8_crypto
+LDLIBS += -L$(ARMV8_CRYPTO_LIB_PATH) -lAArch64crypto
LDLIBS += -lrte_eal -lrte_mbuf -lrte_mempool -lrte_ring
LDLIBS += -lrte_cryptodev
LDLIBS += -lrte_bus_vdev
diff --git a/drivers/crypto/armv8/armv8_pmd_private.h b/drivers/crypto/armv8/armv8_pmd_private.h
index 24040dda2..e08d0df78 100644
--- a/drivers/crypto/armv8/armv8_pmd_private.h
+++ b/drivers/crypto/armv8/armv8_pmd_private.h
@@ -5,6 +5,8 @@
#ifndef _ARMV8_PMD_PRIVATE_H_
#define _ARMV8_PMD_PRIVATE_H_
+#include "AArch64cryptolib.h"
+
#define CRYPTODEV_NAME_ARMV8_PMD crypto_armv8
/**< ARMv8 Crypto PMD device name */
@@ -98,7 +100,7 @@ enum armv8_crypto_auth_mode {
typedef int (*crypto_func_t)(uint8_t *, uint8_t *, uint64_t,
uint8_t *, uint8_t *, uint64_t,
- crypto_arg_t *);
+ armv8_cipher_digest_t *);
typedef void (*crypto_key_sched_t)(uint8_t *, const uint8_t *);
diff --git a/drivers/crypto/armv8/rte_armv8_pmd.c b/drivers/crypto/armv8/rte_armv8_pmd.c
index 7dc83e69e..fd8140896 100644
--- a/drivers/crypto/armv8/rte_armv8_pmd.c
+++ b/drivers/crypto/armv8/rte_armv8_pmd.c
@@ -12,7 +12,7 @@
#include <rte_malloc.h>
#include <rte_cpuflags.h>
-#include "armv8_crypto_defs.h"
+#include "AArch64cryptolib.h"
#include "armv8_pmd_private.h"
@@ -78,8 +78,10 @@ crypto_func_tbl_t[CRYPTO_CIPHER_MAX][CRYPTO_AUTH_MAX][CRYPTO_CIPHER_KEYLEN_MAX];
static const crypto_func_tbl_t
crypto_op_ca_encrypt = {
/* [cipher alg][auth alg][key length] = crypto_function, */
- [CIPH_AES_CBC][AUTH_SHA1_HMAC][KEYL(128)] = aes128cbc_sha1_hmac,
- [CIPH_AES_CBC][AUTH_SHA256_HMAC][KEYL(128)] = aes128cbc_sha256_hmac,
+ [CIPH_AES_CBC][AUTH_SHA1_HMAC][KEYL(128)] =
+ armv8_enc_aes_cbc_sha1_128,
+ [CIPH_AES_CBC][AUTH_SHA256_HMAC][KEYL(128)] =
+ armv8_enc_aes_cbc_sha256_128,
};
static const crypto_func_tbl_t
@@ -95,8 +97,10 @@ crypto_op_ac_encrypt = {
static const crypto_func_tbl_t
crypto_op_ac_decrypt = {
/* [cipher alg][auth alg][key length] = crypto_function, */
- [CIPH_AES_CBC][AUTH_SHA1_HMAC][KEYL(128)] = sha1_hmac_aes128cbc_dec,
- [CIPH_AES_CBC][AUTH_SHA256_HMAC][KEYL(128)] = sha256_hmac_aes128cbc_dec,
+ [CIPH_AES_CBC][AUTH_SHA1_HMAC][KEYL(128)] =
+ armv8_dec_aes_cbc_sha1_128,
+ [CIPH_AES_CBC][AUTH_SHA256_HMAC][KEYL(128)] =
+ armv8_dec_aes_cbc_sha256_128,
};
/**
@@ -155,13 +159,13 @@ crypto_key_sched_tbl_t[CRYPTO_CIPHER_MAX][CRYPTO_CIPHER_KEYLEN_MAX];
static const crypto_key_sched_tbl_t
crypto_key_sched_encrypt = {
/* [cipher alg][key length] = key_expand_func, */
- [CIPH_AES_CBC][KEYL(128)] = aes128_key_sched_enc,
+ [CIPH_AES_CBC][KEYL(128)] = armv8_expandkeys_enc_aes_cbc_128,
};
static const crypto_key_sched_tbl_t
crypto_key_sched_decrypt = {
/* [cipher alg][key length] = key_expand_func, */
- [CIPH_AES_CBC][KEYL(128)] = aes128_key_sched_dec,
+ [CIPH_AES_CBC][KEYL(128)] = armv8_expandkeys_dec_aes_cbc_128,
};
/**
@@ -277,14 +281,16 @@ auth_set_prerequisites(struct armv8_crypto_session *sess,
* Calculate partial hash values for i_key_pad and o_key_pad.
* Will be used as initialization state for final HMAC.
*/
- error = sha1_block_partial(NULL, sess->auth.hmac.i_key_pad,
- partial, SHA1_BLOCK_SIZE);
+ error = armv8_sha1_block_partial(NULL,
+ sess->auth.hmac.i_key_pad,
+ partial, SHA1_BLOCK_SIZE);
if (error != 0)
return -1;
memcpy(sess->auth.hmac.i_key_pad, partial, SHA1_BLOCK_SIZE);
- error = sha1_block_partial(NULL, sess->auth.hmac.o_key_pad,
- partial, SHA1_BLOCK_SIZE);
+ error = armv8_sha1_block_partial(NULL,
+ sess->auth.hmac.o_key_pad,
+ partial, SHA1_BLOCK_SIZE);
if (error != 0)
return -1;
memcpy(sess->auth.hmac.o_key_pad, partial, SHA1_BLOCK_SIZE);
@@ -310,14 +316,16 @@ auth_set_prerequisites(struct armv8_crypto_session *sess,
* Calculate partial hash values for i_key_pad and o_key_pad.
* Will be used as initialization state for final HMAC.
*/
- error = sha256_block_partial(NULL, sess->auth.hmac.i_key_pad,
- partial, SHA256_BLOCK_SIZE);
+ error = armv8_sha256_block_partial(NULL,
+ sess->auth.hmac.i_key_pad,
+ partial, SHA256_BLOCK_SIZE);
if (error != 0)
return -1;
memcpy(sess->auth.hmac.i_key_pad, partial, SHA256_BLOCK_SIZE);
- error = sha256_block_partial(NULL, sess->auth.hmac.o_key_pad,
- partial, SHA256_BLOCK_SIZE);
+ error = armv8_sha256_block_partial(NULL,
+ sess->auth.hmac.o_key_pad,
+ partial, SHA256_BLOCK_SIZE);
if (error != 0)
return -1;
memcpy(sess->auth.hmac.o_key_pad, partial, SHA256_BLOCK_SIZE);
@@ -552,7 +560,7 @@ process_armv8_chained_op(struct armv8_crypto_qp *qp, struct rte_crypto_op *op,
struct rte_mbuf *mbuf_src, struct rte_mbuf *mbuf_dst)
{
crypto_func_t crypto_func;
- crypto_arg_t arg;
+ armv8_cipher_digest_t arg;
struct rte_mbuf *m_asrc, *m_adst;
uint8_t *csrc, *cdst;
uint8_t *adst, *asrc;
diff --git a/drivers/crypto/armv8/rte_armv8_pmd_ops.c b/drivers/crypto/armv8/rte_armv8_pmd_ops.c
index 57952bef5..4fd384d1a 100644
--- a/drivers/crypto/armv8/rte_armv8_pmd_ops.c
+++ b/drivers/crypto/armv8/rte_armv8_pmd_ops.c
@@ -8,8 +8,6 @@
#include <rte_malloc.h>
#include <rte_cryptodev_pmd.h>
-#include "armv8_crypto_defs.h"
-
#include "armv8_pmd_private.h"
static const struct rte_cryptodev_capabilities
diff --git a/mk/rte.app.mk b/mk/rte.app.mk
index 15acf95db..fb391af57 100644
--- a/mk/rte.app.mk
+++ b/mk/rte.app.mk
@@ -280,7 +280,7 @@ _LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_KASUMI) += -L$(LIBSSO_KASUMI_PATH)/build -l
_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_ZUC) += -lrte_pmd_zuc
_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_ZUC) += -L$(LIBSSO_ZUC_PATH)/build -lsso_zuc
_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_ARMV8_CRYPTO) += -lrte_pmd_armv8
-_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_ARMV8_CRYPTO) += -L$(ARMV8_CRYPTO_LIB_PATH) -larmv8_crypto
+_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_ARMV8_CRYPTO) += -L$(ARMV8_CRYPTO_LIB_PATH) -lAArch64crypto
_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_MVSAM_CRYPTO) += -L$(LIBMUSDK_PATH)/lib -lrte_pmd_mvsam_crypto -lmusdk
_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_NITROX) += -lrte_pmd_nitrox
_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_OCTEONTX_CRYPTO) += -lrte_pmd_octeontx_crypto
--
2.17.1
^ permalink raw reply [flat|nested] 20+ messages in thread
* [dpdk-dev] [PATCH v3 2/5] crypto/armv8: enable meson build
2020-01-23 3:45 ` [dpdk-dev] [PATCH v3 0/5] " Ruifeng Wang
2020-01-23 3:45 ` [dpdk-dev] [PATCH v3 1/5] crypto/armv8: link PMD to crypto library hosted by Arm Ruifeng Wang
@ 2020-01-23 3:45 ` Ruifeng Wang
2020-01-23 3:45 ` [dpdk-dev] [PATCH v3 3/5] doc: update link to the crypto library for armv8 PMD Ruifeng Wang
` (3 subsequent siblings)
5 siblings, 0 replies; 20+ messages in thread
From: Ruifeng Wang @ 2020-01-23 3:45 UTC (permalink / raw)
To: akhil.goyal, gavin.hu
Cc: dev, jerinj, honnappa.nagarahalli, nd, Dharmik Thakkar
From: Dharmik Thakkar <dharmik.thakkar@arm.com>
Add new meson.build file for crypto/armv8
Suggested-by: Thomas Monjalon <thomas@monjalon.net>
Signed-off-by: Dharmik Thakkar <dharmik.thakkar@arm.com>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Tested-by: Ruifeng Wang <ruifeng.wang@arm.com>
---
drivers/crypto/armv8/meson.build | 25 +++++++++++++++++++++++++
drivers/crypto/meson.build | 1 +
meson_options.txt | 2 ++
3 files changed, 28 insertions(+)
create mode 100644 drivers/crypto/armv8/meson.build
diff --git a/drivers/crypto/armv8/meson.build b/drivers/crypto/armv8/meson.build
new file mode 100644
index 000000000..6ecb78b42
--- /dev/null
+++ b/drivers/crypto/armv8/meson.build
@@ -0,0 +1,25 @@
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright(c) 2019 Arm Limited
+
+path = get_option('armv8_crypto_dir')
+if path == ''
+ build = false
+ reason = 'missing dependency, "armv8_crypto"'
+ subdir_done()
+endif
+
+inc_dir = path
+
+lib = cc.find_library('libAArch64crypto', dirs: [path], required: false)
+if not lib.found()
+ build = false
+ reason = 'missing dependency, "AArch64crypto"'
+ subdir_done()
+else
+ ext_deps += lib
+ includes += include_directories(inc_dir)
+endif
+
+deps += ['bus_vdev']
+sources = files('rte_armv8_pmd.c', 'rte_armv8_pmd_ops.c')
+allow_experimental_apis = true
diff --git a/drivers/crypto/meson.build b/drivers/crypto/meson.build
index 229debdfe..7fa1fbe26 100644
--- a/drivers/crypto/meson.build
+++ b/drivers/crypto/meson.build
@@ -3,6 +3,7 @@
drivers = ['aesni_gcm',
'aesni_mb',
+ 'armv8',
'caam_jr',
'ccp',
'dpaa_sec',
diff --git a/meson_options.txt b/meson_options.txt
index 53dfe13c3..20be15fe6 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -1,5 +1,7 @@
# Please keep these options sorted alphabetically.
+option('armv8_crypto_dir', type: 'string', value: '',
+ description: 'path to the armv8_crypto library installation directory')
option('disable_drivers', type: 'string', value: '',
description: 'Comma-separated list of drivers to explicitly disable.')
option('drivers_install_subdir', type: 'string', value: 'dpdk/pmds-<VERSION>',
--
2.17.1
^ permalink raw reply [flat|nested] 20+ messages in thread
* [dpdk-dev] [PATCH v3 3/5] doc: update link to the crypto library for armv8 PMD
2020-01-23 3:45 ` [dpdk-dev] [PATCH v3 0/5] " Ruifeng Wang
2020-01-23 3:45 ` [dpdk-dev] [PATCH v3 1/5] crypto/armv8: link PMD to crypto library hosted by Arm Ruifeng Wang
2020-01-23 3:45 ` [dpdk-dev] [PATCH v3 2/5] crypto/armv8: enable meson build Ruifeng Wang
@ 2020-01-23 3:45 ` Ruifeng Wang
2020-01-23 3:45 ` [dpdk-dev] [PATCH v3 4/5] doc: update release notes for armv8 crypto PMD Ruifeng Wang
` (2 subsequent siblings)
5 siblings, 0 replies; 20+ messages in thread
From: Ruifeng Wang @ 2020-01-23 3:45 UTC (permalink / raw)
To: akhil.goyal, gavin.hu; +Cc: dev, jerinj, honnappa.nagarahalli, nd, Ruifeng Wang
Armv8 crypto PMD now uses crypto library hosted by Arm.
Update doc with the crypto library link to reflect the change.
Signed-off-by: Ruifeng Wang <ruifeng.wang@arm.com>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
---
doc/guides/cryptodevs/armv8.rst | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/doc/guides/cryptodevs/armv8.rst b/doc/guides/cryptodevs/armv8.rst
index 1ab40096e..fee85354b 100644
--- a/doc/guides/cryptodevs/armv8.rst
+++ b/doc/guides/cryptodevs/armv8.rst
@@ -28,12 +28,11 @@ Installation
In order to enable this virtual crypto PMD, user must:
-* Download ARMv8 crypto library source code from
- `here <https://github.com/caviumnetworks/armv8_crypto>`_
+* Download AArch64 crypto library source code from
+ `here <https://github.com/ARM-software/AArch64cryptolib>`_
* Export the environmental variable ARMV8_CRYPTO_LIB_PATH with
- the path where the ``armv8_crypto`` library was downloaded
- or cloned.
+ the path to ``AArch64cryptolib`` library.
* Build the library by invoking:
--
2.17.1
^ permalink raw reply [flat|nested] 20+ messages in thread
* [dpdk-dev] [PATCH v3 4/5] doc: update release notes for armv8 crypto PMD
2020-01-23 3:45 ` [dpdk-dev] [PATCH v3 0/5] " Ruifeng Wang
` (2 preceding siblings ...)
2020-01-23 3:45 ` [dpdk-dev] [PATCH v3 3/5] doc: update link to the crypto library for armv8 PMD Ruifeng Wang
@ 2020-01-23 3:45 ` Ruifeng Wang
2020-01-23 3:45 ` [dpdk-dev] [PATCH v3 5/5] crypto/armv8: fix clang build Ruifeng Wang
2020-01-23 13:38 ` [dpdk-dev] [PATCH v3 0/5] armv8 crypto PMD update Akhil Goyal
5 siblings, 0 replies; 20+ messages in thread
From: Ruifeng Wang @ 2020-01-23 3:45 UTC (permalink / raw)
To: akhil.goyal, gavin.hu; +Cc: dev, jerinj, honnappa.nagarahalli, nd, Ruifeng Wang
Armv8 crypto PMD is changed to depend on external crypto library
hosted by Arm. Library name also has change.
Signed-off-by: Ruifeng Wang <ruifeng.wang@arm.com>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
---
doc/guides/rel_notes/release_20_02.rst | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/doc/guides/rel_notes/release_20_02.rst b/doc/guides/rel_notes/release_20_02.rst
index 50e2c1484..b0484af1b 100644
--- a/doc/guides/rel_notes/release_20_02.rst
+++ b/doc/guides/rel_notes/release_20_02.rst
@@ -143,6 +143,11 @@ New Features
Added a new OCTEON TX2 rawdev PMD for End Point mode of operation.
See the :doc:`../rawdevs/octeontx2_ep` for more details on this new PMD.
+* **Changed armv8 crypto PMD external dependency.**
+
+ armv8 crypto PMD now depends on Arm crypto library, and Marvell's
+ armv8 crypto library is not used anymore. Library name is changed
+ from armv8_crypto to AArch64crypto.
Removed Items
-------------
--
2.17.1
^ permalink raw reply [flat|nested] 20+ messages in thread
* [dpdk-dev] [PATCH v3 5/5] crypto/armv8: fix clang build
2020-01-23 3:45 ` [dpdk-dev] [PATCH v3 0/5] " Ruifeng Wang
` (3 preceding siblings ...)
2020-01-23 3:45 ` [dpdk-dev] [PATCH v3 4/5] doc: update release notes for armv8 crypto PMD Ruifeng Wang
@ 2020-01-23 3:45 ` Ruifeng Wang
2020-01-23 13:38 ` [dpdk-dev] [PATCH v3 0/5] armv8 crypto PMD update Akhil Goyal
5 siblings, 0 replies; 20+ messages in thread
From: Ruifeng Wang @ 2020-01-23 3:45 UTC (permalink / raw)
To: akhil.goyal, gavin.hu
Cc: dev, jerinj, honnappa.nagarahalli, nd, Ruifeng Wang, stable
1. Clang requires braces around initialization of subobject.
2. Clang complains implicit conversion of enumeration type.
Trapped issue with Clang version 8.0 and CONFIG_RTE_LIBRTE_PMD_ARMV8_CRYPTO
was set.
Error messages:
rte_armv8_pmd.c:144:2: error: suggest braces around initialization of
subobject [-Werror,-Wmissing-braces]
NULL
^~~~
{ }
/usr/lib/llvm-8/lib/clang/8.0.0/include/stddef.h:105:16: note: expanded
from macro 'NULL'
^~~~~~~~~~
rte_armv8_pmd.c:429:21: error: implicit conversion from enumeration
type 'enum rte_crypto_cipher_operation' to different enumeration type
'enum armv8_crypto_cipher_operation' [-Werror,-Wenum-conversion]
cop = sess->cipher.direction;
~ ~~~~~~~~~~~~~^~~~~~~~~
Fixes: 169ca3db550c ("crypto/armv8: add PMD optimized for ARMv8 processors")
Cc: stable@dpdk.org
Signed-off-by: Ruifeng Wang <ruifeng.wang@arm.com>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Reviewed-by: Gavin Hu <gavin.hu@arm.com>
---
drivers/crypto/armv8/rte_armv8_pmd.c | 15 ++++++++++++---
1 file changed, 12 insertions(+), 3 deletions(-)
diff --git a/drivers/crypto/armv8/rte_armv8_pmd.c b/drivers/crypto/armv8/rte_armv8_pmd.c
index fd8140896..d2b7ab5e0 100644
--- a/drivers/crypto/armv8/rte_armv8_pmd.c
+++ b/drivers/crypto/armv8/rte_armv8_pmd.c
@@ -86,12 +86,12 @@ crypto_op_ca_encrypt = {
static const crypto_func_tbl_t
crypto_op_ca_decrypt = {
- NULL
+ { {NULL} }
};
static const crypto_func_tbl_t
crypto_op_ac_encrypt = {
- NULL
+ { {NULL} }
};
static const crypto_func_tbl_t
@@ -377,7 +377,16 @@ armv8_crypto_set_session_chained_parameters(struct armv8_crypto_session *sess,
/* Select cipher key */
sess->cipher.key.length = cipher_xform->cipher.key.length;
/* Set cipher direction */
- cop = sess->cipher.direction;
+ switch (sess->cipher.direction) {
+ case RTE_CRYPTO_CIPHER_OP_ENCRYPT:
+ cop = ARMV8_CRYPTO_CIPHER_OP_ENCRYPT;
+ break;
+ case RTE_CRYPTO_CIPHER_OP_DECRYPT:
+ cop = ARMV8_CRYPTO_CIPHER_OP_DECRYPT;
+ break;
+ default:
+ return -ENOTSUP;
+ }
/* Set cipher algorithm */
calg = cipher_xform->cipher.algo;
--
2.17.1
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [dpdk-dev] [PATCH v3 0/5] armv8 crypto PMD update
2020-01-23 3:45 ` [dpdk-dev] [PATCH v3 0/5] " Ruifeng Wang
` (4 preceding siblings ...)
2020-01-23 3:45 ` [dpdk-dev] [PATCH v3 5/5] crypto/armv8: fix clang build Ruifeng Wang
@ 2020-01-23 13:38 ` Akhil Goyal
5 siblings, 0 replies; 20+ messages in thread
From: Akhil Goyal @ 2020-01-23 13:38 UTC (permalink / raw)
To: Ruifeng Wang, gavin.hu; +Cc: dev, jerinj, honnappa.nagarahalli, nd
>
> Maintainance of armv8_crypto library created by Marvell/Cavium will
> be discontinued. Going forward, Armv8 crypto PMD will link to AArch64
> crypto library hosted by Arm.
>
> Patch 1/5, 3/5 update source code and document respectively to reflect
> the change.
> Patch 2/5 adds meson build support for this PMD.
> Patch 5/5 fixs Clang build issue when Armv8 crypto PMD is enabled.
>
>
> v3:
> Include meson build support patch.
> Add release notes.
>
> v2:
> Convert to formal patches from RFC.
> API and public structure renaming.
>
> Dharmik Thakkar (1):
> crypto/armv8: enable meson build
>
> Ruifeng Wang (4):
> crypto/armv8: link PMD to crypto library hosted by Arm
> doc: update link to the crypto library for armv8 PMD
> doc: update release notes for armv8 crypto PMD
> crypto/armv8: fix clang build
>
> doc/guides/cryptodevs/armv8.rst | 7 ++-
> doc/guides/rel_notes/release_20_02.rst | 5 +++
> drivers/crypto/armv8/Makefile | 3 +-
> drivers/crypto/armv8/armv8_pmd_private.h | 4 +-
> drivers/crypto/armv8/meson.build | 25 +++++++++++
> drivers/crypto/armv8/rte_armv8_pmd.c | 55 ++++++++++++++++--------
> drivers/crypto/armv8/rte_armv8_pmd_ops.c | 2 -
> drivers/crypto/meson.build | 1 +
> meson_options.txt | 2 +
> mk/rte.app.mk | 2 +-
> 10 files changed, 77 insertions(+), 29 deletions(-)
> create mode 100644 drivers/crypto/armv8/meson.build
>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
Applied to dpdk-next-crypto
Squashed the doc patches to 1/5. As per current protocol no separate patches for doc.
Thanks.
^ permalink raw reply [flat|nested] 20+ messages in thread
end of thread, other threads:[~2020-01-23 13:38 UTC | newest]
Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-10 8:28 [dpdk-dev] [RFC PATCH 0/3] armv8 crypto PMD update Ruifeng Wang
2019-12-10 8:28 ` [dpdk-dev] [RFC PATCH 1/3] crypto/armv8: link PMD to crypto library hosted by Arm Ruifeng Wang
2019-12-10 8:28 ` [dpdk-dev] [RFC PATCH 2/3] doc: update link to the crypto library for armv8 PMD Ruifeng Wang
2019-12-10 10:07 ` Jerin Jacob
2019-12-10 8:28 ` [dpdk-dev] [RFC PATCH 3/3] crypto/armv8: fix clang build Ruifeng Wang
2020-01-17 12:11 ` [dpdk-dev] [RFC PATCH 0/3] armv8 crypto PMD update Akhil Goyal
2020-01-17 14:28 ` Ruifeng Wang
2020-01-19 7:40 ` [dpdk-dev] [PATCH v2 " Ruifeng Wang
2020-01-19 7:40 ` [dpdk-dev] [PATCH v2 1/3] crypto/armv8: link PMD to crypto library hosted by Arm Ruifeng Wang
2020-01-19 7:40 ` [dpdk-dev] [PATCH v2 2/3] doc: update link to the crypto library for armv8 PMD Ruifeng Wang
2020-01-19 7:40 ` [dpdk-dev] [PATCH v2 3/3] crypto/armv8: fix clang build Ruifeng Wang
2020-01-21 7:09 ` [dpdk-dev] [PATCH v2 0/3] armv8 crypto PMD update Akhil Goyal
2020-01-21 9:49 ` Ruifeng Wang
2020-01-23 3:45 ` [dpdk-dev] [PATCH v3 0/5] " Ruifeng Wang
2020-01-23 3:45 ` [dpdk-dev] [PATCH v3 1/5] crypto/armv8: link PMD to crypto library hosted by Arm Ruifeng Wang
2020-01-23 3:45 ` [dpdk-dev] [PATCH v3 2/5] crypto/armv8: enable meson build Ruifeng Wang
2020-01-23 3:45 ` [dpdk-dev] [PATCH v3 3/5] doc: update link to the crypto library for armv8 PMD Ruifeng Wang
2020-01-23 3:45 ` [dpdk-dev] [PATCH v3 4/5] doc: update release notes for armv8 crypto PMD Ruifeng Wang
2020-01-23 3:45 ` [dpdk-dev] [PATCH v3 5/5] crypto/armv8: fix clang build Ruifeng Wang
2020-01-23 13:38 ` [dpdk-dev] [PATCH v3 0/5] armv8 crypto PMD update Akhil Goyal
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).