Commit 18384adc authored by Alexey Marchuk's avatar Alexey Marchuk Committed by Konrad Sztyber
Browse files

test/acccel_mlx5: Add crypto test



Use DMA test application to verify accel_mlx5
crypto capabilities with memory domain

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


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarKonrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: default avatarTomasz Zawadzki <tomasz@tzawadzki.com>
parent 73d9fb28
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -382,6 +382,10 @@ if [ $SPDK_RUN_FUNCTIONAL_TEST -eq 1 ]; then
	if [[ $SPDK_TEST_FUZZER -eq 1 ]]; then
		run_test "llvm_fuzz" $rootdir/test/fuzz/llvm.sh
	fi

	if [[ $SPDK_TEST_ACCEL_MLX5 -eq 1 ]]; then
		run_test "accel_mlx5_crypto" $rootdir/test/accel/mlx5/accel_mlx5_crypto.sh
	fi
fi

trap - SIGINT SIGTERM EXIT
+78 −0
Original line number Diff line number Diff line
#!/usr/bin/env bash
#  SPDX-License-Identifier: BSD-3-Clause
#  Copyright (c) 2024, NVIDIA CORPORATION & AFFILIATES.
#  All rights reserved.
#

testdir=$(readlink -f $(dirname $0))
rootdir=$(readlink -f $testdir/../../..)
source $rootdir/test/common/autotest_common.sh
source $rootdir/test/nvmf/common.sh

allowed_devices=${1:-"mlx5_0"}

function gen_accel_mlx5_crypto_json() {
	jq . <<- JSON
		{
		  "subsystems": [
		    {
		      "subsystem": "accel",
		      "config": [
		        {
		          "method": "mlx5_scan_accel_module",
		          "params": {
		            "allowed_devs": "${allowed_devices}"
		          }
		        },
		        {
		          "method": "accel_crypto_key_create",
		          "params": {
		            "name": "test_dek",
		            "cipher": "AES_XTS",
		            "key": "00112233445566778899001122334455",
		            "key2": "11223344556677889900112233445500"
		          }
		        }
		      ]
		    },
		    {
		      "subsystem": "bdev",
		      "config": [
		        {
		          "method": "bdev_malloc_create",
		          "params": {
		            "name": "Malloc0",
		            "num_blocks": 131072,
		            "block_size": 512,
		            "uuid": "e1c24cb1-dd44-4be6-8d67-de92a332013f"
		          }
		        },
		        {
		          "method": "bdev_crypto_create",
		          "params": {
		            "base_bdev_name": "Malloc0",
		            "name": "Crypto0",
		            "key_name": "test_dek"
		          }
		        },
		        {
		          "method": "bdev_wait_for_examine"
		        }
		      ]
		    }
		  ]
		}
	JSON
}

# Since accel_mlx5 supports memory domains, we can use existing test_dma application for test purpose
for mode in randread randwrite randrw; do
	for qdepth in 64 256; do
		for io_size in 512 4096 65536 131072; do
			echo "test: mode $mode, qdepth $qdepth, io_size $io_size"
			"$rootdir/test/dma/test_dma/test_dma" -q $qdepth -o $io_size -w $mode -M 50 -t 5 -m 0xc --json <(gen_accel_mlx5_crypto_json) -b "Crypto0" -f -x translate
		done
	done
done

trap - SIGINT SIGTERM EXIT
+3 −0
Original line number Diff line number Diff line
@@ -74,3 +74,6 @@ keyring_linux
nvmf_device_removal
nvmf_device_removal_pci_remove_no_srq
nvmf_device_removal_pci_remove

# Disabled due to mlx5 HW/build dependency
accel_mlx5_crypto