[dpdk-dev] [PATCH v3 4/5] telemetry: implement empty stubs for Windows

Fady Bader fady at mellanox.com
Tue Aug 4 08:05:48 CEST 2020



> -----Original Message-----
> From: Narcisa Ana Maria Vasile <navasile at linux.microsoft.com>
> Sent: Tuesday, August 4, 2020 4:27 AM
> To: Fady Bader <fady at mellanox.com>
> Cc: dev at dpdk.org; Thomas Monjalon <thomas at monjalon.net>; Tasnim Bashar
> <tbashar at mellanox.com>; Tal Shnaiderman <talshn at mellanox.com>; Yohad Tor
> <yohadt at mellanox.com>; dmitry.kozliuk at gmail.com;
> harini.ramakrishnan at microsoft.com; ocardona at microsoft.com;
> pallavi.kadam at intel.com; ranjit.menon at intel.com; kevin.laatz at intel.com;
> ferruh.yigit at intel.com; arybchenko at solarflare.com; ciara.power at intel.com
> Subject: Re: [PATCH v3 4/5] telemetry: implement empty stubs for Windows
> 
> 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 <fady at mellanox.com>
> > ---
> >  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'
> 

OK.

> > +#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).

Ok, I'll send a new patch soon.

> >  }
> >
> > +#ifndef RTE_EXEC_ENV_WINDOWS


More information about the dev mailing list