From: Bruce Richardson <bruce.richardson@intel.com>
To: dev@dpdk.org
Cc: "Bruce Richardson" <bruce.richardson@intel.com>,
"David Marchand" <david.marchand@redhat.com>,
"Morten Brørup" <mb@smartsharesystems.com>,
"Ciara Power" <ciara.power@intel.com>
Subject: [dpdk-dev] [PATCH v3 2/2] telemetry: add extra log message on socket bind failure
Date: Wed, 7 Jul 2021 13:52:55 +0100 [thread overview]
Message-ID: <20210707125255.664793-2-bruce.richardson@intel.com> (raw)
In-Reply-To: <20210707125255.664793-1-bruce.richardson@intel.com>
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 <bruce.richardson@intel.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
Acked-by: Morten Brørup <mb@smartsharesystems.com>
Acked-by: Ciara Power <ciara.power@intel.com>
---
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 <pthread.h>
#include <sys/socket.h>
#include <sys/un.h>
+#include <sys/stat.h>
#include <dlfcn.h>
#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.30.2
next prev parent reply other threads:[~2021-07-07 12:53 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-07-01 9:34 [dpdk-dev] [PATCH] eal: create runtime dir even when shared data is not used Bruce Richardson
2021-07-01 14:43 ` Morten Brørup
2021-07-01 14:56 ` Bruce Richardson
2021-07-02 12:55 ` [dpdk-dev] [PATCH v2 1/2] " Bruce Richardson
2021-07-02 12:55 ` [dpdk-dev] [PATCH v2 2/2] telemetry: add extra log message on socket bind failure Bruce Richardson
2021-07-02 14:22 ` Morten Brørup
2021-07-05 10:16 ` Power, Ciara
2021-07-05 14:11 ` David Marchand
2021-07-02 14:21 ` [dpdk-dev] [PATCH v2 1/2] eal: create runtime dir even when shared data is not used Morten Brørup
2021-07-05 14:11 ` David Marchand
2021-07-05 14:39 ` Bruce Richardson
2021-07-07 12:35 ` David Marchand
2021-07-07 12:41 ` Bruce Richardson
2021-07-07 19:02 ` Tyler Retzlaff
2021-07-07 12:52 ` [dpdk-dev] [PATCH v3 " Bruce Richardson
2021-07-07 12:52 ` Bruce Richardson [this message]
2021-07-07 15:00 ` David Marchand
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210707125255.664793-2-bruce.richardson@intel.com \
--to=bruce.richardson@intel.com \
--cc=ciara.power@intel.com \
--cc=david.marchand@redhat.com \
--cc=dev@dpdk.org \
--cc=mb@smartsharesystems.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).