Commit 51baf04d authored by Seth Howell's avatar Seth Howell Committed by Ben Walker
Browse files

vbdev_crypto.c: Always initialize crypto drivers up front



This helps us avoid situations where other bdev modules will break the
rte_pci_bus mappings for qat devices before we have an opportunity to
initialize the qat pmd.

Also, update the blobstore match file to handle the possibility of using
a crypto driver and improve the json_config and spdkcli scripts to
handle allocating qat_crypto drivers.

Change-Id: I7359c67d1992df1d5bb85585eca6d5c342787649
Signed-off-by: default avatarSeth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/430393


Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
Reviewed-by: default avatarBen Walker <benjamin.walker@intel.com>
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
parent b1b3d39e
Loading
Loading
Loading
Loading
Compare 812c579b to 96fae0e2
Original line number Diff line number Diff line
Subproject commit 812c579bd2167a736d5f0e7f9ea74c6487ccfb7c
Subproject commit 96fae0e24c9088d9690c38098b25646f861a664b
+11 −7
Original line number Diff line number Diff line
@@ -1176,6 +1176,13 @@ vbdev_crypto_init(void)
	int rc = 0;
	const char *key = NULL;

	/* Fully configure both SW and HW drivers. */
	rc = vbdev_crypto_init_crypto_drivers();
	if (rc) {
		SPDK_ERRLOG("Error setting up crypto devices\n");
		return rc;
	}

	sp = spdk_conf_find_section(NULL, "crypto");
	if (sp == NULL) {
		return 0;
@@ -1219,13 +1226,6 @@ vbdev_crypto_init(void)
		}
	}

	/* Fully configure both SW and HW drivers. */
	rc = vbdev_crypto_init_crypto_drivers();
	if (rc) {
		SPDK_ERRLOG("Error setting up crypto devices\n");
		return rc;
	}

	return rc;
}

@@ -1256,6 +1256,10 @@ vbdev_crypto_finish(void)
		TAILQ_REMOVE(&g_device_qp, dev_qp, link);
		free(dev_qp);
	}

	rte_mempool_free(g_crypto_op_mp);
	spdk_mempool_free(g_mbuf_mp);
	spdk_mempool_free(g_session_mp);
}

/* During init we'll be asked how much memory we'd like passed to us
+2 −0
Original line number Diff line number Diff line
DPDK
EAL
CRYPTODEV

....
+5 −0
Original line number Diff line number Diff line
@@ -16,6 +16,11 @@ EAL: probe driver: 8086:2f25 spdk_ioat
EAL: PCI device 0000:00:04.6 on NUMA socket 0
EAL:   probe driver: 8086:2f26 spdk_ioat
EAL: PCI device 0000:00:04.7 on NUMA socket 0
CRYPTODEV: [crypto_aesni_mb] - Creating cryptodev crypto_aesni_mb

CRYPTODEV: [crypto_aesni_mb] - Initialisation parameters - name: crypto_aesni_mb,socket id: 0, max queue pairs: 8
$(OPT)cryptodev_aesni_mb_create() line 976: IPSec Multi-buffer library version used: 0.49.0

EAL:   probe driver: 8086:2f27 spdk_ioat
EAL: PCI device 0000:80:04.0 on NUMA socket 1
EAL:   probe driver: 8086:2f20 spdk_ioat
+6 −2
Original line number Diff line number Diff line
@@ -16,7 +16,7 @@ null_json_config=$JSON_DIR/null_json_config.json

function run_spdk_tgt() {
	echo "Running spdk target"
	$SPDK_BUILD_DIR/app/spdk_tgt/spdk_tgt -m 0x1 -p 0 -s 1024 --wait-for-rpc &
	$SPDK_BUILD_DIR/app/spdk_tgt/spdk_tgt -m 0x1 -p 0 -s 4096 --wait-for-rpc &
	spdk_tgt_pid=$!

	echo "Waiting for app to run..."
@@ -150,7 +150,11 @@ function create_bdev_subsystem_config() {
	$rpc_py construct_malloc_bdev 8 1024 --name Malloc2
	if [ $SPDK_TEST_CRYPTO -eq 1 ]; then
		$rpc_py construct_malloc_bdev 8 1024 --name Malloc3
		if [ $(lspci -d:37c8 | wc -l) -eq 0 ]; then
			$rpc_py construct_crypto_bdev -b Malloc3 -c CryMalloc3 -d crypto_aesni_mb -k 0123456789123456
		else
			$rpc_py construct_crypto_bdev -b Malloc3 -c CryMalloc3 -d crypto_qat -k 0123456789123456
		fi
	fi
	$rpc_py construct_error_bdev Malloc2
	if [ $(uname -s) = Linux ]; then
Loading