DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Varghese, Vipin" <vipin.varghese@intel.com>
To: Hideyuki Yamashita <yamashita.hideyuki@ntt-tx.co.jp>,
	"Tahhan, Maryam" <maryam.tahhan@intel.com>,
	"Pattan, Reshma" <reshma.pattan@intel.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>,
	Hideyuki Yamashita <yamashtia.hideyuki@ntt-tx.co.jp>
Subject: Re: [dpdk-dev] [PATCH 2/5] app/proc-info: add to use apistats
Date: Sat, 5 Dec 2020 13:15:57 +0000	[thread overview]
Message-ID: <MWHPR11MB158158B2FBD826510D1680CA90F00@MWHPR11MB1581.namprd11.prod.outlook.com> (raw)
In-Reply-To: <20201204075109.14694-3-yamashita.hideyuki@ntt-tx.co.jp>

snipped
>  		"  --xstats-ids IDLIST: to display xstat values by id. "
>  			"The argument is comma-separated list of xstat ids to
> print out.\n"
> +		"  --apistats: to display api statistics, disabled by default\n"
As per the code base the logic ` rte_apicounts->rx_burst_counts[lcore_id]++; and rte_apicounts->tx_burst_counts[lcore_id]++;`. This expect `apistats_init` isn primary before `proc-info`. So I have 2 quereies

1. with this logic does all dpdk-examples will be updated to invoke `apistats_init`?
2. what is mechanism in place to inform all dpdk user that `just like rte_eal_init one has to explicitly invoke apistats_init too`?

since I am not clear with the code flow, please feel free to explain the logic or expectation.

snipped
> 
> +static void
> +display_apistats(void)
> +{
> +	static const char *api_stats_border = "########################";
> +	uint16_t i;
> +	struct rte_apistats t0_count, t1_count;
> +	memcpy(&t0_count, rte_apicounts, sizeof(struct rte_apistats));
Any specific reason not to use `rte_memcpy` and invoke system library call `memcpy`

> +	sleep(1);
> +	memcpy(&t1_count, rte_apicounts, sizeof(struct rte_apistats));
> +	for (i = 0; i < RTE_MAX_LCORE; i++) {
I am against the idea of iterating RTE_MAX_LCORE, as for any valid DPDK primary application the actual core count may vary between `1 to RTE_MAX_LCORE`

> +		if (t1_count.lcoreid_list[i] != 0) {
> +			uint64_t rx_count_delta = t1_count.rx_burst_counts[i]
> +				- t0_count.rx_burst_counts[i];
> +			uint64_t tx_count_delta = t1_count.tx_burst_counts[i]
> +				- t0_count.tx_burst_counts[i];
> +			printf("\n  %s api statistics for lcoreid: %d %s\n",
> +				api_stats_border, i, api_stats_border);
Suggestion: Since most of DPDK application uses dedicated core to RX and TX, would not it easier only display the lcores which does the operation. That is skip lcores where `count_delta` are 0?

> +			printf("  rx_burst_count: %13"PRIu64""
> +				" rx_burst_count_delta: %13"PRIu64"\n",
> +				t1_count.rx_burst_counts[i],
> +				rx_count_delta);
> +			printf("  tx_burst_count: %13"PRIu64""
> +				" tx_burst_count_delta: %13"PRIu64"\n",
> +				t1_count.tx_burst_counts[i],
> +				tx_count_delta);
> +			printf("  tx/rx_rate: %3.2f\n",
> +				(rx_count_delta) ? (double)tx_count_delta
> +				/ rx_count_delta : 0.0);

snipped

>  	if (enable_iter_mempool)
>  		iter_mempool(mempool_iter_name);
> +	if (enable_apistats)
> +		display_apistats();
> 
>  	RTE_ETH_FOREACH_DEV(i)
>  		rte_eth_dev_close(i);
> --
> 2.18.0


  reply	other threads:[~2020-12-05 13:16 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-04  7:51 [dpdk-dev] [PATCH 0/5] add apistats function Hideyuki Yamashita
2020-12-04  7:51 ` [dpdk-dev] [PATCH 1/5] maintainers: update maintainers file for apistats Hideyuki Yamashita
2020-12-05 13:27   ` Varghese, Vipin
2020-12-24  6:36     ` Hideyuki Yamashita
2020-12-04  7:51 ` [dpdk-dev] [PATCH 2/5] app/proc-info: add to use apistats Hideyuki Yamashita
2020-12-05 13:15   ` Varghese, Vipin [this message]
2020-12-04  7:51 ` [dpdk-dev] [PATCH 3/5] app/test-pmd: " Hideyuki Yamashita
2020-12-05 13:04   ` Varghese, Vipin
2020-12-04  7:51 ` [dpdk-dev] [PATCH 4/5] docs: add description of apistats parameter into proc-info Hideyuki Yamashita
2020-12-05 13:02   ` Varghese, Vipin
2020-12-07  9:48     ` Pattan, Reshma
2020-12-04  7:51 ` [dpdk-dev] [PATCH 5/5] librte_ethdev: add to use apistats Hideyuki Yamashita
2020-12-05 13:01   ` Varghese, Vipin
2020-12-06 17:47   ` Stephen Hemminger
2020-12-24  6:33     ` Hideyuki Yamashita
2020-12-07 12:38   ` Ananyev, Konstantin
2020-12-22  2:48     ` Hideyuki Yamashita
2020-12-22  2:50     ` Hideyuki Yamashita
2020-12-22  9:04       ` Morten Brørup
2020-12-22 13:05       ` Ananyev, Konstantin
2020-12-04  9:09 ` [dpdk-dev] [PATCH 0/5] add apistats function Ferruh Yigit
2020-12-04 10:20 ` David Hunt
2020-12-05 13:23   ` Varghese, Vipin
2020-12-24  6:43     ` Hideyuki Yamashita
2020-12-24 12:35       ` Varghese, Vipin
2020-12-22  2:16   ` Hideyuki Yamashita
2020-12-07  9:46 ` Thomas Monjalon
2020-12-22  2:22   ` Hideyuki Yamashita
2021-02-22 15:10     ` Ferruh Yigit

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=MWHPR11MB158158B2FBD826510D1680CA90F00@MWHPR11MB1581.namprd11.prod.outlook.com \
    --to=vipin.varghese@intel.com \
    --cc=dev@dpdk.org \
    --cc=maryam.tahhan@intel.com \
    --cc=reshma.pattan@intel.com \
    --cc=yamashita.hideyuki@ntt-tx.co.jp \
    --cc=yamashtia.hideyuki@ntt-tx.co.jp \
    /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).