From: Ruifeng Wang <ruifeng.wang@arm.com>
To: 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: [dpdk-dev] [PATCH v2 1/3] crypto/armv8: link PMD to crypto library hosted by Arm
Date: Sun, 19 Jan 2020 15:40:02 +0800 [thread overview]
Message-ID: <20200119074004.213861-2-ruifeng.wang@arm.com> (raw)
In-Reply-To: <20200119074004.213861-1-ruifeng.wang@arm.com>
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
next prev parent reply other threads:[~2020-01-19 7:40 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
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 ` Ruifeng Wang [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200119074004.213861-2-ruifeng.wang@arm.com \
--to=ruifeng.wang@arm.com \
--cc=akhil.goyal@nxp.com \
--cc=dev@dpdk.org \
--cc=gavin.hu@arm.com \
--cc=honnappa.nagarahalli@arm.com \
--cc=jerinj@marvell.com \
--cc=nd@arm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).