Commit 784b9d48 authored by Alexey Marchuk's avatar Alexey Marchuk Committed by Tomasz Zawadzki
Browse files

isa-l_crypto: Add submodule



Add a new config option CONFIG_ISAL_CRYPTO which
is set if both isa-l and isa-l-crypto are enabled.
This config option will be used in next patch to
enable SW crypto operations in accel fw

Signed-off-by: default avatarAlexey Marchuk <alexeymar@nvidia.com>
Change-Id: I9cf6b754fb3888e21c05aa20bade21cf90d5d090
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/14857


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarTomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
Reviewed-by: default avatarPaul Luse <paul.e.luse@intel.com>
Reviewed-by: default avatarKrzysztof Karas <krzysztof.karas@intel.com>
Reviewed-by: default avatar <qun.wan@intel.com>
Reviewed-by: default avatarShuhei Matsumoto <smatsumoto@nvidia.com>
parent e58885f9
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -16,3 +16,6 @@
[submodule "xnvme"]
	path = xnvme
	url = https://github.com/OpenMPDK/xNVMe.git
[submodule "isa-l-crypto"]
	path = isa-l-crypto
	url = https://github.com/intel/isa-l_crypto
+4 −0
Original line number Diff line number Diff line
@@ -2,6 +2,10 @@

## v23.01: (Upcoming Release)

### accel

New library isa-l-crypto has been added, it is used by accel library in crypto operations.

### bdev

Both of interleaved and separated metadata are now supported by the malloc bdev module.
+4 −1
Original line number Diff line number Diff line
#  SPDX-License-Identifier: BSD-3-Clause
#  Copyright (C) 2015 Intel Corporation.
#  All rights reserved.
#  Copyright (c) 2021 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
#  Copyright (c) 2021, 2022 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
#

# configure options: __CONFIGURE_OPTIONS__
@@ -161,6 +161,9 @@ CONFIG_CUSTOMOCF=n
# Build ISA-L library
CONFIG_ISAL=y

# Build ISA-L-crypto library
CONFIG_ISAL_CRYPTO=y

# Build with IO_URING support
CONFIG_URING=n

+7 −1
Original line number Diff line number Diff line
#  SPDX-License-Identifier: BSD-3-Clause
#  Copyright (C) 2015 Intel Corporation.
#  Copyright (c) 2020, Mellanox Corporation.
#  Copyright (c) 2022 NVIDIA CORPORATION & AFFILIATES
#  All rights reserved.
#

@@ -18,6 +19,7 @@ DIRS-$(CONFIG_APPS) += app
DIRS-y += test
DIRS-$(CONFIG_IPSEC_MB) += ipsecbuild
DIRS-$(CONFIG_ISAL) += isalbuild
DIRS-$(CONFIG_ISAL_CRYPTO) += isalcryptobuild
DIRS-$(CONFIG_VFIO_USER) += vfiouserbuild
DIRS-$(CONFIG_SMA) += proto
DIRS-$(CONFIG_XNVME) += xnvmebuild
@@ -62,6 +64,10 @@ ifeq ($(CONFIG_ISAL),y)
ISALBUILD = isalbuild
LIB += isalbuild
DPDK_DEPS += isalbuild
ifeq ($(CONFIG_ISAL_CRYPTO),y)
ISALCRYPTOBUILD = isalcryptobuild
LIB += isalcryptobuild
endif
endif

ifeq ($(CONFIG_VFIO_USER),y)
@@ -90,7 +96,7 @@ dpdkdeps $(DPDK_DEPS): $(WPDK)
dpdkbuild: $(WPDK) $(DPDK_DEPS)
endif

lib: $(WPDK) $(DPDKBUILD) $(VFIOUSERBUILD) $(XNVMEBUILD) $(ISALBUILD)
lib: $(WPDK) $(DPDKBUILD) $(VFIOUSERBUILD) $(XNVMEBUILD) $(ISALBUILD) $(ISALCRYPTOBUILD)
module: lib
shared_lib: module
app: $(LIB)
+39 −2
Original line number Diff line number Diff line
@@ -56,8 +56,8 @@ function usage() {
	echo "                           Implies --without-dpdk."
	echo " --with-idxd               Build the IDXD library and accel framework plug-in module."
	echo " --without-idxd            Disabled while experimental. Only built for x86 when enabled."
	echo " --with-crypto             Build vbdev crypto module."
	echo " --without-crypto          No path required."
	echo " --with-crypto             Build isa-l-crypto and vbdev crypto module. No path required."
	echo " --without-crypto          Disable isa-l-crypto and vbdev crypto module."
	echo " --with-fio[=DIR]          Build fio_plugin."
	echo " --without-fio             default: /usr/src/fio"
	echo " --with-xnvme              Build xNVMe bdev module."
@@ -1136,6 +1136,18 @@ if [[ $arch == x86_64* ]] || [[ $arch == aarch64* ]]; then
			echo "WARNING: ISA-L & DPDK crypto cannot be used as nasm ver must be 2.14 or newer."
		fi
	fi
	# check gas version on aarch64
	if [[ $arch == aarch64* ]]; then
		ver=$(as --version 2> /dev/null | awk 'NR==1{print $7}')
		if lt "$ver" 2.24; then
			# ISA-L, compression & crypto require gas version 2.24 or newer.
			CONFIG[ISAL]=n
			echo "Notice: ISA-L, compression & crypto require GAS version 2.24 or newer. Turning off default ISA-L and crypto features."
		elif lt "$ver" 2.34; then
			#For gas v2.24~v2.34, sve2 instructions are not supported. To workaround it, sve2 optimization should be disabled
			ISAL_CRYPTO_OPTS+=("--disable-sve2")
		fi
	fi
else
	# for PPC
	CONFIG[ISAL]=n
@@ -1163,6 +1175,31 @@ else
	CONFIG[VBDEV_COMPRESS]=n
fi

# ISA-L-crypto complements ISA-L functionality, it is only enabled together with ISA-L
if [[ "${CONFIG[ISAL]}" = "y" ]]; then
	if [ ! -f "$rootdir"/isa-l-crypto/autogen.sh ]; then
		echo "ISA-L-crypto is required but was not found, please init the submodule with:"
		echo "  git submodule update --init"
		echo "and then re-run this script."
		exit 1
	fi

	cd $rootdir/isa-l-crypto
	ISAL_CRYPTO_LOG=$rootdir/isa-l-crypto/spdk-isal-crypto.log
	if [[ -n "${CONFIG[CROSS_PREFIX]}" ]]; then
		ISAL_CRYPTO_OPTS+=("--host=${CONFIG[CROSS_PREFIX]}")
	fi
	ISAL_CRYPTO_OPTS+=("--enable-shared=no")
	echo -n "Configuring ISA-L-crypto (logfile: $ISAL_CRYPTO_LOG)..."
	./autogen.sh &> $ISAL_CRYPTO_LOG
	./configure CFLAGS="-fPIC -g -O2" "${ISAL_CRYPTO_OPTS[@]}" >> $ISAL_CRYPTO_LOG 2>&1
	echo "done."
	cd $rootdir
	CONFIG[ISAL_CRYPTO]=y
else
	CONFIG[ISAL_CRYPTO]=n
fi

if [[ "${CONFIG[SMA]}" = "y" ]]; then
	if ! python3 -c 'import grpc; import grpc_tools' 2> /dev/null; then
		echo "--with-sma requires grpcio and grpcio-tools python packages."
Loading