DPDK usage discussions
 help / color / mirror / Atom feed
From: "Sridhar.V.Iyer" <sridhariyer@versa-networks.com>
To: "Van Haaren, Harry" <harry.van.haaren@intel.com>
Cc: "users@dpdk.org" <users@dpdk.org>
Subject: Re: [dpdk-users] e1000 port stats
Date: Mon, 30 Nov 2015 13:06:52 -0800	[thread overview]
Message-ID: <FBDD2597-98CE-41A8-B53C-C761703A242F@versa-networks.com> (raw)
In-Reply-To: <E923DB57A917B54B9182A2E928D00FA61283BB83@IRSMSX102.ger.corp.intel.com>

Hi Harry,


> 
>> This works fine on esxi guests using e1000.
> I presume you are passing a VF to esxi? The igbvf PMD has a different stats_get() function to the igb PF PMD, so the bug would not be visible there.

I’ve tried only ESXi e1000 interface and not in ESXi sriov (igbvf pmd). I’m assuming IGBVF pmd will be used only for SRIOV interface. 
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);
@@ -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.

(gdb) p *stats
$2 = {crcerrs = 0, algnerrc = 0, symerrs = 0, rxerrc = 0, mpc = 0, scc = 0, ecol = 0, mcc = 0, latecol = 0, colc = 0, dc = 0, tncrs = 0, sec = 0, cexterr = 0, rlec = 0, xonrxc = 0,
  xontxc = 0, xoffrxc = 0, xofftxc = 0, fcruc = 0, prc64 = 0, prc127 = 0, prc255 = 0, prc511 = 0, prc1023 = 0, prc1522 = 0, gprc = 1093830, bprc = 0, mprc = 0, gptc = 10, gorc = 0,
  gotc = 0, rnbc = 0, ruc = 0, rfc = 0, roc = 0, rjc = 0, mgprc = 0, mgpdc = 0, mgptc = 0, tor = 1580756080, tot = 816, tpr = 1093830, tpt = 10, ptc64 = 0, ptc127 = 0, ptc255 = 0,
  ptc511 = 0, ptc1023 = 0, ptc1522 = 0, mptc = 0, bptc = 0, tsctc = 0, tsctfc = 0, iac = 0, icrxptc = 0, icrxatc = 0, ictxptc = 0, ictxatc = 0, ictxqec = 0, ictxqmtc = 0, icrxdmtc = 0,
  icrxoc = 0, cbtmpc = 0, htdpmc = 0, cbrdpc = 0, cbrmpc = 0, rpthc = 0, hgptc = 0, htcbdpc = 0, hgorc = 0, hgotc = 0, lenerrs = 0, scvpc = 0, hrmpc = 0, doosync = 0, o2bgptc = 0,
  o2bspc = 0, b2ospc = 0, b2ogprc = 0}


Is there a possiblity that qemu is not updating the registers?
sridhar@sridhar-dev2:~$ /usr/bin/qemu-system-x86_64 -version
QEMU emulator version 2.0.0 (Debian 2.0.0+dfsg-2ubuntu1.19), Copyright (c) 2003-2008 Fabrice Bellard

Regards,
Sridhar

  reply	other threads:[~2015-11-30 21:06 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 [this message]
2015-12-08 10:54   ` Van Haaren, Harry
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=FBDD2597-98CE-41A8-B53C-C761703A242F@versa-networks.com \
    --to=sridhariyer@versa-networks.com \
    --cc=harry.van.haaren@intel.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).