From 987ba616fa4be4a23090559d23c78e307425b5d8 Mon Sep 17 00:00:00 2001 From: GangCao Date: Wed, 9 Nov 2016 22:04:27 -0500 Subject: [PATCH] nvme: create the mempool from the name with the suffix of pid Change-Id: I3bf3ecf5b83e206553d4103d47ed04ebe80387eb Signed-off-by: GangCao --- examples/nvme/arbitration/arbitration.c | 9 ++++++++- examples/nvme/perf/perf.c | 9 ++++++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/examples/nvme/arbitration/arbitration.c b/examples/nvme/arbitration/arbitration.c index 68987b23c..e3d2c7d35 100644 --- a/examples/nvme/arbitration/arbitration.c +++ b/examples/nvme/arbitration/arbitration.c @@ -1106,6 +1106,7 @@ main(int argc, char **argv) { int rc; struct worker_thread *worker; + char task_pool_name[30]; rc = parse_args(argc, argv); if (rc != 0) { @@ -1128,10 +1129,16 @@ main(int argc, char **argv) return 1; } - task_pool = rte_mempool_create("arbitration_task_pool", 8192, + snprintf(task_pool_name, sizeof(task_pool_name), "task_pool_%d", getpid()); + + task_pool = rte_mempool_create(task_pool_name, 8192, sizeof(struct arb_task), 64, 0, NULL, NULL, task_ctor, NULL, SOCKET_ID_ANY, 0); + if (task_pool == NULL) { + fprintf(stderr, "could not initialize task pool\n"); + return 1; + } g_arbitration.tsc_rate = spdk_get_ticks_hz(); diff --git a/examples/nvme/perf/perf.c b/examples/nvme/perf/perf.c index 24d9bb086..4b02c642f 100644 --- a/examples/nvme/perf/perf.c +++ b/examples/nvme/perf/perf.c @@ -1087,6 +1087,7 @@ int main(int argc, char **argv) { int rc; struct worker_thread *worker; + char task_pool_name[30]; rc = parse_args(argc, argv); if (rc != 0) { @@ -1108,10 +1109,16 @@ int main(int argc, char **argv) return 1; } - task_pool = rte_mempool_create("perf_task_pool", 8192, + snprintf(task_pool_name, sizeof(task_pool_name), "task_pool_%d", getpid()); + + task_pool = rte_mempool_create(task_pool_name, 8192, sizeof(struct perf_task), 64, 0, NULL, NULL, task_ctor, NULL, SOCKET_ID_ANY, 0); + if (task_pool == NULL) { + fprintf(stderr, "could not initialize task pool\n"); + return 1; + } g_tsc_rate = spdk_get_ticks_hz();