DPDK patches and discussions
 help / color / mirror / Atom feed
From: Phil Yang <Phil.Yang@arm.com>
To: Honnappa Nagarahalli <Honnappa.Nagarahalli@arm.com>,
	"dev@dpdk.org" <dev@dpdk.org>
Cc: "ferruh.yigit@intel.com" <ferruh.yigit@intel.com>,
	"maxime.coquelin@redhat.com" <maxime.coquelin@redhat.com>,
	Ruifeng Wang <Ruifeng.Wang@arm.com>, nd <nd@arm.com>,
	"stable@dpdk.org" <stable@dpdk.org>,
	 "david.marchand@redhat.com" <david.marchand@redhat.com>,
	nd <nd@arm.com>, nd <nd@arm.com>
Subject: Re: [dpdk-dev] [PATCH] app/testpmd: fix CPU cycles per pkt stats on transmit modes
Date: Fri, 19 Jun 2020 03:54:08 +0000	[thread overview]
Message-ID: <VE1PR08MB4640E25DEDEF7CD6437C7F13E9980@VE1PR08MB4640.eurprd08.prod.outlook.com> (raw)
In-Reply-To: <DB6PR0802MB22168BA01CFEE88B4BEF1A67989B0@DB6PR0802MB2216.eurprd08.prod.outlook.com>

> -----Original Message-----
> From: Honnappa Nagarahalli <Honnappa.Nagarahalli@arm.com>
> Sent: Friday, June 19, 2020 3:29 AM
> To: Phil Yang <Phil.Yang@arm.com>; dev@dpdk.org
> Cc: ferruh.yigit@intel.com; maxime.coquelin@redhat.com; Ruifeng Wang
> <Ruifeng.Wang@arm.com>; nd <nd@arm.com>; stable@dpdk.org;
> david.marchand@redhat.com; Honnappa Nagarahalli
> <Honnappa.Nagarahalli@arm.com>; nd <nd@arm.com>
> Subject: RE: [PATCH] app/testpmd: fix CPU cycles per pkt stats on transmit
> modes
> 
> <snip>
> 
> > Subject: [PATCH] app/testpmd: fix CPU cycles per pkt stats on transmit
> modes
> >
> > In txonly and flowgen forwarding mode, calculating CPU per packets with
> total
> > received packets is not accurate. Use total transmitted packets for these
> cases.
> >
> > The error output under txonly mode:
> > testpmd> show fwd stats all
> >
> > ---------------------- Forward statistics for port 0  -------------------
> > RX-packets: 0              RX-dropped: 0             RX-total: 0
> > TX-packets: 3582891927     TX-dropped: 401965824     TX-total: 3984857751
> > TX-bursts : 86381636 [0% of 0 pkts + 85% of 64 pkts + 15% of 32 pkts]
> > -------------------------------------------------------------------------
> >
> > ---------------------- Forward statistics for port 1  -------------------
> > RX-packets: 1              RX-dropped: 394351696     RX-total: 394351697
> > TX-packets: 3582890632     TX-dropped: 401965568     TX-total: 3984856200
> > TX-bursts : 86381679 [0% of 0 pkts + 85% of 64 pkts + 15% of 32 pkts]
> > -------------------------------------------------------------------------
> >
> > +++++++++++++++ Accumulated forward statistics for all
> > +++++++++++++++ ports+++++++++++++
> > RX-packets: 1              RX-dropped: 394351696     RX-total: 394351697
> > TX-packets: 7165782559     TX-dropped: 803931392     TX-total: 7969713951
> >
> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> +++++++
> > ++++++++
> >
> > CPU cycles/packet=54984156291.00 \
> > (total cycles=54984156291 / total RX packets=1) at 200 MHz Clock
> >
> > Signed-off-by: Phil Yang <phil.yang@arm.com>
> > Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
> > Fixes: 53324971a14e ("app/testpmd: display/clear forwarding stats on
> > demand")
> > Cc: stable@dpdk.org
> > Cc: david.marchand@redhat.com
> > ---
> >  app/test-pmd/testpmd.c | 24 +++++++++++++++++-------
> >  1 file changed, 17 insertions(+), 7 deletions(-)
> >
> > diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c index
> > 4989d22..798b8e0 100644
> > --- a/app/test-pmd/testpmd.c
> > +++ b/app/test-pmd/testpmd.c
> > @@ -1961,13 +1961,23 @@ fwd_stats_display(void)
> >  	       acc_stats_border, acc_stats_border);  #ifdef
> > RTE_TEST_PMD_RECORD_CORE_CYCLES  #define CYC_PER_MHZ 1E6
> > -	if (total_recv > 0)
> > -		printf("\n  CPU cycles/packet=%.2F (total cycles="
> > -		       "%"PRIu64" / total RX packets=%"PRIu64") at %"PRIu64
> > -		       " MHz Clock\n",
> > -		       (double) fwd_cycles / total_recv,
> > -		       fwd_cycles, total_recv,
> > -		       (uint64_t)(rte_get_tsc_hz() / CYC_PER_MHZ));
> > +	if (total_recv > 0 || total_xmit > 0) {
> > +		if (strcmp(cur_fwd_eng->fwd_mode_name, "txonly") == 0
> ||
> > +		    strcmp(cur_fwd_eng->fwd_mode_name, "flowgen") == 0)
> > +			printf("\n  CPU cycles/packet=%.2F (total cycles="
> > +			     "%"PRIu64" / total %s packets=%"PRIu64") at %"
> > +			     PRIu64" MHz Clock\n",
> > +			     (double) fwd_cycles / total_xmit,
> > +			     fwd_cycles, cur_fwd_eng->fwd_mode_name,
> > total_xmit,
> > +			     (uint64_t)(rte_get_tsc_hz() / CYC_PER_MHZ));
> > +		else
> > +			printf("\n  CPU cycles/packet=%.2F (total cycles="
> > +			    "%"PRIu64" / total %s packets=%"PRIu64") at %"
> > +			    PRIu64" MHz Clock\n",
> > +			    (double) fwd_cycles / total_recv,
> > +			    fwd_cycles, cur_fwd_eng->fwd_mode_name,
> > total_recv,
> > +			    (uint64_t)(rte_get_tsc_hz() / CYC_PER_MHZ));
> > +	}
> nit. Only difference between the two 'printf' calls are total_recv vs total_xmit.
> Can be consolidated into a single printf.

OK. I can use a local flag and a ternary operator to print the ingress and the egress packets respectively.

I will update it in V2.

Thanks,
Phil

> 
> >  #endif
> >  }
> >
> > --
> > 2.7.4


  reply	other threads:[~2020-06-19  3:54 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-18 14:50 Phil Yang
2020-06-18 19:28 ` Honnappa Nagarahalli
2020-06-19  3:54   ` Phil Yang [this message]
2020-06-19  4:08 ` [dpdk-dev] [PATCH v2] " Phil Yang
2020-06-22  3:39   ` Honnappa Nagarahalli
2020-06-22  8:48     ` Phil Yang
2020-06-22  9:04   ` [dpdk-dev] [PATCH v3] " Phil Yang
2020-07-10 17:14     ` 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=VE1PR08MB4640E25DEDEF7CD6437C7F13E9980@VE1PR08MB4640.eurprd08.prod.outlook.com \
    --to=phil.yang@arm.com \
    --cc=Honnappa.Nagarahalli@arm.com \
    --cc=Ruifeng.Wang@arm.com \
    --cc=david.marchand@redhat.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.com \
    --cc=maxime.coquelin@redhat.com \
    --cc=nd@arm.com \
    --cc=stable@dpdk.org \
    /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).