Commit 6118b853 authored by Daniel Verkamp's avatar Daniel Verkamp Committed by Changpeng Liu
Browse files

build: add intel-ipsec-mb submodule



This is a dependency of the DPDK crypto framework.

The submodule is currently set to our SPDK fork of the ipsec library
which is based off of the library v0.48 tag, as required by DPDK plus
one minor Makefile change on the 'spdk' branch of the fork.

Also added is a configure option '--with-crypto' and the associated
conditionals for building DPDK with or without the library dependency.

The crypto vbdev patch will use this same configure option to determine
DPDK opts as well as whether the crypto vbdev should be built or not.

Change-Id: Ib1cfd15b63b29acf3c2f7345d0d7edfd94716620
Signed-off-by: default avatarDaniel Verkamp <daniel.verkamp@intel.com>
Signed-off-by: default avatarpaul luse <paul.e.luse@intel.com>
Reviewed-on: https://review.gerrithub.io/404983


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarBen Walker <benjamin.walker@intel.com>
Reviewed-by: default avatarShuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: default avatarChangpeng Liu <changpeng.liu@intel.com>
parent 529f7f3b
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
[submodule "dpdk"]
	path = dpdk
	url = https://github.com/spdk/dpdk.git
[submodule "intel-ipsec-mb"]
	path = intel-ipsec-mb
	url = https://github.com/spdk/intel-ipsec-mb.git
+3 −0
Original line number Diff line number Diff line
@@ -30,6 +30,9 @@ against SPDK easier.
The static libraries are also still provided for users that prefer to link only the
minimal set of components required.

A new configure option was added `--with-crypto` that, when set, will build the crypto
vbdev as well as its dependencies.

### RPC

The `start_nbd_disk` RPC method now returns the path to the kernel NBD device node
+4 −1
Original line number Diff line number Diff line
@@ -101,3 +101,6 @@ CONFIG_ISCSI_INITIATOR?=n

# Build with raid
CONFIG_RAID?=n

# Enable the dependencies for building the crypto vbdev
CONFIG_CRYPTO?=n
+11 −0
Original line number Diff line number Diff line
@@ -31,6 +31,8 @@ function usage()
	echo "                           disable features and components."
	echo ""
	echo "Valid dependencies are listed below."
	echo " crypto                    Required to build vbdev crypto module."
	echo "                           No path required."
	echo " dpdk                      Optional.  Uses dpdk submodule in spdk tree if not specified."
	echo "                           example: /usr/share/dpdk/x86_64-default-linuxapp-gcc"
	echo " fio                       Required to build fio_plugin."
@@ -164,6 +166,12 @@ for i in "$@"; do
		--without-dpdk)
			CONFIG_DPDK_DIR=
			;;
		--with-crypto)
			CONFIG_CRYPTO=y
			;;
		--without-crypto)
			CONFIG_CRYPTO=n
			;;
		--with-vhost)
			CONFIG_VHOST=y
			;;
@@ -303,6 +311,9 @@ fi
if [ -n "$CONFIG_DPDK_DIR" ]; then
	echo "CONFIG_DPDK_DIR?=$CONFIG_DPDK_DIR" >> CONFIG.local
fi
if [ -n "$CONFIG_CRYPTO" ]; then
	echo "CONFIG_CRYPTO?=$CONFIG_CRYPTO" >> CONFIG.local
fi
if [ -n "$CONFIG_VHOST" ]; then
	echo "CONFIG_VHOST?=$CONFIG_VHOST" >> CONFIG.local
fi
+41 −5
Original line number Diff line number Diff line
@@ -36,6 +36,32 @@ include $(SPDK_ROOT_DIR)/mk/spdk.common.mk

.PHONY: all clean install

IPSEC_OPTS=SHARED=n
INTEL_IPSEC_MB_LIB=
CRYPTO_ENABLED=n

