Skip to content

Commit

Permalink
linux-gen: dpdk: fix running multiple odp instances simulaneusly
Browse files Browse the repository at this point in the history
Prefix DPDK packet pool names and huge page mappings with
PID to avoid name conflicts. Also, let DPDK detect process
type automatically.

Signed-off-by: Matias Elo <matias.elo@nokia.com>
Reviewed-by: Bill Fischofer <bill.fischofer@linaro.org>
Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
  • Loading branch information
MatiasElo authored and muvarov committed Oct 11, 2018
1 parent ad7a654 commit 35265db
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions platform/linux-generic/pktio/dpdk.c
Expand Up @@ -455,7 +455,8 @@ static struct rte_mempool *pool_create(pool_t *pool)
}

snprintf(pool_name, sizeof(pool_name),
"dpdk_pktpool_%" PRIu32 "", pool->pool_idx);
"dpdk_pktpool_%" PRIu32 "_%" PRIu32 "", odp_global_ro.main_pid,
pool->pool_idx);
pkt_pool = mbuf_pool_create(pool_name, pool);

if (pkt_pool == NULL) {
Expand Down Expand Up @@ -1174,15 +1175,17 @@ static int dpdk_pktio_init(void)
cmdline = "";

/* masklen includes the terminating null as well */
cmd_len = strlen("odpdpdk -c --socket-mem ") + masklen +
strlen(mem_str) + strlen(cmdline) + strlen(" ");
cmd_len = snprintf(NULL, 0, "odpdpdk --file-prefix %" PRIu32 "_ "
"--proc-type auto -c %s --socket-mem %s %s ",
odp_global_ro.main_pid, mask_str, mem_str, cmdline);

char full_cmd[cmd_len];

/* first argument is facility log, simply bind it to odpdpdk for now.*/
cmd_len = snprintf(full_cmd, cmd_len,
"odpdpdk -c %s --socket-mem %s %s", mask_str,
mem_str, cmdline);
"odpdpdk --file-prefix %" PRIu32 "_ "
"--proc-type auto -c %s --socket-mem %s %s ",
odp_global_ro.main_pid, mask_str, mem_str, cmdline);

for (i = 0, dpdk_argc = 1; i < cmd_len; ++i) {
if (isspace(full_cmd[i]))
Expand Down

0 comments on commit 35265db

Please sign in to comment.