Skip to contentSkip to conversation

armv8 crypto PMD update

RFC PATCH Superseded Ruifeng Wang 3 participants 20 messages Dec 10, 2019 – Jan 23, 2020

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

cover 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 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(-)
Signature · 1 line
2.17.1
#1 lore raw

RFC PATCH 1/3 crypto/armv8: link PMD to crypto library hosted by Arm

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.

---
 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(-)
drivers/crypto/armv8/Makefile +1 -2
index 125283664..7f20a28d4 100644
@@ -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
drivers/crypto/armv8/armv8_pmd_private.h +3 -1
index 24040dda2..9caf9e13f 100644
@@ -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 *);
 
drivers/crypto/armv8/rte_armv8_pmd.c +24 -16
index 7dc83e69e..2b2c5a3bf 100644
@@ -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;
drivers/crypto/armv8/rte_armv8_pmd_ops.c +0 -2
index 57952bef5..4fd384d1a 100644
@@ -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
mk/rte.app.mk +1 -1
index 05ea034b9..ab47e4cee 100644
@@ -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
Signature · 1 line
2.17.1
#2 lore raw

RFC PATCH 2/3 doc: update link to the crypto library for armv8 PMD

In reply to Ruifeng Wang

Armv8 crypto PMD now uses crypto library hosted by Arm. Update doc with the crypto library link to reflect the change.

---
 doc/guides/cryptodevs/armv8.rst | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)
doc/guides/cryptodevs/armv8.rst +3 -4
index 1ab40096e..fee85354b 100644
@@ -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:
 
Signature · 1 line
2.17.1
Acked-by on v1 2/3
#3 lore raw

Re: [dpdk-dev] [RFC PATCH 2/3] doc: update link to the crypto library for armv8 PMD

Quoted 6 lines · Ruifeng Wang

Armv8 crypto PMD now uses crypto library hosted by Arm. Update doc with the crypto library link to reflect the change.

Quoted 27 lines
---
 doc/guides/cryptodevs/armv8.rst | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)
doc/guides/cryptodevs/armv8.rst +3 -5
index 1ab40096e..fee85354b 100644
@@ -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

#4 lore raw

RFC PATCH 3/3 crypto/armv8: fix clang build

In reply to Ruifeng Wang

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")
---
 drivers/crypto/armv8/rte_armv8_pmd.c | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)
drivers/crypto/armv8/rte_armv8_pmd.c +12 -3
index 2b2c5a3bf..f6997e2e9 100644
@@ -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;
 
Signature · 1 line
2.17.1
#5 lore raw
In reply to Ruifeng Wang

Hi Ruifeng,

Quoted 14 lines

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

Quoted 8 lines
 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

#6 lore raw
Quoted 30 lines

-----Original Message-----
From: Akhil Goyal <[email protected]>
Sent: Friday, January 17, 2020 20:12
To: Ruifeng Wang <[email protected]>; Gavin Hu <[email protected]>
Cc: [email protected]; [email protected]; Honnappa Nagarahalli <[email protected]>; nd <[email protected]>
Subject: RE: [dpdk-dev] [RFC PATCH 0/3] armv8 crypto PMD update

Hi Ruifeng,

Quoted 14 lines

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

Quoted 4 lines
 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 ++++++++++++++++-------
Quoted 9 lines

-

Quoted 4 lines
 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

Quoted 2 lines

Regards,
Akhil

#7 lore raw

v2 cover armv8 crypto PMD update

In reply to 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(-)
Signature · 1 line
2.17.1
#8 lore raw

PATCH v2 1/3 crypto/armv8: link PMD to crypto library hosted by Arm

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.

---
 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(-)
drivers/crypto/armv8/Makefile +1 -2
index 125283664..7f20a28d4 100644
@@ -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
drivers/crypto/armv8/armv8_pmd_private.h +3 -1
index 24040dda2..e08d0df78 100644
@@ -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 *);
 
drivers/crypto/armv8/rte_armv8_pmd.c +24 -16
index 7dc83e69e..fd8140896 100644
@@ -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;
drivers/crypto/armv8/rte_armv8_pmd_ops.c +0 -2
index 57952bef5..4fd384d1a 100644
@@ -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
mk/rte.app.mk +1 -1
index 05ea034b9..ab47e4cee 100644
@@ -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
Signature · 1 line
2.17.1
#9 lore raw

PATCH v2 2/3 doc: update link to the crypto library for armv8 PMD

In reply to Ruifeng Wang

Armv8 crypto PMD now uses crypto library hosted by Arm. Update doc with the crypto library link to reflect the change.

---
 doc/guides/cryptodevs/armv8.rst | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)
doc/guides/cryptodevs/armv8.rst +3 -4
index 1ab40096e..fee85354b 100644
@@ -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:
 
Signature · 1 line
2.17.1
#10 lore raw

PATCH v2 3/3 crypto/armv8: fix clang build

In reply to Ruifeng Wang

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")
---
 drivers/crypto/armv8/rte_armv8_pmd.c | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)
drivers/crypto/armv8/rte_armv8_pmd.c +12 -3
index fd8140896..d2b7ab5e0 100644
@@ -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;
 
