DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Pattan, Reshma" <reshma.pattan@intel.com>
To: "Sevincer, Abdullah" <abdullah.sevincer@intel.com>,
	"dev@dpdk.org" <dev@dpdk.org>
Cc: "jerinj@marvell.com" <jerinj@marvell.com>
Subject: RE: [PATCH v14] app/procinfo: display eventdev xstats
Date: Wed, 24 May 2023 15:09:52 +0000	[thread overview]
Message-ID: <BYAPR11MB336673C2EAD6069F6FC65629FF419@BYAPR11MB3366.namprd11.prod.outlook.com> (raw)
In-Reply-To: <20230517223724.2417630-1-abdullah.sevincer@intel.com>



> -----Original Message-----
> From: Sevincer, Abdullah <abdullah.sevincer@intel.com>

The code looks better now, however if you can make below changes that would be great.

> +
> +struct eventdev_params {
> +	uint32_t show_eventdev;

Can't we get rid of the "show_eventdev",  and just rely below flags 

<snip>
> +	uint8_t num_queues;
> +	uint8_t num_ports;
> +	uint32_t shw_all_queues;
> +	uint32_t shw_all_ports;
> +	uint32_t dump_xstats;
> +	uint32_t reset_xstats;
> +	uint32_t shw_device_xstats;


> +parse_eventdev_dump_xstats_params(char *list) {
<snip>
> +
> +	if (!eventdev_var[evdev_id].show_eventdev)
> +		eventdev_var[evdev_id].show_eventdev = 1;

You can set the " eventdev_var[evdev_id].show_eventdev = 1;" without  the if check.  Here and in other places.
However , you don't need to have  show_eventdev=1. You can  think of getting rid of the "show_eventdev" altogether. Here and other places.


<snip>

> +parse_eventdev_port_xstats_params(char *list) {
> +	uint8_t port_id;
> +	uint8_t evdev_id;
> +	if (sscanf(list, "*:%hhu", &evdev_id) == 1) {
> +		if (evdev_id >= RTE_EVENT_MAX_DEVS) {
> +			printf("Invalid eventdev id, id should be between 0 -
> %d\n",

Do you need to validate the port id and queue ids here and in below functions.

<snip>

> +xstats_display(uint8_t dev_id,
> +	  enum rte_event_dev_xstats_mode mode,
> +	  uint8_t queue_port_id)
> +{
> +	int ret;
> +	struct rte_event_dev_xstats_name *xstats_names;
> +	uint64_t *ids;
> +	uint64_t *values;
> +	unsigned int size;
> +	int i;
> +
> +	size = xstats_get_names_and_ids_size(dev_id, mode, queue_port_id);


> +
> +	if (size == 0) {
> +		printf(
> +		"No stats available for this item, mode=%d,
> queue_port_id=%d\n",
> +			mode, queue_port_id);
> +		return;
> +	}
> +
> +	/* Get memory to hold stat names, IDs, and values */
> +	xstats_names = malloc(sizeof(struct rte_event_dev_xstats_name) *
> size);
> +	ids = malloc(sizeof(unsigned int) * size);
> +
> +	if (!xstats_names || !ids)
> +		rte_panic("unable to alloc memory for stats retrieval\n");
> +
> +	ret = rte_event_dev_xstats_names_get(dev_id, mode, queue_port_id,
> +					     xstats_names, ids,
> +					     size);

You need size in unsigned int form  only to pass to the function rte_event_dev_xstats_names_get() , so why not use unsigned int(size) here  and remove 
the cast of size in function xstats_get_names_and_ids_size(). 

 I also feel you don't need xstats_get_names_and_ids_size(), just call rte_event_dev_xstats_names_get() directly in this function , to get the size in int, use int size everywhere else, 
and use it with cast  while passing to rte_event_dev_xstats_names_get() again. It makes easy to follow the code .

This way You no need to do (int)size in below code too.


> +	if (ret != (int)size)
> +		rte_panic("rte_event_dev_xstats_names_get err %d\n", ret);


<snip>


> +
> +A typical command line usage for eventdev stats:
> +
> +    .. code-block:: console
> +
> +       ./dpdk-proc-info -- --show-edev-port-xstats=1:0

If you want to provide the command examples,  you can give example under each command section, else you can remove this as well.


  parent reply	other threads:[~2023-05-24 15:10 UTC|newest]

Thread overview: 55+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-09 15:30 [PATCH] app/eventdev_dump: introduce eventdev_dump application Timothy McDaniel
2022-04-10  6:48 ` Jerin Jacob
2022-04-10 13:18   ` McDaniel, Timothy
2023-02-06 18:34 ` [PATCH v2] app/procinfo: display eventdev xstats for PMD data Abdullah Sevincer
2023-02-06 23:05 ` [PATCH v3] " Abdullah Sevincer
2023-02-07  0:22   ` Stephen Hemminger
2023-02-12 19:43     ` Sevincer, Abdullah
2023-02-17 15:58       ` Sevincer, Abdullah
2023-02-17 16:33         ` Stephen Hemminger
2023-02-22  1:54           ` Sevincer, Abdullah
2023-02-07  0:04 ` [PATCH v4] " Abdullah Sevincer
2023-02-07 16:33 ` [PATCH v5] " Abdullah Sevincer
2023-02-23  1:08 ` [PATCH v6] " Abdullah Sevincer
2023-02-27 16:33   ` Jerin Jacob
2023-03-03 10:58   ` Pattan, Reshma
2023-03-03 16:22     ` Sevincer, Abdullah
2023-03-04  7:17       ` Pattan, Reshma
2023-03-09 18:27   ` [PATCH v7] app/procinfo: display eventdev xstats Abdullah Sevincer
2023-03-09 20:31     ` Stephen Hemminger
2023-03-10 17:35       ` Sevincer, Abdullah
2023-03-10 17:49         ` Stephen Hemminger
2023-03-10 18:06           ` Sevincer, Abdullah
2023-03-09 18:51   ` [PATCH v8] " Abdullah Sevincer
2023-03-15 11:56     ` Pattan, Reshma
2023-03-15 19:40       ` Sevincer, Abdullah
2023-03-15 14:24     ` Pattan, Reshma
2023-03-18 18:49       ` Sevincer, Abdullah
2023-03-20  2:11     ` [PATCH v9] " Abdullah Sevincer
2023-03-20  2:15     ` [PATCH v10] " Abdullah Sevincer
2023-03-20  2:19     ` [PATCH v11] " Abdullah Sevincer
2023-03-20  2:23     ` [PATCH v12] " Abdullah Sevincer
2023-03-20 17:29       ` Pattan, Reshma
2023-03-20 18:01         ` Sevincer, Abdullah
2023-03-20 18:35         ` Sevincer, Abdullah
2023-03-21  9:37           ` Pattan, Reshma
2023-03-21 10:20             ` Sevincer, Abdullah
2023-03-21 10:27               ` Pattan, Reshma
2023-05-17 21:22       ` [PATCH v13] " Abdullah Sevincer
2023-05-17 22:37       ` [PATCH v14] " Abdullah Sevincer
2023-05-17 22:45         ` Stephen Hemminger
2023-05-17 23:30           ` Sevincer, Abdullah
2023-05-24 15:09         ` Pattan, Reshma [this message]
2023-05-25  6:08         ` [PATCH v15] " Abdullah Sevincer
2023-05-25 15:24           ` Stephen Hemminger
2023-05-25 16:41         ` [PATCH v16] " Abdullah Sevincer
2023-05-25 17:35           ` Stephen Hemminger
2023-05-25 17:56             ` Sevincer, Abdullah
2023-05-25 18:47           ` [PATCH v17] " Abdullah Sevincer
2023-05-25 20:07             ` Stephen Hemminger
2023-07-07  9:15               ` Thomas Monjalon
2023-07-07 14:55                 ` Stephen Hemminger
2023-07-08 15:11                   ` Sevincer, Abdullah
2023-07-08 15:26                     ` Stephen Hemminger
2023-05-26  8:32             ` Pattan, Reshma
2023-06-08 17:35             ` Sevincer, Abdullah

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=BYAPR11MB336673C2EAD6069F6FC65629FF419@BYAPR11MB3366.namprd11.prod.outlook.com \
    --to=reshma.pattan@intel.com \
    --cc=abdullah.sevincer@intel.com \
    --cc=dev@dpdk.org \
    --cc=jerinj@marvell.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).