ifeq ($(CONFIG_CRYPTO),y)
ifeq ($(TARGET_MACHINE),x86_64)
ifneq ($(wildcard $(SPDK_ROOT_DIR)/intel-ipsec-mb/README),)
INTEL_IPSEC_MB_LIB=$(SPDK_ROOT_DIR)/intel-ipsec-mb/libIPSec_MB.a
IPSEC_MB_CFLAGS = -fPIC
CRYPTO_ENABLED = y
DPDK_OPTS += AESNI_MULTI_BUFFER_LIB_PATH=$(SPDK_ROOT_DIR)/intel-ipsec-mb
DPDK_OPTS += CONFIG_RTE_LIBRTE_PMD_AESNI_MB=y
DPDK_OPTS += CONFIG_RTE_LIBRTE_CRYPTODEV=y
DPDK_OPTS += CONFIG_RTE_LIBRTE_REORDER=y
DPDK_OPTS += CONFIG_RTE_LIBRTE_KVARGS=y
endif
endif
endif

ifeq ($(CRYPTO_ENABLED),n)
DPDK_OPTS += CONFIG_RTE_LIBRTE_PMD_AESNI_MB=n
DPDK_OPTS += CONFIG_RTE_LIBRTE_CRYPTODEV=n
DPDK_OPTS += CONFIG_RTE_LIBRTE_REORDER=n
DPDK_OPTS += CONFIG_RTE_LIBRTE_KVARGS=n
endif

ifeq ($(TARGET_MACHINE),aarch64)
DPDK_CONFIG := arm64-armv8a
else
@@ -54,14 +80,17 @@ endif

ifeq ($(CC_TYPE),clang)
DPDK_CONFIG := $(DPDK_CONFIG)-clang
IPSEC_CC := clang
else
DPDK_CONFIG := $(DPDK_CONFIG)-gcc
IPSEC_CC := gcc
endif

DPDK_CFLAGS = -fPIC

ifeq ($(CONFIG_DEBUG),y)
DPDK_CFLAGS += -O0 -g
IPSEC_OPTS += DEBUG=y
endif

ifeq ($(CONFIG_WERROR),y)
@@ -70,13 +99,20 @@ else
DPDK_CFLAGS += -Wno-error
endif

$(SPDK_ROOT_DIR)/dpdk/build:
	$(Q)$(MAKE) -C $(SPDK_ROOT_DIR)/dpdk config T=$(DPDK_CONFIG)
$(SPDK_ROOT_DIR)/dpdk/build: $(INTEL_IPSEC_MB_LIB)
	$(Q)$(MAKE) -C $(SPDK_ROOT_DIR)/dpdk config T=$(DPDK_CONFIG) $(DPDK_OPTS)

all: $(SPDK_ROOT_DIR)/dpdk/build
	$(Q)$(MAKE) -C $(SPDK_ROOT_DIR)/dpdk/build EXTRA_CFLAGS="$(DPDK_CFLAGS)" MAKEFLAGS="T=$(DPDK_CONFIG) -j$(NPROC)"
all: $(SPDK_ROOT_DIR)/dpdk/build $(INTEL_IPSEC_MB_LIB)
	$(Q)$(MAKE) -C $(SPDK_ROOT_DIR)/dpdk/build EXTRA_CFLAGS="$(DPDK_CFLAGS)" MAKEFLAGS="T=$(DPDK_CONFIG) -j$(NPROC)" $(DPDK_OPTS)

ifeq ($(CONFIG_CRYPTO),y)
$(SPDK_ROOT_DIR)/intel-ipsec-mb/libIPSec_MB.a:
	$(Q)$(MAKE) -C $(SPDK_ROOT_DIR)/intel-ipsec-mb EXTRA_CFLAGS="$(IPSEC_MB_CFLAGS)" $(IPSEC_OPTS) MAKEFLAGS="j$(NPROC)" CC=$(IPSEC_CC)
endif

clean:
	$(Q)rm -rf $(SPDK_ROOT_DIR)/dpdk/build
	$(Q)rm -rf $(SPDK_ROOT_DIR)/dpdk/build; \
	rm -rf $(SPDK_ROOT_DIR)/intel-ipsec-mb/obj/*; \
	rm -rf $(SPDK_ROOT_DIR)/intel-ipsec-mb/libIPSec_MB.a

install: all
Loading