eal: add directory for runtime data
authorAnatoly Burakov <anatoly.burakov@intel.com>
Mon, 14 May 2018 16:27:41 +0000 (17:27 +0100)
committerThomas Monjalon <thomas@monjalon.net>
Mon, 14 May 2018 22:35:08 +0000 (00:35 +0200)
commit56236363b481e680f12dec97e48182a2cdbd3110
tree4be47279bde41f946d8422eaf908386bdfe11b59
parenta2a2e499e511d23fb1e0f2ca003baea2cf0937c5
eal: add directory for runtime data

Currently, during runtime, DPDK will store a bunch of files here
and there (in /var/run, /tmp or in $HOME). Fix it by creating a
DPDK-specific runtime directory, under which all runtime data
will be placed. The template for creating this runtime directory
is the following:

  <base path>/dpdk/<DPDK prefix>/

Where <base path> is set to either "/var/run" if run as root, or
$XDG_RUNTIME_DIR if run as non-root, with a fallback to /tmp if
$XDG_RUNTIME_DIR is not defined. So, for example, if run as root,
by default all runtime data will be stored at /var/run/dpdk/rte/.

There is no equivalent of "mkdir -p", so we will be creating the
path step by step.

Nothing uses this new path yet, changes for that will come in
next commit.

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Reviewed-by: Reshma Pattan <reshma.pattan@intel.com>
lib/librte_eal/bsdapp/eal/eal.c
lib/librte_eal/common/eal_filesystem.h
lib/librte_eal/linuxapp/eal/eal.c