Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D6C63C11F68 for ; Fri, 2 Jul 2021 14:23:03 +0000 (UTC) Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by mail.kernel.org (Postfix) with ESMTP id 5222461432 for ; Fri, 2 Jul 2021 14:23:03 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5222461432 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=smartsharesystems.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=dev-bounces@dpdk.org 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