Commit e36f9cc7 authored by Darek Stojaczyk's avatar Darek Stojaczyk Committed by Changpeng Liu
Browse files

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



spdk_dma_*malloc() is about to be deprecated.

Change-Id: I41f8d8ba2cde155074bfc4e0b6c43aa956c6cb40
Signed-off-by: default avatarDarek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/459554


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarPaul Luse <paul.e.luse@intel.com>
Reviewed-by: default avatarTomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: default avatarShuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: default avatarChangpeng Liu <changpeng.liu@intel.com>
parent 67ef4354
Loading
Loading
Loading
Loading
+6 −4
Original line number Diff line number Diff line
@@ -244,10 +244,10 @@ cleanup(void)

	foreach_dev(dev) {
		if (dev->health_page) {
			spdk_dma_free(dev->health_page);
			spdk_free(dev->health_page);
		}
		if (dev->changed_ns_list) {
			spdk_dma_free(dev->changed_ns_list);
			spdk_free(dev->changed_ns_list);
		}
	}
}
@@ -383,12 +383,14 @@ attach_cb(void *cb_ctx, const struct spdk_nvme_transport_id *trid,

	printf("Attached to %s\n", dev->name);

	dev->health_page = spdk_dma_zmalloc(sizeof(*dev->health_page), 4096, NULL);
	dev->health_page = spdk_zmalloc(sizeof(*dev->health_page), 4096, NULL, SPDK_ENV_LCORE_ID_ANY,
					SPDK_MALLOC_DMA);
	if (dev->health_page == NULL) {
		printf("Allocation error (health page)\n");
		g_failed = 1;
	}
	dev->changed_ns_list = spdk_dma_zmalloc(sizeof(*dev->changed_ns_list), 4096, NULL);
	dev->changed_ns_list = spdk_zmalloc(sizeof(*dev->changed_ns_list), 4096, NULL,
					    SPDK_ENV_LCORE_ID_ANY, SPDK_MALLOC_DMA);
	if (dev->changed_ns_list == NULL) {
		printf("Allocation error (changed namespace list page)\n");
		g_failed = 1;