Commit 13603217 authored by Zhangfei Gao's avatar Zhangfei Gao Committed by Tomasz Zawadzki
Browse files

accel/dpdk_cryptodev: Support uadk crypto pmd



Add support of UADK Crypto Poll Mode Driver to accel/dpdk_cryptodev.

Build:
./configure --with-dpdk-uadk --with-crypto
make

Run
./build/bin/spdk_tgt -m 0xf0 --wait-for-rpc

./scripts/rpc.py dpdk_cryptodev_scan_accel_module
./scripts/rpc.py dpdk_cryptodev_set_driver -d crypto_uadk
./scripts/rpc.py accel_assign_opc -o encrypt -m dpdk_cryptodev
./scripts/rpc.py accel_assign_opc -o decrypt -m dpdk_cryptodev
./scripts/rpc.py framework_start_init

Change-Id: I73b763bdcf16c172501a3c2e785450401e8d54b2
Signed-off-by: default avatarZhangfei Gao <zhangfei.gao@linaro.org>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/22979


Community-CI: Mellanox Build Bot
Reviewed-by: default avatarJim Harris <jim.harris@samsung.com>
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarMarcin Spiewak <marcin.spiewak@intel.com>
Reviewed-by: default avatarAleksey Marchuk <alexeymar@nvidia.com>
parent dafdb289
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -144,6 +144,9 @@ CONFIG_VBDEV_COMPRESS_MLX5=n
# Enable mlx5_pci dpdk crypto PMD, enabled automatically if CONFIG_CRYPTO=y and libmlx5 exists
CONFIG_CRYPTO_MLX5=n

# Enable UADK dpdk crypto PMD
CONFIG_DPDK_UADK=n

# Requires libiscsi development libraries.
CONFIG_ISCSI_INITIATOR=n

+16 −0
Original line number Diff line number Diff line
@@ -107,6 +107,8 @@ function usage() {
	echo " --without-uring           If an argument is provided, it is considered a directory containing"
	echo "                           liburing.a and io_uring.h. Otherwise the regular system paths will"
	echo "                           be searched."
	echo " --with-dpdk-uadk          Build uadk DPDK module. No path required."
	echo " --without-dpdk-uadk       Disable uadk DPDK module."
	echo " --without-uring-zns       Build I/O uring module without ZNS (zoned namespaces) support."
	echo " --with-openssl[=DIR]      Build OPENSSL with custom path. Otherwise the regular system paths will"
	echo "                           be searched."
@@ -517,6 +519,12 @@ for i in "$@"; do
		--without-crypto)
			CONFIG[CRYPTO]=n
			;;
		--with-dpdk-uadk)
			CONFIG[DPDK_UADK]=y
			;;
		--without-dpdk-uadk)
			CONFIG[DPDK_UADK]=n
			;;
		--with-vhost)
			CONFIG[VHOST]=y
			;;
@@ -1054,6 +1062,14 @@ if [[ "${CONFIG[UBLK]}" = "y" ]]; then
	fi
fi

if [[ "${CONFIG[DPDK_UADK]}" = "y" ]]; then
	if ! pkg-config --exists libwd; then
		echo "--with-dpdk-uadk requires uadk library."
		echo "Please install then re-run this script."
		exit 1
	fi
fi

if [[ "${CONFIG[ISCSI_INITIATOR]}" = "y" ]]; then
	# Fedora installs libiscsi to /usr/lib64/iscsi for some reason.
	if ! echo -e '#include <iscsi/iscsi.h>\n#include <iscsi/scsi-lowlevel.h>\n' \
+1 −0
Original line number Diff line number Diff line
@@ -150,6 +150,7 @@ The following ciphers and PMDs are supported:
  (Note: QAT is functional however is marked as experimental until the hardware has
  been fully integrated with the SPDK CI system.)
- MLX5 Crypto Poll Mode Driver: RTE_CRYPTO_CIPHER_AES256_XTS, RTE_CRYPTO_CIPHER_AES512_XTS
- UADK Crypto Poll Mode Driver: RTE_CRYPTO_CIPHER_AES256_XTS, RTE_CRYPTO_CIPHER_AES512_XTS

To enable this module, use [`dpdk_cryptodev_scan_accel_module`](https://spdk.io/doc/jsonrpc.html),
this RPC is available in STARTUP state and the SPDK application needs to be run with `--wait-for-rpc`
+4 −0
Original line number Diff line number Diff line
@@ -74,6 +74,10 @@ ifeq ($(findstring y,$(CONFIG_CRYPTO_MLX5)$(CONFIG_VBDEV_COMPRESS_MLX5)),y)
DPDK_DRIVERS += common/mlx5 bus/auxiliary
endif

# uadk drivers
ifeq ($(findstring y,$(CONFIG_DPDK_UADK)),y)
DPDK_DRIVERS += crypto/uadk
endif
ifeq ($(CONFIG_CRYPTO),y)
DPDK_DRIVERS += crypto
# aesni_mb is name of the PMD in DPDK 21.08 and earlier
+6 −0
Original line number Diff line number Diff line
@@ -78,6 +78,12 @@ ifneq (, $(wildcard $(DPDK_LIB_DIR)/librte_crypto_mlx5.*))
DPDK_LIB_LIST += rte_crypto_mlx5
endif
endif

ifeq ($(CONFIG_DPDK_UADK),y)
ifneq (, $(wildcard $(DPDK_LIB_DIR)/librte_crypto_uadk.*))
DPDK_LIB_LIST += rte_crypto_uadk
endif
endif
endif

ifeq ($(findstring y,$(CONFIG_DPDK_COMPRESSDEV)$(CONFIG_VBDEV_COMPRESS)),y)
Loading