diff --git a/app/nvmf_tgt/nvmf_tgt.c b/app/nvmf_tgt/nvmf_tgt.c index 4906f86615..10ad32279a 100644 --- a/app/nvmf_tgt/nvmf_tgt.c +++ b/app/nvmf_tgt/nvmf_tgt.c @@ -40,7 +40,7 @@ #include #include -#include +#include #include "nvmf_tgt.h" diff --git a/examples/ioat/perf/perf.c b/examples/ioat/perf/perf.c index d5bf442044..2f0f6204cd 100644 --- a/examples/ioat/perf/perf.c +++ b/examples/ioat/perf/perf.c @@ -39,10 +39,10 @@ #include #include #include -#include #include "spdk/ioat.h" #include "spdk/env.h" +#include "spdk/queue.h" #include "spdk/string.h" struct user_config { @@ -70,8 +70,8 @@ struct thread_entry { uint64_t current_queue_depth; unsigned lcore_id; bool is_draining; - struct rte_mempool *data_pool; - struct rte_mempool *task_pool; + struct spdk_mempool *data_pool; + struct spdk_mempool *task_pool; }; struct ioat_task { @@ -134,9 +134,9 @@ ioat_done(void *cb_arg) thread_entry->current_queue_depth--; if (thread_entry->is_draining) { - rte_mempool_put(thread_entry->data_pool, ioat_task->src); - rte_mempool_put(thread_entry->data_pool, ioat_task->dst); - rte_mempool_put(thread_entry->task_pool, ioat_task); + spdk_mempool_put(thread_entry->data_pool, ioat_task->src); + spdk_mempool_put(thread_entry->data_pool, ioat_task->dst); + spdk_mempool_put(thread_entry->task_pool, ioat_task); } else { submit_single_xfer(thread_entry, ioat_task, ioat_task->dst, ioat_task->src); } @@ -264,9 +264,9 @@ submit_xfers(struct thread_entry *thread_entry, uint64_t queue_depth) void *src = NULL, *dst = NULL; struct ioat_task *ioat_task = NULL; - rte_mempool_get(thread_entry->data_pool, &src); - rte_mempool_get(thread_entry->data_pool, &dst); - rte_mempool_get(thread_entry->task_pool, (void **)&ioat_task); + src = spdk_mempool_get(thread_entry->data_pool); + dst = spdk_mempool_get(thread_entry->data_pool); + ioat_task = spdk_mempool_get(thread_entry->task_pool); submit_single_xfer(thread_entry, ioat_task, dst, src); } @@ -287,11 +287,8 @@ work_fn(void *arg) snprintf(buf_pool_name, sizeof(buf_pool_name), "buf_pool_%d", rte_lcore_id()); snprintf(task_pool_name, sizeof(task_pool_name), "task_pool_%d", rte_lcore_id()); - t->data_pool = rte_mempool_create(buf_pool_name, 512, g_user_config.xfer_size_bytes, 0, 0, NULL, - NULL, - NULL, NULL, SOCKET_ID_ANY, 0); - t->task_pool = rte_mempool_create(task_pool_name, 512, sizeof(struct ioat_task), 0, 0, NULL, NULL, - NULL, NULL, SOCKET_ID_ANY, 0); + t->data_pool = spdk_mempool_create(buf_pool_name, 512, g_user_config.xfer_size_bytes, -1); + t->task_pool = spdk_mempool_create(task_pool_name, 512, sizeof(struct ioat_task), -1); if (!t->data_pool || !t->task_pool) { fprintf(stderr, "Could not allocate buffer pool.\n"); return 1; diff --git a/examples/ioat/verify/verify.c b/examples/ioat/verify/verify.c index 73c2a7658e..730b412fb3 100644 --- a/examples/ioat/verify/verify.c +++ b/examples/ioat/verify/verify.c @@ -39,10 +39,10 @@ #include #include #include -#include #include "spdk/ioat.h" #include "spdk/env.h" +#include "spdk/queue.h" #include "spdk/string.h" #define SRC_BUFFER_SIZE (512*1024) @@ -77,8 +77,8 @@ struct thread_entry { uint64_t current_queue_depth; unsigned lcore_id; bool is_draining; - struct rte_mempool *data_pool; - struct rte_mempool *task_pool; + struct spdk_mempool *data_pool; + struct spdk_mempool *task_pool; }; struct ioat_task { @@ -190,8 +190,8 @@ ioat_done(void *cb_arg) thread_entry->current_queue_depth--; if (thread_entry->is_draining) { - rte_mempool_put(thread_entry->data_pool, ioat_task->buffer); - rte_mempool_put(thread_entry->task_pool, ioat_task); + spdk_mempool_put(thread_entry->data_pool, ioat_task->buffer); + spdk_mempool_put(thread_entry->task_pool, ioat_task); } else { prepare_ioat_task(thread_entry, ioat_task); submit_single_xfer(ioat_task); @@ -308,8 +308,8 @@ submit_xfers(struct thread_entry *thread_entry, uint64_t queue_depth) { while (queue_depth-- > 0) { struct ioat_task *ioat_task = NULL; - rte_mempool_get(thread_entry->task_pool, (void **)&ioat_task); - rte_mempool_get(thread_entry->data_pool, &(ioat_task->buffer)); + ioat_task = spdk_mempool_get(thread_entry->task_pool); + ioat_task->buffer = spdk_mempool_get(thread_entry->data_pool); ioat_task->type = IOAT_COPY_TYPE; if (spdk_ioat_get_dma_capabilities(thread_entry->chan) & SPDK_IOAT_ENGINE_FILL_SUPPORTED) { @@ -336,12 +336,9 @@ work_fn(void *arg) snprintf(buf_pool_name, sizeof(buf_pool_name), "buf_pool_%d", rte_lcore_id()); snprintf(task_pool_name, sizeof(task_pool_name), "task_pool_%d", rte_lcore_id()); - t->data_pool = rte_mempool_create(buf_pool_name, g_user_config.queue_depth, SRC_BUFFER_SIZE, 0, 0, - NULL, NULL, - NULL, NULL, SOCKET_ID_ANY, 0); - t->task_pool = rte_mempool_create(task_pool_name, g_user_config.queue_depth, - sizeof(struct ioat_task), 0, 0, NULL, NULL, - NULL, NULL, SOCKET_ID_ANY, 0); + t->data_pool = spdk_mempool_create(buf_pool_name, g_user_config.queue_depth, SRC_BUFFER_SIZE, -1); + t->task_pool = spdk_mempool_create(task_pool_name, g_user_config.queue_depth, + sizeof(struct ioat_task), -1); if (!t->data_pool || !t->task_pool) { fprintf(stderr, "Could not allocate buffer pool.\n"); return 1; diff --git a/examples/nvme/fio_plugin/fio_plugin.c b/examples/nvme/fio_plugin/fio_plugin.c index 40a27030c0..13d2600ef1 100644 --- a/examples/nvme/fio_plugin/fio_plugin.c +++ b/examples/nvme/fio_plugin/fio_plugin.c @@ -38,7 +38,6 @@ #include #include "rte_config.h" -#include "rte_mempool.h" #include "rte_eal.h" #include "spdk/nvme.h" diff --git a/examples/nvme/hello_world/hello_world.c b/examples/nvme/hello_world/hello_world.c index 13fb9e6c92..c28fc776e3 100644 --- a/examples/nvme/hello_world/hello_world.c +++ b/examples/nvme/hello_world/hello_world.c @@ -32,11 +32,12 @@ */ #include +#include #include #include #include -#include +#include #include "spdk/nvme.h" #include "spdk/env.h" diff --git a/examples/nvme/identify/identify.c b/examples/nvme/identify/identify.c index 61ba5c2663..ab297e8b2a 100644 --- a/examples/nvme/identify/identify.c +++ b/examples/nvme/identify/identify.c @@ -31,11 +31,13 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#include #include +#include +#include #include #include -#include #include #include "spdk/nvme.h" diff --git a/examples/nvme/nvme_manage/nvme_manage.c b/examples/nvme/nvme_manage/nvme_manage.c index 5ee4eac26f..99d4523384 100644 --- a/examples/nvme/nvme_manage/nvme_manage.c +++ b/examples/nvme/nvme_manage/nvme_manage.c @@ -31,8 +31,10 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#include #include #include +#include #include #include #include @@ -41,7 +43,6 @@ #include #include -#include #include #include "spdk/nvme.h" diff --git a/examples/nvme/reserve/reservation.c b/examples/nvme/reserve/reservation.c index ce9b47f93f..10f26eccf0 100644 --- a/examples/nvme/reserve/reservation.c +++ b/examples/nvme/reserve/reservation.c @@ -32,11 +32,12 @@ */ #include +#include +#include #include #include #include -#include #include #include "spdk/nvme.h" diff --git a/lib/bdev/nvme/blockdev_nvme.c b/lib/bdev/nvme/blockdev_nvme.c index d78498a340..7844446997 100644 --- a/lib/bdev/nvme/blockdev_nvme.c +++ b/lib/bdev/nvme/blockdev_nvme.c @@ -42,7 +42,6 @@ #include #include -#include #include #include "spdk/conf.h" diff --git a/lib/event/reactor.c b/lib/event/reactor.c index 80dcef23cf..a15f5ed612 100644 --- a/lib/event/reactor.c +++ b/lib/event/reactor.c @@ -48,7 +48,6 @@ #endif #include -#include #include #include "reactor.h" @@ -126,7 +125,7 @@ static enum spdk_reactor_state g_reactor_state = SPDK_REACTOR_STATE_INVALID; static void spdk_reactor_construct(struct spdk_reactor *w, uint32_t lcore, uint64_t max_delay_us); -struct rte_mempool *g_spdk_event_mempool[SPDK_MAX_SOCKET]; +struct spdk_mempool *g_spdk_event_mempool[SPDK_MAX_SOCKET]; /** \file @@ -145,12 +144,11 @@ spdk_event_allocate(uint32_t lcore, spdk_event_fn fn, void *arg1, void *arg2, spdk_event_t next) { struct spdk_event *event = NULL; - int rc; uint8_t socket_id = rte_lcore_to_socket_id(lcore); assert(socket_id < SPDK_MAX_SOCKET); - rc = rte_mempool_get(g_spdk_event_mempool[socket_id], (void **)&event); - if (rc != 0 || event == NULL) { + event = spdk_mempool_get(g_spdk_event_mempool[socket_id]); + if (event == NULL) { assert(false); return NULL; } @@ -170,7 +168,7 @@ spdk_event_free(uint32_t lcore, struct spdk_event *event) uint8_t socket_id = rte_lcore_to_socket_id(lcore); assert(socket_id < SPDK_MAX_SOCKET); - rte_mempool_put(g_spdk_event_mempool[socket_id], (void *)event); + spdk_mempool_put(g_spdk_event_mempool[socket_id], (void *)event); } void @@ -617,10 +615,9 @@ spdk_reactors_init(const char *mask, unsigned int max_delay_us) for (i = 0; i < SPDK_MAX_SOCKET; i++) { if ((1ULL << i) & socket_mask) { snprintf(mempool_name, sizeof(mempool_name), "spdk_event_mempool_%d", i); - g_spdk_event_mempool[i] = rte_mempool_create(mempool_name, + g_spdk_event_mempool[i] = spdk_mempool_create(mempool_name, (262144 / socket_count), - sizeof(struct spdk_event), 128, 0, - NULL, NULL, NULL, NULL, i, 0); + sizeof(struct spdk_event), -1); if (g_spdk_event_mempool[i] == NULL) { SPDK_ERRLOG("spdk_event_mempool creation failed on socket %d\n", i); @@ -631,13 +628,10 @@ spdk_reactors_init(const char *mask, unsigned int max_delay_us) * memory is not evenly installed on all sockets. If still * fails, free all allocated memory and exits. */ - g_spdk_event_mempool[i] = rte_mempool_create( + g_spdk_event_mempool[i] = spdk_mempool_create( mempool_name, (262144 / socket_count), - sizeof(struct spdk_event), - 128, 0, - NULL, NULL, NULL, NULL, - SOCKET_ID_ANY, 0); + sizeof(struct spdk_event), -1); /* TODO: in DPDK 16.04, free mempool API is avaialbe. */ if (g_spdk_event_mempool[i] == NULL) { diff --git a/lib/nvmf/nvmf.c b/lib/nvmf/nvmf.c index 108d88ca05..771c9d4f82 100644 --- a/lib/nvmf/nvmf.c +++ b/lib/nvmf/nvmf.c @@ -34,8 +34,6 @@ #include #include -#include -#include #include "spdk/log.h" #include "spdk/conf.h" diff --git a/test/lib/env/vtophys.c b/test/lib/env/vtophys.c index 2c7d7094eb..8060385294 100644 --- a/test/lib/env/vtophys.c +++ b/test/lib/env/vtophys.c @@ -32,12 +32,12 @@ */ #include +#include #include #include #include #include -#include #include "spdk/env.h" diff --git a/test/lib/event/event/event.c b/test/lib/event/event/event.c index 46a4bf9aab..a14a5a1538 100644 --- a/test/lib/event/event/event.c +++ b/test/lib/event/event/event.c @@ -39,7 +39,6 @@ #include #include -#include #include #include diff --git a/test/lib/nvme/aer/aer.c b/test/lib/nvme/aer/aer.c index 122f6ceaef..0965cd2ca4 100644 --- a/test/lib/nvme/aer/aer.c +++ b/test/lib/nvme/aer/aer.c @@ -32,9 +32,10 @@ */ #include +#include +#include #include -#include #include #include "spdk/nvme.h" diff --git a/test/lib/nvme/e2edp/nvme_dp.c b/test/lib/nvme/e2edp/nvme_dp.c index 5393032e88..7707017ea9 100644 --- a/test/lib/nvme/e2edp/nvme_dp.c +++ b/test/lib/nvme/e2edp/nvme_dp.c @@ -36,11 +36,12 @@ */ #include +#include +#include #include #include #include -#include #include #include "spdk/nvme.h" diff --git a/test/lib/nvme/overhead/overhead.c b/test/lib/nvme/overhead/overhead.c index 118f304b99..b541403229 100644 --- a/test/lib/nvme/overhead/overhead.c +++ b/test/lib/nvme/overhead/overhead.c @@ -31,13 +31,16 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include +#include +#include #include +#include +#include #include #include #include -#include +#include #include #include "spdk/fd.h" diff --git a/test/lib/nvme/sgl/nvme_sgl.c b/test/lib/nvme/sgl/nvme_sgl.c index c3b32bd45f..81a1ebb9e1 100644 --- a/test/lib/nvme/sgl/nvme_sgl.c +++ b/test/lib/nvme/sgl/nvme_sgl.c @@ -32,11 +32,12 @@ */ #include +#include +#include #include #include #include -#include #include #include "spdk/nvme.h" diff --git a/test/lib/nvmf/nvmf/nvmf_ut.c b/test/lib/nvmf/nvmf/nvmf_ut.c index bad6971395..b56a853f96 100644 --- a/test/lib/nvmf/nvmf/nvmf_ut.c +++ b/test/lib/nvmf/nvmf/nvmf_ut.c @@ -37,7 +37,6 @@ #include #include -#include #include #include "spdk_cunit.h"