DPDK patches and discussions
 help / color / mirror / Atom feed
From: Bruce Richardson <bruce.richardson@intel.com>
To: "Burakov, Anatoly" <anatoly.burakov@intel.com>
Cc: Stephen Hemminger <stephen@networkplumber.org>,
	dev@dpdk.org, Stephen Hemminger <sthemmin@microsoft.com>
Subject: Re: [dpdk-dev] [PATCH] eal: allow user to override DPDK runtime path
Date: Fri, 12 Mar 2021 12:05:48 +0000	[thread overview]
Message-ID: <20210312120548.GA937@bricha3-MOBL.ger.corp.intel.com> (raw)
In-Reply-To: <72b09013-a78c-c8d0-a140-849d5f5a774b@intel.com>

On Fri, Mar 12, 2021 at 10:56:20AM +0000, Burakov, Anatoly wrote:
> On 11-Mar-21 12:13 PM, Bruce Richardson wrote:
> > On Wed, Mar 10, 2021 at 10:33:50AM -0800, Stephen Hemminger wrote:
> > > On Wed, 10 Mar 2021 17:27:17 +0000
> > > Bruce Richardson <bruce.richardson@intel.com> wrote:
> > > 
> > > > On Wed, Mar 10, 2021 at 09:21:37AM -0800, Stephen Hemminger wrote:
> > > > > There can be cases such as containers or other runtime environments
> > > > > where DPDK may not be able to access the default runtime path.
> > > > > This patch introduces DPDK_RUNTIME_DIR as an environment variable
> > > > > to allow controlling and overriding the path.
> > > > > 
> > > > > The example we have is DPDK application running in an untrusted
> > > > > systemd container. In this case, it is not root, and XDG_RUNTIME_DIR
> > > > > is not set (since it is not a user application), and /tmp is
> > > > > blocked. The correct place for this application is to use /run.
> > > > > 
> > > > > In any case, hard coded path assumptions are a problem.
> > > > > 
> > > > > Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
> > > > > ---
> > > > 
> > > > Basic question, if the user/operator can set DPDK_RUNTIME_DIR in the
> > > > container, can they not also set XDG_RUNTIME_DIR?
> > > 
> > > Yes they could, but more about not having hard coded paths.
> > 
> > As far as I can see, you aren't removing the hard-coded path to "/tmp" in
> > your patch, so unless I'm missing something I'm not seeing the significance
> > of the change here? It largely just seems to be adding a new environment
> > variable on top of the existing one, while changing nothing if neither is
> > set.
> > 
> > /Bruce
> > 
> 
> An argument could be made that DPDK_RUNTIME_DIR is DPDK-specific while
> XDG_RUNTIME_DIR is system-wide, so setting up an environment like that is
> more "correct". However, since you can set environment variables per
> executable without affecting the rest of the system, i'm not sure it's worth
> the hassle of adding another variable.
> 

Since some of the concern seems to be around the use of "/tmp" as a
hardcoded path, I would actually suggest that instead of an extra
environment variable we add an EAL flag for the runtime dir. Then we can
fail eal init if XDG_RUNTIME_DIR is not set and if no runtime dir is
specified on cmdline. That would remove any hard-coded paths and gives two
separate ways to set runtime dir, rather than having two options using the
same method.

One final note that whatever the behaviour of EAL is changed to, some
scripts which mimic that behaviour e.g. to find sockets, will also need
updating. "dpdk-telemetry.py" is one that I am aware of anyway.

/Bruce

  reply	other threads:[~2021-03-12 12:05 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-10 17:21 Stephen Hemminger
2021-03-10 17:27 ` Bruce Richardson
2021-03-10 18:33   ` Stephen Hemminger
2021-03-11 12:13     ` Bruce Richardson
2021-03-12 10:56       ` Burakov, Anatoly
2021-03-12 12:05         ` Bruce Richardson [this message]
2021-03-12 12:49           ` Burakov, Anatoly

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210312120548.GA937@bricha3-MOBL.ger.corp.intel.com \
    --to=bruce.richardson@intel.com \
    --cc=anatoly.burakov@intel.com \
    --cc=dev@dpdk.org \
    --cc=stephen@networkplumber.org \
    --cc=sthemmin@microsoft.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).