DPDK usage discussions
 help / color / mirror / Atom feed
From: "Van Haaren, Harry" <harry.van.haaren@intel.com>
To: Sridhar.V.Iyer <sridhariyer@versa-networks.com>
Cc: "users@dpdk.org" <users@dpdk.org>
Subject: Re: [dpdk-users] e1000 port stats
Date: Tue, 8 Dec 2015 10:54:15 +0000	[thread overview]
Message-ID: <E923DB57A917B54B9182A2E928D00FA61283E04F@IRSMSX102.ger.corp.intel.com> (raw)
In-Reply-To: <FBDD2597-98CE-41A8-B53C-C761703A242F@versa-networks.com>


From: Sridhar.V.Iyer [mailto:sridhariyer@versa-networks.com] 
> From gdb (KVM e1000), I see that the control is going to em_ethdev.c and not igb_ethdev.c (where the patch you provided applies). I added a similar patch in em_ethdev.c, but that didn’t help.
>
> However, when I apply the following patch, I seem to get the correct byte count:
>
> sridhar@sridhar-dev1:~/devel/15.2R1$ git diff
> diff --git a/usr/lib/DPDK/lib/librte_pmd_e1000/em_ethdev.c b/usr/lib/DPDK/lib/librte_pmd_e1000/em_ethdev.c
> index 8f9921c..83076ab 100644
> --- a/usr/lib/DPDK/lib/librte_pmd_e1000/em_ethdev.c
> +++ b/usr/lib/DPDK/lib/librte_pmd_e1000/em_ethdev.c
> @@ -828,8 +828,10 @@ eth_em_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *rte_stats)
>         stats->roc += E1000_READ_REG(hw, E1000_ROC);
>         stats->rjc += E1000_READ_REG(hw, E1000_RJC);
>
> -       stats->tor += E1000_READ_REG(hw, E1000_TORH);
> -       stats->tot += E1000_READ_REG(hw, E1000_TOTH);
> +       stats->tor += E1000_READ_REG(hw, E1000_TORL);
> +       stats->tor += ((uint64_t)E1000_READ_REG(hw, E1000_TORH) << 32);
> +       stats->tot += E1000_READ_REG(hw, E1000_TOTL);
> +       stats->tot += ((uint64_t)E1000_READ_REG(hw, E1000_TOTH) << 32);
> 
>         stats->tpr += E1000_READ_REG(hw, E1000_TPR);
>         stats->tpt += E1000_READ_REG(hw, E1000_TPT);

This part looks good - fixes reading the register for em pf driver.

Send this snippet as a patch to dev@dpdk.org - it is a valuable addition. Perhaps wait until after 2.2 has been released - then a new development window will open for PMD patches like this one.


> @@ -882,8 +884,8 @@ eth_em_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *rte_stats)
>
>        rte_stats->ipackets = stats->gprc;
>        rte_stats->opackets = stats->gptc;
> -       rte_stats->ibytes   = stats->gorc;
> -       rte_stats->obytes   = stats->gotc;
> +       rte_stats->ibytes   = stats->tor;
> +       rte_stats->obytes   = stats->tot;
>
> GORC/GOTC account for good octets and TOR/TOT account for total octets. The packets are being delivered to the application, so they >  aren’t being dropped.

This part makes an assumption that because you're not dropping packets now, means they will never be dropped. This is not a valid assumption: when a CPU gets overloaded packets will get dropped, which will invalidate the statistics: we need to find a better solution.

Cheers, -Harry

  reply	other threads:[~2015-12-08 10:54 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-30 12:18 Van Haaren, Harry
2015-11-30 21:06 ` Sridhar.V.Iyer
2015-12-08 10:54   ` Van Haaren, Harry [this message]
2015-12-08 18:52     ` Sridhar.V.Iyer
2015-12-10  0:12       ` Sridhar.V.Iyer
  -- strict thread matches above, loose matches on Subject: below --
2015-11-19  2:11 Sridhar.V.Iyer

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=E923DB57A917B54B9182A2E928D00FA61283E04F@IRSMSX102.ger.corp.intel.com \
    --to=harry.van.haaren@intel.com \
    --cc=sridhariyer@versa-networks.com \
    --cc=users@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).