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: Seth 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: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
This commit is contained in:
Seth Howell 2018-10-22 17:00:33 -07:00 committed by Ben Walker
parent b1b3d39eaa
commit 51baf04dc6
6 changed files with 26 additions and 11 deletions

2
dpdk

@ -1 +1 @@
Subproject commit 812c579bd2167a736d5f0e7f9ea74c6487ccfb7c
Subproject commit 96fae0e24c9088d9690c38098b25646f861a664b

View File

@ -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

View File

@ -1,3 +1,5 @@
DPDK
EAL
CRYPTODEV
....

View File

@ -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

View File

@ -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
$rpc_py construct_crypto_bdev -b Malloc3 -c CryMalloc3 -d crypto_aesni_mb -k 0123456789123456
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

View File

@ -14,7 +14,7 @@ function on_error_exit() {
}
function run_spdk_tgt() {
$SPDKCLI_BUILD_DIR/app/spdk_tgt/spdk_tgt -m 0x3 -p 0 -s 1024 &
$SPDKCLI_BUILD_DIR/app/spdk_tgt/spdk_tgt -m 0x3 -p 0 -s 4096 &
spdk_tgt_pid=$!
waitforlisten $spdk_tgt_pid
}