From e7b3b13ba930254ce07f84a57e578325e79fe5fa Mon Sep 17 00:00:00 2001 From: Akhil Goyal Date: Tue, 23 Oct 2018 13:47:06 +0000 Subject: [PATCH] drivers: fix build if security lib disabled RTE_SECURITY is enabled by default. If it is disabled, dpaa2_sec, dpaa_sec and caam_jr compilation fails. This patch fixes compilation by disabling these drivers when rte_security is not available. Fixes: 1ee9569576f6 ("config: enable dpaaX drivers for generic ARMv8") Fixes: 09e1e8d256b0 ("mk: fix dependencies of dpaaX drivers") Fixes: af7c9b5e9ce7 ("crypto/caam_jr: introduce basic driver") Cc: stable@dpdk.org Signed-off-by: Akhil Goyal --- drivers/crypto/Makefile | 8 +++++--- drivers/crypto/dpaa2_sec/Makefile | 7 ------- drivers/event/dpaa2/Makefile | 5 ++++- drivers/event/dpaa2/dpaa2_eventdev.c | 6 ++++++ mk/rte.app.mk | 3 +++ 5 files changed, 18 insertions(+), 11 deletions(-) diff --git a/drivers/crypto/Makefile b/drivers/crypto/Makefile index c25a19fb0a..009f8443da 100644 --- a/drivers/crypto/Makefile +++ b/drivers/crypto/Makefile @@ -6,7 +6,6 @@ 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_CAAM_JR) += caam_jr DIRS-$(CONFIG_RTE_LIBRTE_PMD_CCP) += ccp DIRS-$(CONFIG_RTE_LIBRTE_PMD_OCTEONTX_CRYPTO) += octeontx DIRS-$(CONFIG_RTE_LIBRTE_PMD_OPENSSL) += openssl @@ -16,12 +15,15 @@ DIRS-$(CONFIG_RTE_LIBRTE_PMD_KASUMI) += kasumi DIRS-$(CONFIG_RTE_LIBRTE_PMD_ZUC) += zuc DIRS-$(CONFIG_RTE_LIBRTE_PMD_MVSAM_CRYPTO) += mvsam DIRS-$(CONFIG_RTE_LIBRTE_PMD_NULL_CRYPTO) += null +ifeq ($(CONFIG_RTE_LIBRTE_SECURITY),y) ifeq ($(CONFIG_RTE_EAL_VFIO)$(CONFIG_RTE_LIBRTE_FSLMC_BUS),yy) DIRS-$(CONFIG_RTE_LIBRTE_PMD_DPAA2_SEC) += dpaa2_sec -endif +endif # CONFIG_RTE_LIBRTE_FSLMC_BUS ifeq ($(CONFIG_RTE_LIBRTE_DPAA_BUS),y) DIRS-$(CONFIG_RTE_LIBRTE_PMD_DPAA_SEC) += dpaa_sec -endif +DIRS-$(CONFIG_RTE_LIBRTE_PMD_CAAM_JR) += caam_jr +endif # CONFIG_RTE_LIBRTE_PMD_DPAA_SEC +endif # CONFIG_RTE_LIBRTE_SECURITY DIRS-$(CONFIG_RTE_LIBRTE_PMD_VIRTIO_CRYPTO) += virtio include $(RTE_SDK)/mk/rte.subdir.mk diff --git a/drivers/crypto/dpaa2_sec/Makefile b/drivers/crypto/dpaa2_sec/Makefile index 8b8dfd2abb..f537f76a6f 100644 --- a/drivers/crypto/dpaa2_sec/Makefile +++ b/drivers/crypto/dpaa2_sec/Makefile @@ -4,13 +4,6 @@ # include $(RTE_SDK)/mk/rte.vars.mk - -ifneq ($(MAKECMDGOALS),clean) -ifneq ($(CONFIG_RTE_LIBRTE_SECURITY),y) -$(error "RTE_LIBRTE_SECURITY is required to build RTE_LIBRTE_PMD_DPAA2_SEC") -endif -endif - # # library name # diff --git a/drivers/event/dpaa2/Makefile b/drivers/event/dpaa2/Makefile index 73e8fd8a74..e0134cc460 100644 --- a/drivers/event/dpaa2/Makefile +++ b/drivers/event/dpaa2/Makefile @@ -22,10 +22,13 @@ LDLIBS += -lrte_eal -lrte_eventdev LDLIBS += -lrte_bus_fslmc -lrte_mempool_dpaa2 -lrte_pmd_dpaa2 LDLIBS += -lrte_bus_vdev LDLIBS += -lrte_common_dpaax -LDLIBS += -lrte_pmd_dpaa2_sec CFLAGS += -I$(RTE_SDK)/drivers/net/dpaa2 CFLAGS += -I$(RTE_SDK)/drivers/net/dpaa2/mc + +ifeq ($(CONFIG_RTE_LIBRTE_SECURITY),y) +LDLIBS += -lrte_pmd_dpaa2_sec CFLAGS += -I$(RTE_SDK)/drivers/crypto/dpaa2_sec +endif # versioning export map EXPORT_MAP := rte_pmd_dpaa2_event_version.map diff --git a/drivers/event/dpaa2/dpaa2_eventdev.c b/drivers/event/dpaa2/dpaa2_eventdev.c index a89d1be5cf..8d168b0287 100644 --- a/drivers/event/dpaa2/dpaa2_eventdev.c +++ b/drivers/event/dpaa2/dpaa2_eventdev.c @@ -35,7 +35,9 @@ #include #include #include +#ifdef RTE_LIBRTE_SECURITY #include +#endif #include "dpaa2_eventdev.h" #include "dpaa2_eventdev_logs.h" #include @@ -795,6 +797,7 @@ dpaa2_eventdev_eth_stop(const struct rte_eventdev *dev, return 0; } +#ifdef RTE_LIBRTE_SECURITY static int dpaa2_eventdev_crypto_caps_get(const struct rte_eventdev *dev, const struct rte_cryptodev *cdev, @@ -937,6 +940,7 @@ dpaa2_eventdev_crypto_stop(const struct rte_eventdev *dev, return 0; } +#endif static struct rte_eventdev_ops dpaa2_eventdev_ops = { .dev_infos_get = dpaa2_eventdev_info_get, @@ -959,11 +963,13 @@ static struct rte_eventdev_ops dpaa2_eventdev_ops = { .eth_rx_adapter_queue_del = dpaa2_eventdev_eth_queue_del, .eth_rx_adapter_start = dpaa2_eventdev_eth_start, .eth_rx_adapter_stop = dpaa2_eventdev_eth_stop, +#ifdef RTE_LIBRTE_SECURITY .crypto_adapter_caps_get = dpaa2_eventdev_crypto_caps_get, .crypto_adapter_queue_pair_add = dpaa2_eventdev_crypto_queue_add, .crypto_adapter_queue_pair_del = dpaa2_eventdev_crypto_queue_del, .crypto_adapter_start = dpaa2_eventdev_crypto_start, .crypto_adapter_stop = dpaa2_eventdev_crypto_stop, +#endif }; static int diff --git a/mk/rte.app.mk b/mk/rte.app.mk index 3203cf0adc..c0036daf84 100644 --- a/mk/rte.app.mk +++ b/mk/rte.app.mk @@ -234,12 +234,15 @@ _LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_ARMV8_CRYPTO) += -L$(ARMV8_CRYPTO_LIB_PATH) - _LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_MVSAM_CRYPTO) += -L$(LIBMUSDK_PATH)/lib -lrte_pmd_mvsam_crypto -lmusdk _LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_OCTEONTX_CRYPTO) += -lrte_pmd_octeontx_crypto _LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_CRYPTO_SCHEDULER) += -lrte_pmd_crypto_scheduler +ifeq ($(CONFIG_RTE_LIBRTE_SECURITY),y) ifeq ($(CONFIG_RTE_EAL_VFIO)$(CONFIG_RTE_LIBRTE_FSLMC_BUS),yy) _LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_DPAA2_SEC) += -lrte_pmd_dpaa2_sec endif # CONFIG_RTE_LIBRTE_FSLMC_BUS ifeq ($(CONFIG_RTE_LIBRTE_DPAA_BUS),y) _LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_DPAA_SEC) += -lrte_pmd_dpaa_sec +_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_CAAM_JR) += -lrte_pmd_caam_jr endif # CONFIG_RTE_LIBRTE_DPAA_BUS +endif # CONFIG_RTE_LIBRTE_SECURITY _LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_VIRTIO_CRYPTO) += -lrte_pmd_virtio_crypto endif # CONFIG_RTE_LIBRTE_CRYPTODEV -- 2.20.1