On Thu, 25 May 2023 01:08:51 -0500 Abdullah Sevincer <abdullah.sevin...@intel.com> wrote:
> This commit extends proc-info application to > display xstats for the eventdev devices. > > New command line arguments are introduced to > display xstats for eventdev devices. The command > example is like: > > For displaying a specific port stats (e.g. port 1): > ./dpdk-proc-info -- --show-edev-port-xstats=1:0 > > If any xstats parameters for eventdev passed through > proc-info command line, proc-info will only display > requested eventdev data and exit. > > Users should not pass any eventdev xstats parameters > if they desire to dump other proc-info data such as > Rx/Tx descriptor dump. > More information can be found in proc-info app doc. > > Signed-off-by: Abdullah Sevincer <abdullah.sevin...@intel.com> > --- Looks good, here are some minor touchup feedbacks. > +static int > +parse_eventdev_reset_xstats_params(char *list) Could be "const char *list" here > +{ > + uint16_t evdev_id; > + > + if (sscanf(list, "%hu", &evdev_id) == 1) { sscanf has less error checking than other methods. It also allows inputs like "0A" to be confused as 0 followed by A ignored. Better to use strtoul() and have one fuction rather than copy paste the same code in three places. > + if (evdev_id >= RTE_EVENT_MAX_DEVS) { > + printf("Invalid eventdev id: %d\n", evdev_id); > + return -EINVAL; > + } > + } > + > + eventdev_var[evdev_id].reset_xstats = 1; > + > + if (evdev_id >= rte_event_dev_count()) > + rte_panic("invalid event device %hu\n", evdev_id); > + > + return 0; > +} > +