diff --git a/examples/nvme/arbitration/arbitration.c b/examples/nvme/arbitration/arbitration.c index d1391b6b7..f665968e6 100644 --- a/examples/nvme/arbitration/arbitration.c +++ b/examples/nvme/arbitration/arbitration.c @@ -1120,6 +1120,7 @@ static char *ealargs[] = { "arb", "-c 0xf", /* This must be the second parameter. It is overwritten by index in main(). */ "-n 4", + "--proc-type=auto", }; int diff --git a/examples/nvme/fio_plugin/fio_plugin.c b/examples/nvme/fio_plugin/fio_plugin.c index a845d4fb0..bb3dcee42 100644 --- a/examples/nvme/fio_plugin/fio_plugin.c +++ b/examples/nvme/fio_plugin/fio_plugin.c @@ -183,6 +183,7 @@ attach_cb(void *cb_ctx, struct spdk_pci_device *dev, struct spdk_nvme_ctrlr *ctr static char *ealargs[] = { "fio", "-n 4", + "--proc-type=auto", }; /* Called once at initialization. This is responsible for gathering the size of diff --git a/examples/nvme/hello_world/hello_world.c b/examples/nvme/hello_world/hello_world.c index 6dbdfbf23..96fb8849b 100644 --- a/examples/nvme/hello_world/hello_world.c +++ b/examples/nvme/hello_world/hello_world.c @@ -333,6 +333,7 @@ static char *ealargs[] = { "hello_world", "-c 0x1", "-n 4", + "--proc-type=auto", }; int main(int argc, char **argv) diff --git a/examples/nvme/identify/identify.c b/examples/nvme/identify/identify.c index 1e500eb38..379c5a50b 100644 --- a/examples/nvme/identify/identify.c +++ b/examples/nvme/identify/identify.c @@ -943,6 +943,7 @@ static const char *ealargs[] = { "identify", "-c 0x1", "-n 4", + "--proc-type=auto", }; int main(int argc, char **argv) diff --git a/examples/nvme/nvme_manage/nvme_manage.c b/examples/nvme/nvme_manage/nvme_manage.c index 446295897..a080c042b 100644 --- a/examples/nvme/nvme_manage/nvme_manage.c +++ b/examples/nvme/nvme_manage/nvme_manage.c @@ -175,6 +175,7 @@ static const char *ealargs[] = { "nvme_manage", "-c 0x1", "-n 4", + "--proc-type=auto", }; static void usage(void) diff --git a/examples/nvme/perf/perf.c b/examples/nvme/perf/perf.c index aa180b240..fbdc73dab 100644 --- a/examples/nvme/perf/perf.c +++ b/examples/nvme/perf/perf.c @@ -1093,6 +1093,7 @@ static char *ealargs[] = { "perf", "-c 0x1", /* This must be the second parameter. It is overwritten by index in main(). */ "-n 4", + "--proc-type=auto", }; int main(int argc, char **argv) diff --git a/examples/nvme/reserve/reservation.c b/examples/nvme/reserve/reservation.c index 75918e891..3a1303f52 100644 --- a/examples/nvme/reserve/reservation.c +++ b/examples/nvme/reserve/reservation.c @@ -424,6 +424,7 @@ static const char *ealargs[] = { "reserve", "-c 0x1", "-n 4", + "--proc-type=auto", }; int main(int argc, char **argv) diff --git a/lib/event/dpdk_init.c b/lib/event/dpdk_init.c index 04117a7d4..0f2668330 100644 --- a/lib/event/dpdk_init.c +++ b/lib/event/dpdk_init.c @@ -58,6 +58,7 @@ enum dpdk_eal_args { EAL_MEMSIZE_ARG, EAL_MASTER_CORE_ARG, EAL_FILE_PREFIX_ARG, + EAL_PROC_TYPE_ARG, EAL_ARG_COUNT }; @@ -159,6 +160,19 @@ spdk_build_eal_cmdline(struct spdk_app_opts *opts) rte_exit(EXIT_FAILURE, "ealargs spdk_sprintf_alloc"); } +#ifdef __linux__ + /* set the process type */ + g_arg_strings[EAL_PROC_TYPE_ARG] = spdk_sprintf_alloc("--proc-type=auto"); +#else + /* --proc-type is not required on FreeBSD */ + /* TODO: to enable the support on FreeBSD once it supports process shared mutex */ + g_arg_strings[EAL_PROC_TYPE_ARG] = strdup(""); +#endif + if (g_arg_strings[EAL_PROC_TYPE_ARG] == NULL) { + spdk_free_ealargs(); + rte_exit(EXIT_FAILURE, "ealargs spdk_sprintf_alloc"); + } + memcpy(g_ealargs, g_arg_strings, sizeof(g_arg_strings)); }