From fa80f2e421e7e85f429437aad2da9971a2a60a24 Mon Sep 17 00:00:00 2001 From: Sergio Gonzalez Monroy Date: Tue, 7 Mar 2017 14:39:29 +0000 Subject: dpdk: fix plugin linking with sw crypto libraries Change-Id: I3e3bf786ab3c7672ff2cc7acd221421072e3ac8b Signed-off-by: Sergio Gonzalez Monroy --- dpdk/Makefile | 45 ++++++++++++++++++++++++++------------------- src/plugins/dpdk.am | 7 ++++++- 2 files changed, 32 insertions(+), 20 deletions(-) diff --git a/dpdk/Makefile b/dpdk/Makefile index 8e187cc2..fc93f9c6 100644 --- a/dpdk/Makefile +++ b/dpdk/Makefile @@ -25,7 +25,7 @@ DPDK_MLX5_PMD ?= n B := $(DPDK_BUILD_DIR) I := $(DPDK_INSTALL_DIR) DPDK_VERSION ?= 17.02 -PKG_SUFFIX ?= vpp1 +PKG_SUFFIX ?= vpp2 DPDK_BASE_URL ?= http://fast.dpdk.org/rel DPDK_TARBALL := dpdk-$(DPDK_VERSION).tar.xz DPDK_TAR_URL := $(DPDK_BASE_URL)/$(DPDK_TARBALL) @@ -34,9 +34,9 @@ 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 := v0.44-gcm.2.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 +AESNIMB_LIB_SOURCE := $(B)/intel-ipsec-mb-0.44-gcm.2 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 @@ -87,8 +87,8 @@ 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_EXTRA_CFLAGS += -I$(I)/include +DPDK_EXTRA_LDFLAGS += -L$(I)/lib DPDK_MAKE_EXTRA_ARGS += AESNI_MULTI_BUFFER_LIB_PATH=$(AESNIMB_LIB_SOURCE) endif @@ -158,19 +158,27 @@ $(CURDIR)/$(DPDK_TARBALL): then cp $(DPDK_DOWNLOAD_DIR)/$(DPDK_TARBALL) $(CURDIR) ; \ else curl -o $(CURDIR)/$(DPDK_TARBALL) -LO $(DPDK_TAR_URL) ; \ fi -ifeq ($(DPDK_CRYPTO_SW_PMD),y) + @rm -f $(B)/.download.ok + +$(CURDIR)/$(AESNIMB_LIB_TARBALL): @if [ -e $(DPDK_DOWNLOAD_DIR)/$(AESNIMB_LIB_TARBALL) ] ; \ then cp $(DPDK_DOWNLOAD_DIR)/$(AESNIMB_LIB_TARBALL) $(CURDIR) ; \ - else curl -o $(CURDIR)/$(AESNIMB_LIB_TARBALL) -LO $(AESNIMB_LIB_TARBALL_URL) ; \ + else curl -o $@ -LO $(AESNIMB_LIB_TARBALL_URL) ; \ fi + +$(CURDIR)/$(ISA_L_CRYPTO_LIB_TARBALL): @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) ; \ + else curl -o $@ -LO $(ISA_L_CRYPTO_LIB_TARBALL_URL) ; \ fi + +DPDK_DOWNLOADS = $(CURDIR)/$(DPDK_TARBALL) +ifeq ($(DPDK_CRYPTO_SW_PMD),y) +DPDK_DOWNLOADS += $(CURDIR)/$(AESNIMB_LIB_TARBALL) +DPDK_DOWNLOADS += $(CURDIR)/$(ISA_L_CRYPTO_LIB_TARBALL) endif - @rm -f $(B)/.download.ok -$(B)/.download.ok: $(CURDIR)/$(DPDK_TARBALL) +$(B)/.download.ok: $(DPDK_DOWNLOADS) @mkdir -p $(B) @openssl md5 $< | cut -f 2 -d " " - > $(B)/$(DPDK_TARBALL).md5sum @([ "$$(<$(B)/$(DPDK_TARBALL).md5sum)" = "$(DPDK_$(DPDK_VERSION)_TARBALL_MD5_CKSUM)" ] || \ @@ -209,12 +217,6 @@ endif 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 $@ @@ -223,11 +225,16 @@ config: $(B)/.config.ok $(B)/.build.ok: $(DPDK_SOURCE_FILES) @if [ ! -e $(B)/.config.ok ] ; then echo 'Please run "make config" first' && false ; fi - @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/ + # Build IPsec_MB library + mkdir -p $(I)/lib/ + make -C $(AESNIMB_LIB_SOURCE) -j NO_GCM=y + cp $(AESNIMB_LIB_SOURCE)/libIPSec_MB.a $(I)/lib/ + # Build ISA-L Crypto library + cd $(ISA_L_CRYPTO_LIB_SOURCE) && ./autogen.sh && ./configure --prefix=$(I) + make -C $(ISA_L_CRYPTO_LIB_SOURCE) -j install endif + @make $(DPDK_MAKE_ARGS) install @touch $@ .PHONY: build diff --git a/src/plugins/dpdk.am b/src/plugins/dpdk.am index 01383de6..b857429d 100644 --- a/src/plugins/dpdk.am +++ b/src/plugins/dpdk.am @@ -14,7 +14,12 @@ vppapitestplugins_LTLIBRARIES += dpdk_test_plugin.la vppplugins_LTLIBRARIES += dpdk_plugin.la -dpdk_plugin_la_LDFLAGS = $(AM_LDFLAGS) -Wl,--whole-archive,-l:libdpdk.a,--no-whole-archive,-lm,-ldl +dpdk_plugin_la_LDFLAGS = $(AM_LDFLAGS) -Wl,--whole-archive,-l:libdpdk.a,--no-whole-archive +if WITH_DPDK_CRYPTO_SW +dpdk_plugin_la_LDFLAGS += -Wl,--exclude-libs,libIPSec_MB.a,-l:libIPSec_MB.a +dpdk_plugin_la_LDFLAGS += -Wl,--exclude-libs,libisal_crypto.a,-l:libisal_crypto.a +endif +dpdk_plugin_la_LDFLAGS += -Wl,-lm,-ldl dpdk_plugin_la_SOURCES = \ dpdk/main.c \ -- cgit 1.2.3-korg