From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 6DC0AA0547; Fri, 12 Mar 2021 13:05:56 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id EE388160882; Fri, 12 Mar 2021 13:05:55 +0100 (CET) Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by mails.dpdk.org (Postfix) with ESMTP id 26B45406FF for ; Fri, 12 Mar 2021 13:05:53 +0100 (CET) IronPort-SDR: cje6S0dYbGhtj0cAg7YxojyM7r/KB1pz8pktwBzSp7hioB0faU9XuVs+dx599sufpkY4NWEMPI Pf1GBmjP51pA== X-IronPort-AV: E=McAfee;i="6000,8403,9920"; a="186447579" X-IronPort-AV: E=Sophos;i="5.81,243,1610438400"; d="scan'208";a="186447579" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Mar 2021 04:05:53 -0800 IronPort-SDR: LpqgwOe3L/xbuxA/j1xUkW98EkW7X0wHnkNN4UHDEFHQA/WFWAXjgplhRfsvvGwwrToCgZVXzB DRoR8ECRSlvA== X-IronPort-AV: E=Sophos;i="5.81,243,1610438400"; d="scan'208";a="410987827" Received: from bricha3-mobl.ger.corp.intel.com ([10.252.11.209]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-SHA; 12 Mar 2021 04:05:51 -0800 Date: Fri, 12 Mar 2021 12:05:48 +0000 From: Bruce Richardson To: "Burakov, Anatoly" Cc: Stephen Hemminger , dev@dpdk.org, Stephen Hemminger Message-ID: <20210312120548.GA937@bricha3-MOBL.ger.corp.intel.com> References: <20210310172137.59938-1-sthemmin@microsoft.com> <20210310172717.GE1267@bricha3-MOBL.ger.corp.intel.com> <20210310103350.133bfdf2@hermes.local> <20210311121334.GA1509@bricha3-MOBL.ger.corp.intel.com> <72b09013-a78c-c8d0-a140-849d5f5a774b@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <72b09013-a78c-c8d0-a140-849d5f5a774b@intel.com> Subject: Re: [dpdk-dev] [PATCH] eal: allow user to override DPDK runtime path X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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 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 > > > > > --- > > > > > > > > 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