From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 7FBD5A0A0C; Fri, 2 Jul 2021 16:23:02 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6479741363; Fri, 2 Jul 2021 16:23:02 +0200 (CEST) Received: from smartserver.smartsharesystems.com (smartserver.smartsharesystems.com [77.243.40.215]) by mails.dpdk.org (Postfix) with ESMTP id 6140841353 for ; Fri, 2 Jul 2021 16:23:01 +0200 (CEST) Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Date: Fri, 2 Jul 2021 16:22:59 +0200 Message-ID: <98CBD80474FA8B44BF855DF32C47DC35C618D8@smartserver.smartshare.dk> In-Reply-To: <20210702125554.606364-2-bruce.richardson@intel.com> X-MimeOLE: Produced By Microsoft Exchange V6.5 X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [dpdk-dev] [PATCH v2 2/2] telemetry: add extra log message on socket bind failure Thread-Index: AddvQa+F2o7cRAZfRGaxYTaM9WpNIQADArNA References: <20210701093456.43426-1-bruce.richardson@intel.com> <20210702125554.606364-1-bruce.richardson@intel.com> <20210702125554.606364-2-bruce.richardson@intel.com> From: =?iso-8859-1?Q?Morten_Br=F8rup?= To: "Bruce Richardson" , Cc: "Ciara Power" Subject: Re: [dpdk-dev] [PATCH v2 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" > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Bruce Richardson > Sent: Friday, 2 July 2021 14.56 >=20 > 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. >=20 > Signed-off-by: Bruce Richardson > --- > lib/telemetry/telemetry.c | 5 +++++ > 1 file changed, 5 insertions(+) >=20 > 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 */ >=20 > @@ -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] =3D 0; > goto error; > } > -- > 2.30.2 >=20 Acked-by: Morten Br=F8rup