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: Alexey Marchuk <alexeymar@nvidia.com>
Change-Id: I9cf6b754fb3888e21c05aa20bade21cf90d5d090
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/14857
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Krzysztof Karas <krzysztof.karas@intel.com>
Reviewed-by: <qun.wan@intel.com>
Reviewed-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
This commit is contained in:
Alexey Marchuk 2022-10-04 21:14:10 +02:00 committed by Tomasz Zawadzki
parent e58885f949
commit 784b9d4874
8 changed files with 96 additions and 4 deletions

3
.gitmodules vendored
View File

@ -16,3 +16,6 @@
[submodule "xnvme"] [submodule "xnvme"]
path = xnvme path = xnvme
url = https://github.com/OpenMPDK/xNVMe.git url = https://github.com/OpenMPDK/xNVMe.git
[submodule "isa-l-crypto"]
path = isa-l-crypto
url = https://github.com/intel/isa-l_crypto

View File

@ -2,6 +2,10 @@
## v23.01: (Upcoming Release) ## v23.01: (Upcoming Release)
### accel
New library isa-l-crypto has been added, it is used by accel library in crypto operations.
### bdev ### bdev
Both of interleaved and separated metadata are now supported by the malloc bdev module. Both of interleaved and separated metadata are now supported by the malloc bdev module.

5
CONFIG
View File

@ -1,7 +1,7 @@
# SPDX-License-Identifier: BSD-3-Clause # SPDX-License-Identifier: BSD-3-Clause
# Copyright (C) 2015 Intel Corporation. # Copyright (C) 2015 Intel Corporation.
# All rights reserved. # 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__ # configure options: __CONFIGURE_OPTIONS__
@ -161,6 +161,9 @@ CONFIG_CUSTOMOCF=n
# Build ISA-L library # Build ISA-L library
CONFIG_ISAL=y CONFIG_ISAL=y
# Build ISA-L-crypto library
CONFIG_ISAL_CRYPTO=y
# Build with IO_URING support # Build with IO_URING support
CONFIG_URING=n CONFIG_URING=n

View File

@ -1,6 +1,7 @@
# SPDX-License-Identifier: BSD-3-Clause # SPDX-License-Identifier: BSD-3-Clause
# Copyright (C) 2015 Intel Corporation. # Copyright (C) 2015 Intel Corporation.
# Copyright (c) 2020, Mellanox Corporation. # Copyright (c) 2020, Mellanox Corporation.
# Copyright (c) 2022 NVIDIA CORPORATION & AFFILIATES
# All rights reserved. # All rights reserved.
# #
@ -18,6 +19,7 @@ DIRS-$(CONFIG_APPS) += app
DIRS-y += test DIRS-y += test
DIRS-$(CONFIG_IPSEC_MB) += ipsecbuild DIRS-$(CONFIG_IPSEC_MB) += ipsecbuild
DIRS-$(CONFIG_ISAL) += isalbuild DIRS-$(CONFIG_ISAL) += isalbuild
DIRS-$(CONFIG_ISAL_CRYPTO) += isalcryptobuild
DIRS-$(CONFIG_VFIO_USER) += vfiouserbuild DIRS-$(CONFIG_VFIO_USER) += vfiouserbuild
DIRS-$(CONFIG_SMA) += proto DIRS-$(CONFIG_SMA) += proto
DIRS-$(CONFIG_XNVME) += xnvmebuild DIRS-$(CONFIG_XNVME) += xnvmebuild
@ -62,6 +64,10 @@ ifeq ($(CONFIG_ISAL),y)
ISALBUILD = isalbuild ISALBUILD = isalbuild
LIB += isalbuild LIB += isalbuild
DPDK_DEPS += isalbuild DPDK_DEPS += isalbuild
ifeq ($(CONFIG_ISAL_CRYPTO),y)
ISALCRYPTOBUILD = isalcryptobuild
LIB += isalcryptobuild
endif
endif endif
ifeq ($(CONFIG_VFIO_USER),y) ifeq ($(CONFIG_VFIO_USER),y)
@ -90,7 +96,7 @@ dpdkdeps $(DPDK_DEPS): $(WPDK)
dpdkbuild: $(WPDK) $(DPDK_DEPS) dpdkbuild: $(WPDK) $(DPDK_DEPS)
endif endif
lib: $(WPDK) $(DPDKBUILD) $(VFIOUSERBUILD) $(XNVMEBUILD) $(ISALBUILD) lib: $(WPDK) $(DPDKBUILD) $(VFIOUSERBUILD) $(XNVMEBUILD) $(ISALBUILD) $(ISALCRYPTOBUILD)
module: lib module: lib
shared_lib: module shared_lib: module
app: $(LIB) app: $(LIB)

41
configure vendored
View File

