From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id A9724A053A; Tue, 4 Aug 2020 03:26:53 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id DDAF129D2; Tue, 4 Aug 2020 03:26:52 +0200 (CEST) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by dpdk.org (Postfix) with ESMTP id 4AAC1F04 for ; Tue, 4 Aug 2020 03:26:51 +0200 (CEST) Received: by linux.microsoft.com (Postfix, from userid 1059) id 7406420B4908; Mon, 3 Aug 2020 18:26:50 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 7406420B4908 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1596504410; bh=VjMe9Qi0zPNaaI5f1Po8o93nulXAt5+bacvsWmMv61c=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=YXTnY5corXSc7h/9OOJdpvXXwHnvM6TH5OYt+jBbcWjEPEMXR409x7s2BAdvhAMVK 0tYNg8T7b2zDl6oH2J622IH4KaHUx5F70tda9I8+csILgBS6aEsAMHKHWJNVe+pEYU MI87UwpC42+0Ctv5rNBkRCcRP8wDGvw7lmcwV2zg= Date: Mon, 3 Aug 2020 18:26:50 -0700 From: Narcisa Ana Maria Vasile To: Fady Bader Cc: dev@dpdk.org, thomas@monjalon.net, tbashar@mellanox.com, talshn@mellanox.com, yohadt@mellanox.com, dmitry.kozliuk@gmail.com, harini.ramakrishnan@microsoft.com, ocardona@microsoft.com, pallavi.kadam@intel.com, ranjit.menon@intel.com, kevin.laatz@intel.com, ferruh.yigit@intel.com, arybchenko@solarflare.com, ciara.power@intel.com Message-ID: <20200804012650.GA127568@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net> References: <20200625133038.25180-1-fady@mellanox.com> <20200803103843.6928-1-fady@mellanox.com> <20200803103843.6928-5-fady@mellanox.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200803103843.6928-5-fady@mellanox.com> User-Agent: Mutt/1.5.21 (2010-09-15) Subject: Re: [dpdk-dev] [PATCH v3 4/5] telemetry: implement empty stubs for Windows X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 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" On Mon, Aug 03, 2020 at 01:38:42PM +0300, Fady Bader wrote: > Telemetry didn't compile under Windows. > Empty stubs implementation was added for Windows. > > Signed-off-by: Fady Bader > --- > lib/librte_telemetry/rte_telemetry.h | 4 +++ > lib/librte_telemetry/telemetry.c | 52 ++++++++++++++++++++++++++++++++- > lib/librte_telemetry/telemetry_legacy.c | 26 ++++++++++++++++- > 3 files changed, 80 insertions(+), 2 deletions(-) > > + > +#ifndef RTE_EXEC_ENV_WINDOWS > /* list of command callbacks, with one command registered by default */ > static struct cmd_callback callbacks[TELEMETRY_MAX_CALLBACKS]; > static int num_callbacks; /* How many commands are registered */ > /* Used when accessing or modifying list of command callbacks */ > static rte_spinlock_t callback_sl = RTE_SPINLOCK_INITIALIZER; > static uint16_t v2_clients; > +int Remove 'int' > +#endif > > int > rte_telemetry_register_cmd(const char *cmd, telemetry_cb fn, const char *help) > { > +#ifndef RTE_EXEC_ENV_WINDOWS > + > int i = 0; > > if (strlen(cmd) >= MAX_CMD_LEN || fn == NULL || cmd[0] != '/' > @@ -76,8 +98,19 @@ rte_telemetry_register_cmd(const char *cmd, telemetry_cb fn, const char *help) > rte_spinlock_unlock(&callback_sl); > > return 0; > + > +#else > + > + RTE_SET_USED(cmd); > + RTE_SET_USED(fn); > + RTE_SET_USED(help); > + > + return 0; > + > +#endif Maybe add a comment like /* RTE_EXEC_ENV_WINDOWS */ next to each #else/#endif, to be easier to follow what's being guarded out. Your guards are rather small, so it's easy to follow, but sometimes when big chunks of code are being guarded, it's harder to tell what the guard was for (e.g. line 446 it's the end of a big #ifdef/#endif). > } > > +#ifndef RTE_EXEC_ENV_WINDOWS