OpenDataPlane / odp

The ODP project is an open-source, cross-platform set of application programming interfaces (APIs) for the networking data plane

Home Page:https://opendataplane.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ERR: odp_init.c:617:odp_init_local(): odp_init_local() called multiple times by the same thread

LinArcX opened this issue · comments

I have a huge multithread application and I try to to integrate odp into it. this is my first try for integration:

  if (0 == odp_init_global(&instance, NULL, NULL)) {
    printf("odp_init_global: success!\n");
 
    if (0 == odp_init_local(instance, ODP_THREAD_CONTROL)) {
      printf("odp_init_local: success!\n");
      ofp_init_global_param(&app_init_params);
    }
    else {
      printf("Error: ODP local init failed.\n");
      odp_term_global(instance);
    }
  }
  else {
    printf("Error: ODP global init failed.\n");
  }
  

But if I run my application, I will get this error:

odp_init_global: success!
ERR: odp_init.c:617:odp_init_local(): odp_init_local() called multiple times by the same thread
Error: ODP local init failed.

Do you have any idea?

Hello @LinArcX,

have you tried with a debugger to see if odp_init_local() is indeed called multiple times in some thread? For example, odph_thread_create() will call the local init internally already itself, which might to lead something like this.