@ -56,8 +56,8 @@ function usage() {
echo " Implies --without-dpdk." echo " Implies --without-dpdk."
echo " --with-idxd Build the IDXD library and accel framework plug-in module." 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 " --without-idxd Disabled while experimental. Only built for x86 when enabled."
echo " --with-crypto Build vbdev crypto module." echo " --with-crypto Build isa-l-crypto and vbdev crypto module. No path required."
echo " --without-crypto No path required." echo " --without-crypto Disable isa-l-crypto and vbdev crypto module."
echo " --with-fio[=DIR] Build fio_plugin." echo " --with-fio[=DIR] Build fio_plugin."
echo " --without-fio default: /usr/src/fio" echo " --without-fio default: /usr/src/fio"
echo " --with-xnvme Build xNVMe bdev module." 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." echo "WARNING: ISA-L & DPDK crypto cannot be used as nasm ver must be 2.14 or newer."
fi fi
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 else
# for PPC # for PPC
CONFIG[ISAL]=n CONFIG[ISAL]=n
@ -1163,6 +1175,31 @@ else
CONFIG[VBDEV_COMPRESS]=n CONFIG[VBDEV_COMPRESS]=n
fi 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 [[ "${CONFIG[SMA]}" = "y" ]]; then
if ! python3 -c 'import grpc; import grpc_tools' 2> /dev/null; then if ! python3 -c 'import grpc; import grpc_tools' 2> /dev/null; then
echo "--with-sma requires grpcio and grpcio-tools python packages." echo "--with-sma requires grpcio and grpcio-tools python packages."

1
isa-l-crypto Submodule

@ -0,0 +1 @@
Subproject commit 08297dc3e76d65e1bad83a9c9f9e49059cf806b5

32
isalcryptobuild/Makefile Normal file
View File

@ -0,0 +1,32 @@
# SPDX-License-Identifier: BSD-3-Clause
# Copyright (c) Intel Corporation.
# Copyright (c) 2022 NVIDIA CORPORATION & AFFILIATES.
# All rights reserved.
#
SPDK_ROOT_DIR := $(abspath $(CURDIR)/..)
include $(SPDK_ROOT_DIR)/mk/spdk.common.mk
.PHONY: all clean install
ifneq ($(Q),)
REDIRECT=> /dev/null
endif
# Force-disable scan-build
SUB_CC = $(patsubst %ccc-analyzer,$(DEFAULT_CC),$(CC))
$(ISAL_CRYPTO_DIR)/isa-l-crypto:
@ln -s $(ISAL_CRYPTO_DIR)/include $(ISAL_CRYPTO_DIR)/isa-l-crypto
all: $(ISAL_CRYPTO_DIR)/isa-l-crypto
$(Q)$(MAKE) -C $(SPDK_ROOT_DIR)/isa-l-crypto all CC="$(SUB_CC)" $(REDIRECT)
install: all
uninstall:
@:
clean:
$(Q)$(MAKE) -C $(SPDK_ROOT_DIR)/isa-l-crypto clean $(REDIRECT)
$(Q)rm -rf $(ISAL_CRYPTO_DIR)/isa-l-crypto

View File

@ -2,6 +2,7 @@
# Copyright (C) 2015 Intel Corporation. # Copyright (C) 2015 Intel Corporation.
# Copyright (c) 2017, IBM Corporation. # Copyright (c) 2017, IBM Corporation.
# Copyright (c) 2019, 2021 Mellanox Corporation. # Copyright (c) 2019, 2021 Mellanox Corporation.
# Copyright (c) 2022 NVIDIA CORPORATION & AFFILIATES
# All rights reserved. # All rights reserved.
# #
@ -166,9 +167,14 @@ endif
IPSEC_MB_DIR=$(CONFIG_IPSEC_MB_DIR) IPSEC_MB_DIR=$(CONFIG_IPSEC_MB_DIR)
ISAL_DIR=$(SPDK_ROOT_DIR)/isa-l ISAL_DIR=$(SPDK_ROOT_DIR)/isa-l
ISAL_CRYPTO_DIR=$(SPDK_ROOT_DIR)/isa-l-crypto
ifeq ($(CONFIG_ISAL), y) ifeq ($(CONFIG_ISAL), y)
SYS_LIBS += -L$(ISAL_DIR)/.libs -lisal SYS_LIBS += -L$(ISAL_DIR)/.libs -lisal
COMMON_CFLAGS += -I$(ISAL_DIR)/.. COMMON_CFLAGS += -I$(ISAL_DIR)/..
ifeq ($(CONFIG_ISAL_CRYPTO), y)
SYS_LIBS += -L$(ISAL_CRYPTO_DIR)/.libs -lisal_crypto
COMMON_CFLAGS += -I$(ISAL_CRYPTO_DIR)/..
endif
endif endif
ifeq ($(CONFIG_VFIO_USER), y) ifeq ($(CONFIG_VFIO_USER), y)