[dpdk-dev] [PATCH v5 0/6] Improvements for DPDK IPC

Anatoly Burakov anatoly.burakov at intel.com
Wed Mar 7 17:56:47 CET 2018


This is an assortment of loosely related improvements to IPC, mostly
related to handling corner cases and avoiding race conditions.

Main addition is an attempt to avoid undefined behavior when receiving
messages while secondary process is initializing. It is assumed that
once callback is registered, it is safe to receive messages.

If the callback wasn't registered, then there are two choices - either
we haven't reached the stage where we register this callback (init is
not finished), or user has forgotten to register callback for this
message. The latter can only be known once initialization is complete,
so until init is complete, treat this process as not-existing if there
is no registered callback for the message. This will handle both
scenarios.

v5: - added cover-letter :)
    - drop the "don't send messages to processes which haven't finished
      initializing" model added in previous version. instead, allow
      everyone to receive all messages, but check if initialization is
      completed, and check if there is a callback registered for this
      message. if there is no callback, assume we just didn't get around
      to it yet, so just send a special message to the requestor that
      it should treat this process as if it wasn't there.
v4: - make init_complete volatile
    - changed from "don't process messages until init complete" to
      "don't send messages to processes which haven't finished
      initializing", as the former would have resulted in timeouts if
      init took too long to complete
    - fixed resource leaks
    - added patch to simplify IPC timeouts handling
v3: - move init_complete until after receiving message
v2: - added patch to prevent IPC from sending messages while primary
      is initializing
    - added patch to generate filter from eal_mp_socket_path() instead
      of hardcoding the value

Anatoly Burakov (6):
  eal: add internal flag indicating init has completed
  eal: abstract away IPC socket path generation
  eal: don't hardcode socket filter value in IPC
  eal: lock IPC directory on init and send
  eal: simplify IPC sync request timeout code
  eal: ignore messages until init is complete

 lib/librte_eal/common/eal_common_options.c |   1 +
 lib/librte_eal/common/eal_common_proc.c    | 382 +++++++++++++++++------------
 lib/librte_eal/common/eal_internal_cfg.h   |   2 +
 lib/librte_eal/linuxapp/eal/eal.c          |   2 +
 4 files changed, 228 insertions(+), 159 deletions(-)

-- 
2.7.4


More information about the dev mailing list