Commit 8a44220b authored by John Meneghini's avatar John Meneghini Committed by Jim Harris
Browse files

env: Rename spdk_malloc/zmalloc/realloc/free to spdk_dma_(func)



  - rename spdk_malloc_socket to spdk_dma_malloc_socket
  - rename spdk_malloc to spdk_dma_malloc
  - rename spdk_zmalloc to spdk_dma_zmalloc
  - rename spdk_realloc to spdk_dma_realloc
  - rename spdk_free to spdk_dma_free

Change-Id: I52a11b7a4243281f9c56f503e826fd7c4a1fd883
Signed-off-by: default avatarJohn Meneghini <johnm@netapp.com>
Reviewed-on: https://review.gerrithub.io/362604


Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
Tested-by: default avatarSPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: default avatarBen Walker <benjamin.walker@intel.com>
parent ad476cae
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -125,7 +125,7 @@ ioat_exit(void)
		if (dev->ioat) {
			spdk_ioat_detach(dev->ioat);
		}
		spdk_free(dev);
		spdk_dma_free(dev);
	}
}

@@ -221,7 +221,7 @@ attach_cb(void *cb_ctx, struct spdk_pci_device *pci_dev, struct spdk_ioat_chan *
		return;
	}

	dev = spdk_zmalloc(sizeof(*dev), 0, NULL);
	dev = spdk_dma_zmalloc(sizeof(*dev), 0, NULL);
	if (dev == NULL) {
		printf("Failed to allocate device struct\n");
		return;
+2 −2
Original line number Diff line number Diff line
@@ -359,7 +359,7 @@ init_src_buffer(void)
{
	int i;

	g_src = spdk_zmalloc(SRC_BUFFER_SIZE, 512, NULL);
	g_src = spdk_dma_zmalloc(SRC_BUFFER_SIZE, 512, NULL);
	if (g_src == NULL) {
		fprintf(stderr, "Allocate src buffer failed\n");
		return -1;
@@ -476,7 +476,7 @@ main(int argc, char **argv)
	rc = dump_result(threads, RTE_MAX_LCORE);

cleanup:
	spdk_free(g_src);
	spdk_dma_free(g_src);
	ioat_exit();

	return rc;
+3 −3
Original line number Diff line number Diff line
@@ -297,9 +297,9 @@ static void
task_ctor(struct rte_mempool *mp, void *arg, void *__task, unsigned id)
{
	struct arb_task *task = __task;
	task->buf = spdk_zmalloc(g_arbitration.io_size_bytes, 0x200, NULL);
	task->buf = spdk_dma_zmalloc(g_arbitration.io_size_bytes, 0x200, NULL);
	if (task->buf == NULL) {
		fprintf(stderr, "task->buf spdk_zmalloc failed\n");
		fprintf(stderr, "task->buf spdk_dma_zmalloc failed\n");
		exit(1);
	}
}
@@ -441,7 +441,7 @@ cleanup(void)
	};

	if (rte_mempool_get(task_pool, (void **)&task) == 0) {
		spdk_free(task->buf);
		spdk_dma_free(task->buf);
	}

}
+2 −2
Original line number Diff line number Diff line
@@ -309,13 +309,13 @@ static int spdk_fio_close(struct thread_data *td, struct fio_file *f)

static int spdk_fio_iomem_alloc(struct thread_data *td, size_t total_mem)
{
	td->orig_buffer = spdk_zmalloc(total_mem, NVME_IO_ALIGN, NULL);
	td->orig_buffer = spdk_dma_zmalloc(total_mem, NVME_IO_ALIGN, NULL);
	return td->orig_buffer == NULL;
}

static void spdk_fio_iomem_free(struct thread_data *td)
{
	spdk_free(td->orig_buffer);
	spdk_dma_free(td->orig_buffer);
}

static int spdk_fio_io_u_init(struct thread_data *td, struct io_u *io_u)
+5 −5
Original line number Diff line number Diff line
@@ -108,7 +108,7 @@ read_complete(void *arg, const struct spdk_nvme_cpl *completion)
	 *  to exit its polling loop.
	 */
	printf("%s", sequence->buf);
	spdk_free(sequence->buf);
	spdk_dma_free(sequence->buf);
	sequence->is_completed = 1;
}

@@ -124,8 +124,8 @@ write_complete(void *arg, const struct spdk_nvme_cpl *completion)
	 *  the write I/O and allocate a new zeroed buffer for reading
	 *  the data back from the NVMe namespace.
	 */
	spdk_free(sequence->buf);
	sequence->buf = spdk_zmalloc(0x1000, 0x1000, NULL);
	spdk_dma_free(sequence->buf);
	sequence->buf = spdk_dma_zmalloc(0x1000, 0x1000, NULL);

	rc = spdk_nvme_ns_cmd_read(ns_entry->ns, ns_entry->qpair, sequence->buf,
				   0, /* LBA start */
@@ -165,11 +165,11 @@ hello_world(void)
		}

		/*
		 * Use spdk_zmalloc to allocate a 4KB zeroed buffer.  This memory
		 * Use spdk_dma_zmalloc to allocate a 4KB zeroed buffer.  This memory
		 * will be pinned, which is required for data buffers used for SPDK NVMe
		 * I/O operations.
		 */
		sequence.buf = spdk_zmalloc(0x1000, 0x1000, NULL);
		sequence.buf = spdk_dma_zmalloc(0x1000, 0x1000, NULL);
		sequence.is_completed = 0;
		sequence.ns_entry = ns_entry;

Loading