[dpdk-users] e1000 port stats

Sridhar.V.Iyer sridhariyer at versa-networks.com
Mon Nov 30 22:06:52 CET 2015


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 at 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 at 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


More information about the users mailing list