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 B5032A0C4A; Wed, 7 Jul 2021 14:53:13 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id BC75741512; Wed, 7 Jul 2021 14:53:12 +0200 (CEST) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by mails.dpdk.org (Postfix) with ESMTP id CA3A541391 for ; Wed, 7 Jul 2021 14:53:08 +0200 (CEST) X-IronPort-AV: E=McAfee;i="6200,9189,10037"; a="273139818" X-IronPort-AV: E=Sophos;i="5.83,331,1616482800"; d="scan'208";a="273139818" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Jul 2021 05:53:04 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.83,331,1616482800"; d="scan'208";a="628021421" Received: from silpixa00399126.ir.intel.com ([10.237.223.29]) by orsmga005.jf.intel.com with ESMTP; 07 Jul 2021 05:53:02 -0700 From: Bruce Richardson To: dev@dpdk.org Cc: Bruce Richardson , =?UTF-8?q?Morten=20Br=C3=B8rup?= , David Marchand Date: Wed, 7 Jul 2021 13:52:54 +0100 Message-Id: <20210707125255.664793-1-bruce.richardson@intel.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210701093456.43426-1-bruce.richardson@intel.com> References: <20210701093456.43426-1-bruce.richardson@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH v3 1/2] eal: create runtime dir even when shared data is not used 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" When multi-process is not wanted and DPDK is run with the "no-shconf" flag, the telemetry library still needs a runtime directory to place the unix socket for telemetry connections. Therefore, rather than not creating the directory when this flag is set, we can change the code to attempt the creation anyway, but not error out if it fails. If it succeeds, then telemetry will be available, but if it fails, the rest of DPDK will run without telemetry. This ensures that the "in-memory" flag will allow DPDK to run even if the whole filesystem is read-only, for example. Signed-off-by: Bruce Richardson Reviewed-by: Morten Brørup Reviewed-by: David Marchand --- V3: added freebsd EAL changes. --- lib/eal/freebsd/eal.c | 14 ++++++++------ lib/eal/linux/eal.c | 14 ++++++++------ 2 files changed, 16 insertions(+), 12 deletions(-) diff --git a/lib/eal/freebsd/eal.c b/lib/eal/freebsd/eal.c index f4d1676754..6cee5ae369 100644 --- a/lib/eal/freebsd/eal.c +++ b/lib/eal/freebsd/eal.c @@ -575,12 +575,14 @@ eal_parse_args(int argc, char **argv) } } - /* create runtime data directory */ - if (internal_conf->no_shconf == 0 && - eal_create_runtime_dir() < 0) { - RTE_LOG(ERR, EAL, "Cannot create runtime directory\n"); - ret = -1; - goto out; + /* create runtime data directory. In no_shconf mode, skip any errors */ + if (eal_create_runtime_dir() < 0) { + if (internal_conf->no_shconf == 0) { + RTE_LOG(ERR, EAL, "Cannot create runtime directory\n"); + ret = -1; + goto out; + } else + RTE_LOG(WARNING, EAL, "No DPDK runtime directory created\n"); } if (eal_adjust_config(internal_conf) != 0) { diff --git a/lib/eal/linux/eal.c b/lib/eal/linux/eal.c index ba19fc6347..3577eaeaa4 100644 --- a/lib/eal/linux/eal.c +++ b/lib/eal/linux/eal.c @@ -838,12 +838,14 @@ eal_parse_args(int argc, char **argv) } } - /* create runtime data directory */ - if (internal_conf->no_shconf == 0 && - eal_create_runtime_dir() < 0) { - RTE_LOG(ERR, EAL, "Cannot create runtime directory\n"); - ret = -1; - goto out; + /* create runtime data directory. In no_shconf mode, skip any errors */ + if (eal_create_runtime_dir() < 0) { + if (internal_conf->no_shconf == 0) { + RTE_LOG(ERR, EAL, "Cannot create runtime directory\n"); + ret = -1; + goto out; + } else + RTE_LOG(WARNING, EAL, "No DPDK runtime directory created\n"); } if (eal_adjust_config(internal_conf) != 0) { -- 2.30.2