Signature · 1 line
2.17.1
#11 lore raw
In reply to Ruifeng Wang

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

Quoted 36 lines

-----Original Message-----
From: Ruifeng Wang <[email protected]>
Sent: Sunday, January 19, 2020 1:10 PM
To: Akhil Goyal <[email protected]>; [email protected]
Cc: [email protected]; [email protected]; [email protected]; [email protected]; Ruifeng Wang <[email protected]>
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

#12 lore raw
Quoted 10 lines

-----Original Message-----
From: Akhil Goyal <[email protected]>
Sent: Tuesday, January 21, 2020 15:09
To: Ruifeng Wang <[email protected]>; Gavin Hu <[email protected]>
Cc: [email protected]; [email protected]; Honnappa Nagarahalli <[email protected]>; nd <[email protected]>
Subject: RE: [PATCH v2 0/3] armv8 crypto PMD update

Quoted 8 lines

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.

Quoted 3 lines

Please also update the release notes that the hosting for armv8 crypto has changed and the name has also changed.

OK.

Quoted 2 lines

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.

Quoted 41 lines

Regards,
Akhil

Quoted 26 lines

-----Original Message-----
From: Ruifeng Wang <[email protected]>
Sent: Sunday, January 19, 2020 1:10 PM
To: Akhil Goyal <[email protected]>; [email protected]
Cc: [email protected]; [email protected]; [email protected]; [email protected]; Ruifeng Wang <[email protected]>
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

Quoted 4 lines
 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 ++++++++++++++++-------

-

Quoted 6 lines
 drivers/crypto/armv8/rte_armv8_pmd_ops.c |  2 -
 mk/rte.app.mk                            |  2 +-
 6 files changed, 44 insertions(+), 29 deletions(-)

--
2.17.1

#13 lore raw

v3 cover armv8 crypto PMD update

In reply to 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
Signature · 1 line
2.17.1
#14 lore raw

PATCH v3 1/5 crypto/armv8: link PMD to crypto library hosted by Arm

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.

---
 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(-)
drivers/crypto/armv8/Makefile +1 -2
index 125283664..7f20a28d4 100644
@@ -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
drivers/crypto/armv8/armv8_pmd_private.h +3 -1
index 24040dda2..e08d0df78 100644
@@ -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 *);
 
drivers/crypto/armv8/rte_armv8_pmd.c +24 -16
index 7dc83e69e..fd8140896 100644
@@ -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;
drivers/crypto/armv8/rte_armv8_pmd_ops.c +0 -2
index 57952bef5..4fd384d1a 100644
@@ -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
mk/rte.app.mk +1 -1
index 15acf95db..fb391af57 100644
@@ -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
Signature · 1 line
2.17.1
#15 lore raw

PATCH v3 2/5 crypto/armv8: enable meson build

In reply to Ruifeng Wang

From: Dharmik Thakkar <[email protected]>

Add new meson.build file for crypto/armv8

---
 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
drivers/crypto/armv8/meson.build new file +25 -0
new file mode 100644
index 000000000..6ecb78b42
@@ -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
drivers/crypto/meson.build +1 -0
index 229debdfe..7fa1fbe26 100644
@@ -3,6 +3,7 @@
 
 drivers = ['aesni_gcm',
 	   'aesni_mb',
+	   'armv8',
 	   'caam_jr',
 	   'ccp',
 	   'dpaa_sec',
meson_options.txt +2 -0
index 53dfe13c3..20be15fe6 100644
@@ -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>',
Signature · 1 line
2.17.1
#16 lore raw

PATCH v3 3/5 doc: update link to the crypto library for armv8 PMD

In reply to Ruifeng Wang

Armv8 crypto PMD now uses crypto library hosted by Arm. Update doc with the crypto library link to reflect the change.

---
 doc/guides/cryptodevs/armv8.rst | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)
doc/guides/cryptodevs/armv8.rst +3 -4
index 1ab40096e..fee85354b 100644
@@ -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:
 
Signature · 1 line
2.17.1
#17 lore raw

PATCH v3 4/5 doc: update release notes for armv8 crypto PMD

In reply to Ruifeng Wang

Armv8 crypto PMD is changed to depend on external crypto library hosted by Arm. Library name also has change.

---
 doc/guides/rel_notes/release_20_02.rst | 5 +++++
 1 file changed, 5 insertions(+)
doc/guides/rel_notes/release_20_02.rst +5 -0
index 50e2c1484..b0484af1b 100644
@@ -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
 -------------
Signature · 1 line
2.17.1
#18 lore raw

PATCH v3 5/5 crypto/armv8: fix clang build

In reply to Ruifeng Wang

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")
---
 drivers/crypto/armv8/rte_armv8_pmd.c | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)
drivers/crypto/armv8/rte_armv8_pmd.c +12 -3
index fd8140896..d2b7ab5e0 100644
@@ -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;
 
Signature · 1 line
2.17.1
Acked-by on the v3 series Applied
#19 lore raw
In reply to Ruifeng Wang
Quoted 30 lines

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

Quoted 13 lines
 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

Applied to dpdk-next-crypto
Squashed the doc patches to 1/5. As per current protocol no separate patches for doc.

Thanks.