telemetry: add extra log message on socket bind failure
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>
This commit is contained in:
parent
ce382fdddb
commit
d5252f7d4b
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user