From patchwork Thu Jul 1 09:34:56 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bruce Richardson X-Patchwork-Id: 95111 X-Patchwork-Delegate: david.marchand@redhat.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 97FB5A0A0C; Thu, 1 Jul 2021 11:35:04 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6294B40141; Thu, 1 Jul 2021 11:35:04 +0200 (CEST) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by mails.dpdk.org (Postfix) with ESMTP id 61D8040040 for ; Thu, 1 Jul 2021 11:35:02 +0200 (CEST) X-IronPort-AV: E=McAfee;i="6200,9189,10031"; a="188888237" X-IronPort-AV: E=Sophos;i="5.83,313,1616482800"; d="scan'208";a="188888237" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Jul 2021 02:35:01 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.83,313,1616482800"; d="scan'208";a="644389173" Received: from silpixa00399126.ir.intel.com ([10.237.223.29]) by fmsmga005.fm.intel.com with ESMTP; 01 Jul 2021 02:35:00 -0700 From: Bruce Richardson To: dev@dpdk.org Cc: anatoly.burakov@intel.com, Bruce Richardson Date: Thu, 1 Jul 2021 10:34:56 +0100 Message-Id: <20210701093456.43426-1-bruce.richardson@intel.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH] 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 --- lib/eal/linux/eal.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/eal/linux/eal.c b/lib/eal/linux/eal.c index ba19fc6347..1e05ba3847 100644 --- a/lib/eal/linux/eal.c +++ b/lib/eal/linux/eal.c @@ -838,9 +838,8 @@ eal_parse_args(int argc, char **argv) } } - /* create runtime data directory */ - if (internal_conf->no_shconf == 0 && - eal_create_runtime_dir() < 0) { + /* create runtime data directory. In no_shconf mode, skip any errors */ + if (eal_create_runtime_dir() < 0 && internal_conf->no_shconf == 0) { RTE_LOG(ERR, EAL, "Cannot create runtime directory\n"); ret = -1; goto out; From patchwork Wed Jul 7 12:52:55 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Bruce Richardson X-Patchwork-Id: 95501 X-Patchwork-Delegate: david.marchand@redhat.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 76703A0C4A; Wed, 7 Jul 2021 14:53:09 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 59F5B413A8; Wed, 7 Jul 2021 14:53:09 +0200 (CEST) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by mails.dpdk.org (Postfix) with ESMTP id 3116C41391 for ; Wed, 7 Jul 2021 14:53:08 +0200 (CEST) X-IronPort-AV: E=McAfee;i="6200,9189,10037"; a="273139837" X-IronPort-AV: E=Sophos;i="5.83,331,1616482800"; d="scan'208";a="273139837" 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:05 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.83,331,1616482800"; d="scan'208";a="628021431" Received: from silpixa00399126.ir.intel.com ([10.237.223.29]) by orsmga005.jf.intel.com with ESMTP; 07 Jul 2021 05:53:04 -0700 From: Bruce Richardson To: dev@dpdk.org Cc: Bruce Richardson , David Marchand , =?utf-8?q?Morten_Br=C3=B8rup?= , Ciara Power Date: Wed, 7 Jul 2021 13:52:55 +0100 Message-Id: <20210707125255.664793-2-bruce.richardson@intel.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210707125255.664793-1-bruce.richardson@intel.com> References: <20210701093456.43426-1-bruce.richardson@intel.com> <20210707125255.664793-1-bruce.richardson@intel.com> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v3 2/2] telemetry: add extra log message on socket bind failure 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" If the library fails to create the needed socket, add an additional check to report if the error is due to a missing DPDK runtime dir. Signed-off-by: Bruce Richardson Reviewed-by: David Marchand Acked-by: Morten Brørup Acked-by: Ciara Power --- lib/telemetry/telemetry.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/telemetry/telemetry.c b/lib/telemetry/telemetry.c index 6baba57ec2..8665db8d03 100644 --- a/lib/telemetry/telemetry.c +++ b/lib/telemetry/telemetry.c @@ -7,6 +7,7 @@ #include #include #include +#include #include #endif /* !RTE_EXEC_ENV_WINDOWS */ @@ -422,7 +423,11 @@ create_socket(char *path) strlcpy(sun.sun_path, path, sizeof(sun.sun_path)); unlink(sun.sun_path); if (bind(sock, (void *) &sun, sizeof(sun)) < 0) { + struct stat st; + TMTY_LOG(ERR, "Error binding socket: %s\n", strerror(errno)); + if (stat(socket_dir, &st) < 0 || !S_ISDIR(st.st_mode)) + TMTY_LOG(ERR, "Cannot access DPDK runtime directory: %s\n", socket_dir); sun.sun_path[0] = 0; goto error; }