nvme: create the mempool from the name with the suffix of pid

Change-Id: I3bf3ecf5b83e206553d4103d47ed04ebe80387eb
Signed-off-by: GangCao <gang.cao@intel.com>
This commit is contained in:
GangCao 2016-11-09 22:04:27 -05:00
parent 621f96f7aa
commit 987ba616fa
2 changed files with 16 additions and 2 deletions

View File

@ -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();

View File

@ -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();