From 0054d84f6ec8483f4f941b168c95522513b76eda Mon Sep 17 00:00:00 2001 From: Ravi Kumar Date: Mon, 19 Mar 2018 08:23:35 -0400 Subject: [PATCH] crypto/ccp: add AMD ccp skeleton PMD Added DPDK crypto PMD for AMD Cryptographic Co-Processors. This patch adds a basic skeleton for PMD. Signed-off-by: Ravi Kumar --- MAINTAINERS | 4 +++ config/common_base | 5 +++ devtools/test-build.sh | 2 ++ doc/guides/rel_notes/release_18_05.rst | 4 +++ drivers/crypto/Makefile | 1 + drivers/crypto/ccp/Makefile | 30 ++++++++++++++++++ drivers/crypto/ccp/rte_ccp_pmd.c | 36 ++++++++++++++++++++++ drivers/crypto/ccp/rte_pmd_ccp_version.map | 4 +++ mk/rte.app.mk | 2 +- 9 files changed, 87 insertions(+), 1 deletion(-) create mode 100644 drivers/crypto/ccp/Makefile create mode 100644 drivers/crypto/ccp/rte_ccp_pmd.c create mode 100644 drivers/crypto/ccp/rte_pmd_ccp_version.map diff --git a/MAINTAINERS b/MAINTAINERS index f14c6be74f..a04ab69426 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -687,6 +687,10 @@ M: Pablo de Lara T: git://dpdk.org/next/dpdk-next-crypto F: doc/guides/cryptodevs/features/default.ini +AMD CCP Crypto +M: Ravi Kumar +F: drivers/crypto/ccp/ + ARMv8 Crypto M: Jerin Jacob F: drivers/crypto/armv8/ diff --git a/config/common_base b/config/common_base index c2b0d91e0a..3212b2ddd8 100644 --- a/config/common_base +++ b/config/common_base @@ -540,6 +540,11 @@ CONFIG_RTE_LIBRTE_PMD_CRYPTO_SCHEDULER_DEBUG=n # CONFIG_RTE_LIBRTE_PMD_NULL_CRYPTO=y +# +# Compile PMD for AMD CCP crypto device +# +CONFIG_RTE_LIBRTE_PMD_CCP=n + # # Compile PMD for Marvell Crypto device # diff --git a/devtools/test-build.sh b/devtools/test-build.sh index d2b9480b6c..12d4ce677b 100755 --- a/devtools/test-build.sh +++ b/devtools/test-build.sh @@ -193,6 +193,8 @@ config () # test -z "$LIBSSO_ZUC_PATH" || \ sed -ri 's,(PMD_ZUC=)n,\1y,' $1/.config test "$DPDK_DEP_SSL" != y || \ + sed -ri 's,(PMD_CCP=)n,\1y,' $1/.config + test "$DPDK_DEP_SSL" != y || \ sed -ri 's,(PMD_OPENSSL=)n,\1y,' $1/.config test "$DPDK_DEP_SSL" != y || \ sed -ri 's,(PMD_QAT=)n,\1y,' $1/.config diff --git a/doc/guides/rel_notes/release_18_05.rst b/doc/guides/rel_notes/release_18_05.rst index 99a08a992f..e3a959dcce 100644 --- a/doc/guides/rel_notes/release_18_05.rst +++ b/doc/guides/rel_notes/release_18_05.rst @@ -96,6 +96,10 @@ New Features including session creation/deletion handling and translating virtio-crypto request into DPDK crypto operations. A sample application is also introduced. +* **Added AMD CCP Crypto PMD.** + + Added the new ``ccp`` crypto driver for AMD CCP devices. + * **Updated AESNI MB PMD.** The AESNI MB PMD has been updated with additional support for: diff --git a/drivers/crypto/Makefile b/drivers/crypto/Makefile index 26e503e911..d5e0974521 100644 --- a/drivers/crypto/Makefile +++ b/drivers/crypto/Makefile @@ -6,6 +6,7 @@ include $(RTE_SDK)/mk/rte.vars.mk DIRS-$(CONFIG_RTE_LIBRTE_PMD_AESNI_GCM) += aesni_gcm DIRS-$(CONFIG_RTE_LIBRTE_PMD_AESNI_MB) += aesni_mb DIRS-$(CONFIG_RTE_LIBRTE_PMD_ARMV8_CRYPTO) += armv8 +DIRS-$(CONFIG_RTE_LIBRTE_PMD_CCP) += ccp DIRS-$(CONFIG_RTE_LIBRTE_PMD_OPENSSL) += openssl DIRS-$(CONFIG_RTE_LIBRTE_PMD_QAT) += qat DIRS-$(CONFIG_RTE_LIBRTE_PMD_CRYPTO_SCHEDULER) += scheduler diff --git a/drivers/crypto/ccp/Makefile b/drivers/crypto/ccp/Makefile new file mode 100644 index 0000000000..70d9559e63 --- /dev/null +++ b/drivers/crypto/ccp/Makefile @@ -0,0 +1,30 @@ +# SPDX-License-Identifier: BSD-3-Clause +# Copyright(c) 2018 Advanced Micro Devices, Inc. All rights reserved. + +include $(RTE_SDK)/mk/rte.vars.mk + +# library name +LIB = librte_pmd_ccp.a + +# build flags +CFLAGS += -O3 +CFLAGS += -I$(SRCDIR) +CFLAGS += $(WERROR_FLAGS) + +# library version +LIBABIVER := 1 + +# external library include paths +LDLIBS += -lcrypto +LDLIBS += -lrte_eal -lrte_mbuf -lrte_mempool -lrte_ring +LDLIBS += -lrte_cryptodev +LDLIBS += -lrte_pci -lrte_bus_pci +LDLIBS += -lrte_bus_vdev + +# versioning export map +EXPORT_MAP := rte_pmd_ccp_version.map + +# library source files +SRCS-$(CONFIG_RTE_LIBRTE_PMD_CCP) += rte_ccp_pmd.c + +include $(RTE_SDK)/mk/rte.lib.mk diff --git a/drivers/crypto/ccp/rte_ccp_pmd.c b/drivers/crypto/ccp/rte_ccp_pmd.c new file mode 100644 index 0000000000..bc8c449df5 --- /dev/null +++ b/drivers/crypto/ccp/rte_ccp_pmd.c @@ -0,0 +1,36 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright(c) 2018 Advanced Micro Devices, Inc. All rights reserved. + */ + +#include +#include +#include + +uint8_t ccp_cryptodev_driver_id; + +/** Remove ccp pmd */ +static int +cryptodev_ccp_remove(struct rte_vdev_device *dev __rte_unused) +{ + return 0; +} + +/** Probe ccp pmd */ +static int +cryptodev_ccp_probe(struct rte_vdev_device *vdev __rte_unused) +{ + return 0; +} + +static struct rte_vdev_driver cryptodev_ccp_pmd_drv = { + .probe = cryptodev_ccp_probe, + .remove = cryptodev_ccp_remove +}; + +static struct cryptodev_driver ccp_crypto_drv; + +RTE_PMD_REGISTER_VDEV(CRYPTODEV_NAME_CCP_PMD, cryptodev_ccp_pmd_drv); +RTE_PMD_REGISTER_PARAM_STRING(CRYPTODEV_NAME_CCP_PMD, + "max_nb_queue_pairs= max_nb_sessions= socket_id="); +RTE_PMD_REGISTER_CRYPTO_DRIVER(ccp_crypto_drv, cryptodev_ccp_pmd_drv.driver, + ccp_cryptodev_driver_id); diff --git a/drivers/crypto/ccp/rte_pmd_ccp_version.map b/drivers/crypto/ccp/rte_pmd_ccp_version.map new file mode 100644 index 0000000000..9b9ab1a4cf --- /dev/null +++ b/drivers/crypto/ccp/rte_pmd_ccp_version.map @@ -0,0 +1,4 @@ +DPDK_18.05 { + + local: *; +}; diff --git a/mk/rte.app.mk b/mk/rte.app.mk index ad22bbb825..eb18e05bbb 100644 --- a/mk/rte.app.mk +++ b/mk/rte.app.mk @@ -206,6 +206,7 @@ _LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_AESNI_MB) += -lrte_pmd_aesni_mb _LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_AESNI_MB) += -lIPSec_MB _LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_AESNI_GCM) += -lrte_pmd_aesni_gcm _LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_AESNI_GCM) += -lIPSec_MB +_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_CCP) += -lrte_pmd_ccp -lcrypto _LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_OPENSSL) += -lrte_pmd_openssl -lcrypto _LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_NULL_CRYPTO) += -lrte_pmd_null_crypto _LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_QAT) += -lrte_pmd_qat -lcrypto @@ -225,7 +226,6 @@ endif # CONFIG_RTE_LIBRTE_FSLMC_BUS ifeq ($(CONFIG_RTE_LIBRTE_DPAA_BUS),y) _LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_DPAA_SEC) += -lrte_pmd_dpaa_sec endif # CONFIG_RTE_LIBRTE_DPAA_BUS - endif # CONFIG_RTE_LIBRTE_CRYPTODEV ifeq ($(CONFIG_RTE_LIBRTE_EVENTDEV),y) -- 2.20.1