test/nvme/err_injection: switch to spdk_*malloc().

spdk_dma_*malloc() is about to be deprecated.

Change-Id: I3949913f1a69d5c0b0798077cf794b1dbd5bf0cc
Signed-off-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/459557
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
This commit is contained in:
Darek Stojaczyk 2019-06-27 07:17:12 +02:00 committed by Changpeng Liu
parent 294ac20b0f
commit 6b66195d85

View File

@ -158,7 +158,7 @@ read_test_cb(void *cb_arg, const struct spdk_nvme_cpl *cpl)
struct dev *dev = cb_arg;
outstanding_commands--;
spdk_dma_free(dev->data);
spdk_free(dev->data);
if (spdk_nvme_cpl_is_error(cpl) && dev->error_expected) {
if (cpl->status.sct != SPDK_NVME_SCT_MEDIA_ERROR ||
@ -184,7 +184,7 @@ read_test(bool error_expected)
foreach_dev(dev) {
dev->error_expected = error_expected;
dev->data = spdk_dma_zmalloc(0x1000, 0x1000, NULL);
dev->data = spdk_zmalloc(0x1000, 0x1000, NULL, SPDK_ENV_LCORE_ID_ANY, SPDK_MALLOC_DMA);
if (!dev->data) {
failed = 1;
goto cleanup;