[PATCH v8 21/21] net/cpfl: add xstats ops

Liu, Mingxia mingxia.liu at intel.com
Thu Mar 2 12:19:53 CET 2023



> -----Original Message-----
> From: Ferruh Yigit <ferruh.yigit at amd.com>
> Sent: Thursday, March 2, 2023 5:30 PM
> To: Liu, Mingxia <mingxia.liu at intel.com>; dev at dpdk.org; Xing, Beilei
> <beilei.xing at intel.com>; Zhang, Yuying <yuying.zhang at intel.com>
> Subject: Re: [PATCH v8 21/21] net/cpfl: add xstats ops
> 
> On 3/2/2023 10:35 AM, Mingxia Liu wrote:
> > Add support for these device ops:
> > - dev_xstats_get
> > - dev_xstats_get_names
> > - dev_xstats_reset
> >
> > Signed-off-by: Mingxia Liu <mingxia.liu at intel.com>
> 
> <...>
> 
> > +static int cpfl_dev_xstats_get_names(__rte_unused struct rte_eth_dev
> *dev,
> > +				     struct rte_eth_xstat_name
> *xstats_names,
> > +				     __rte_unused unsigned int limit) {
> > +	unsigned int i;
> > +
> > +	if (xstats_names)
> > +		for (i = 0; i < CPFL_NB_XSTATS; i++) {
> > +			snprintf(xstats_names[i].name,
> > +				 sizeof(xstats_names[i].name),
> > +				 "%s", rte_cpfl_stats_strings[i].name);
> > +		}
> 
> 
> Although above is correct, can you please add {}, it is safer to do it for multi
> line blocks.
[Liu, Mingxia] ok, I'll add nexr version.


More information about the dev mailing list