From d5252f7d4b2838ac31d78b6352ceda4bd40a3b75 Mon Sep 17 00:00:00 2001 From: Bruce Richardson Date: Wed, 7 Jul 2021 13:52:55 +0100 Subject: [PATCH] telemetry: add extra log message on socket bind failure MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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; } -- 2.20.1