[v3,1/2] eal: create runtime dir even when shared data is not used

Message ID 20210707125255.664793-1-bruce.richardson@intel.com (mailing list archive)
State Accepted, archived
Delegated to: David Marchand
Headers
Series [v3,1/2] eal: create runtime dir even when shared data is not used |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-testing fail Testing issues
ci/iol-abi-testing success Testing PASS
ci/Intel-compilation warning apply issues

Commit Message

Bruce Richardson July 7, 2021, 12:52 p.m. UTC
  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 <bruce.richardson@intel.com>
Reviewed-by: Morten Brørup <mb@smartsharesystems.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
---
V3: added freebsd EAL changes.
---
 lib/eal/freebsd/eal.c | 14 ++++++++------
 lib/eal/linux/eal.c   | 14 ++++++++------
 2 files changed, 16 insertions(+), 12 deletions(-)
  

Comments

David Marchand July 7, 2021, 3 p.m. UTC | #1
On Wed, Jul 7, 2021 at 2:53 PM Bruce Richardson
<bruce.richardson@intel.com> wrote:
>
> 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 <bruce.richardson@intel.com>
> Reviewed-by: Morten Brørup <mb@smartsharesystems.com>
> Reviewed-by: David Marchand <david.marchand@redhat.com>
> ---
> V3: added freebsd EAL changes.

Series applied, thanks.
  

Patch

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) {