From 2e3677bb2085d4992f74156bdff8fe050ac9de24 Mon Sep 17 00:00:00 2001 From: Radu Nicolau Date: Mon, 20 Feb 2017 12:27:02 +0000 Subject: cryptodev: Automatically download and build ISA-L Crypto library Change-Id: I5454053461e6fb98e7f58f9562efde3590bb7cb5 Signed-off-by: Radu Nicolau --- dpdk/Makefile | 21 ++++++++++++++++++++- src/Makefile.am | 2 +- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/dpdk/Makefile b/dpdk/Makefile index f8f1ca133e0..f8c85c967dc 100644 --- a/dpdk/Makefile +++ b/dpdk/Makefile @@ -33,11 +33,14 @@ DPDK_16.07_TARBALL_MD5_CKSUM := 690a2bb570103e58d12f9806e8bf21be DPDK_16.11_TARBALL_MD5_CKSUM := 06c1c577795360719d0b4fafaeee21e9 DPDK_17.02_TARBALL_MD5_CKSUM := 6b9f7387c35641f4e8dbba3e528f2376 DPDK_SOURCE := $(B)/dpdk-$(DPDK_VERSION) + ifeq ($(DPDK_CRYPTO_SW_PMD),y) AESNIMB_LIB_TARBALL := v0.44.tar.gz AESNIMB_LIB_TARBALL_URL := http://github.com/01org/intel-ipsec-mb/archive/$(AESNIMB_LIB_TARBALL) AESNIMB_LIB_SOURCE := $(B)/intel-ipsec-mb-0.44 -export AESNI_MULTI_BUFFER_LIB_PATH=$(AESNIMB_LIB_SOURCE) +ISA_L_CRYPTO_LIB_TARBALL := isa_l_crypto.tar.gz +ISA_L_CRYPTO_LIB_TARBALL_URL := http://github.com/01org/isa-l_crypto/archive/master.tar.gz +ISA_L_CRYPTO_LIB_SOURCE := $(B)/isa-l_crypto-master endif ifneq (,$(findstring clang,$(CC))) @@ -84,6 +87,12 @@ else DPDK_EXTRA_CFLAGS := -g -O0 endif +ifeq ($(DPDK_CRYPTO_SW_PMD),y) +DPDK_EXTRA_CFLAGS += -I$(ISA_L_CRYPTO_LIB_SOURCE) +DPDK_EXTRA_LDFLAGS += -L$(ISA_L_CRYPTO_LIB_SOURCE)/.libs +DPDK_MAKE_EXTRA_ARGS += AESNI_MULTI_BUFFER_LIB_PATH=$(AESNIMB_LIB_SOURCE) +endif + # assemble DPDK make arguments DPDK_MAKE_ARGS := -C $(DPDK_SOURCE) -j $(JOBS) \ T=$(DPDK_TARGET) \ @@ -155,6 +164,10 @@ ifeq ($(DPDK_CRYPTO_SW_PMD),y) then cp $(DPDK_DOWNLOAD_DIR)/$(AESNIMB_LIB_TARBALL) $(CURDIR) ; \ else curl -o $(CURDIR)/$(AESNIMB_LIB_TARBALL) -LO $(AESNIMB_LIB_TARBALL_URL) ; \ fi + @if [ -e $(DPDK_DOWNLOAD_DIR)/$(ISA_L_CRYPTO_LIB_TARBALL) ] ; \ + then cp $(DPDK_DOWNLOAD_DIR)/$(ISA_L_CRYPTO_LIB_TARBALL) $(CURDIR) ; \ + else curl -o $(CURDIR)/$(ISA_L_CRYPTO_LIB_TARBALL) -LO $(ISA_L_CRYPTO_LIB_TARBALL_URL) ; \ + fi endif @rm -f $(B)/.download.ok @@ -175,6 +188,8 @@ $(B)/.extract.ok: $(B)/.download.ok ifeq ($(DPDK_CRYPTO_SW_PMD),y) @echo --- extracting $(AESNIMB_LIB_TARBALL) --- @tar --directory $(B) --extract --file $(CURDIR)/$(AESNIMB_LIB_TARBALL) + @echo --- extracting $(ISA_L_CRYPTO_LIB_TARBALL) --- + @tar --directory $(B) --extract --file $(CURDIR)/$(ISA_L_CRYPTO_LIB_TARBALL) endif @touch $@ @@ -197,6 +212,9 @@ patch: $(B)/.patch.ok $(B)/.config.ok: $(B)/.patch.ok $(B)/custom-config ifeq ($(DPDK_CRYPTO_SW_PMD),y) @make -C $(AESNIMB_LIB_SOURCE) + @cd $(ISA_L_CRYPTO_LIB_SOURCE) && ./autogen.sh && ./configure + @make -C $(ISA_L_CRYPTO_LIB_SOURCE) + @cp $(ISA_L_CRYPTO_LIB_SOURCE)/include $(ISA_L_CRYPTO_LIB_SOURCE)/isa-l_crypto -r endif @make $(DPDK_MAKE_ARGS) config @touch $@ @@ -209,6 +227,7 @@ $(B)/.build.ok: $(DPDK_SOURCE_FILES) @make $(DPDK_MAKE_ARGS) install ifeq ($(DPDK_CRYPTO_SW_PMD),y) @cp $(AESNIMB_LIB_SOURCE)/libIPSec_MB.a $(I)/lib/ + @cp $(ISA_L_CRYPTO_LIB_SOURCE)/.libs/libisal_crypto.a $(I)/lib/ endif @touch $@ diff --git a/src/Makefile.am b/src/Makefile.am index a0e62dbdb5c..08feb29ae40 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -49,7 +49,7 @@ else DPDK_LD_FLAGS = -Wl,--whole-archive,-l:libdpdk.a,--no-whole-archive,-lm,-ldl endif if WITH_DPDK_CRYPTO_SW -DPDK_LD_ADD = -lIPSec_MB +DPDK_LD_ADD = -lIPSec_MB -lisal_crypto endif if WITH_DPDK_MLX5_PMD DPDK_LD_FLAGS += -libverbs -lmlx5 -lnuma -- cgit 1.2.3-korg