DPDK usage discussions
 help / color / mirror / Atom feed
* Re: [dpdk-users] e1000 port stats
@ 2015-11-30 12:18 Van Haaren, Harry
  2015-11-30 21:06 ` Sridhar.V.Iyer
  0 siblings, 1 reply; 6+ messages in thread
From: Van Haaren, Harry @ 2015-11-30 12:18 UTC (permalink / raw)
  To: users, sridhariyer

> Hi,

Hi Sridhar,

> In DPDK/lib/librte_pmd_e1000/em_ethdev.c:889 (eth_em_stats_get), for some reason, ibytes and obytes are not getting update, ipackets/opackets seem to be fine (kvm using e1000)

I've recently sent some patches regarding stats for the e1000 PMD.

> (gdb) p *rte_stats
> $3 = {ipackets = 228635, opackets = 350, ibytes = 0, obytes = 0, imissed = 0, ibadcrc = 0, ibadlen = 0, ierrors =

The following commit in git fixed the issue you are experiencing:
67b38d9 e1000: fix total byte statistics

> 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'm using dpdk 1.7. Any pointers would be great.
As stated, Git includes the fix, along with some more updates like providing extended statistics via the xstats_get() API.

The commit mentioned above is a small code-change and fixes your immediate bug - it will probably apply cleanly to 1.7, otherwise it's an easy backport.

-Harry

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [dpdk-users] e1000 port stats
  2015-11-30 12:18 [dpdk-users] e1000 port stats Van Haaren, Harry
@ 2015-11-30 21:06 ` Sridhar.V.Iyer
  2015-12-08 10:54   ` Van Haaren, Harry
  0 siblings, 1 reply; 6+ messages in thread
From: Sridhar.V.Iyer @ 2015-11-30 21:06 UTC (permalink / raw)
  To: Van Haaren, Harry; +Cc: users

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [dpdk-users] e1000 port stats
  2015-11-30 21:06 ` Sridhar.V.Iyer
@ 2015-12-08 10:54   ` Van Haaren, Harry
  2015-12-08 18:52     ` Sridhar.V.Iyer
  0 siblings, 1 reply; 6+ messages in thread
From: Van Haaren, Harry @ 2015-12-08 10:54 UTC (permalink / raw)
  To: Sridhar.V.Iyer; +Cc: users


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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [dpdk-users] e1000 port stats
  2015-12-08 10:54   ` Van Haaren, Harry
@ 2015-12-08 18:52     ` Sridhar.V.Iyer
  2015-12-10  0:12       ` Sridhar.V.Iyer
  0 siblings, 1 reply; 6+ messages in thread
From: Sridhar.V.Iyer @ 2015-12-08 18:52 UTC (permalink / raw)
  To: Van Haaren, Harry; +Cc: users

 <http://www.versa-networks.com/>Hi Harry,

> On Dec 8, 2015, at 2:54 AM, Van Haaren, Harry <harry.van.haaren@intel.com> wrote:
> 
> 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.

Thanks for the clarification.
Is the bug that the gorc/gotc registers are not getting updated in regular case? How do you suggest that we proceed here?
Should I look into the qemu code that might be at fault?(I’ll try to upgrade my qemu to the latest and see if that fixes the issue).

Regards,
Sridhar

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [dpdk-users] e1000 port stats
  2015-12-08 18:52     ` Sridhar.V.Iyer
@ 2015-12-10  0:12       ` Sridhar.V.Iyer
  0 siblings, 0 replies; 6+ messages in thread
From: Sridhar.V.Iyer @ 2015-12-10  0:12 UTC (permalink / raw)
  To: Van Haaren, Harry; +Cc: users

Hi Harry,

> Thanks for the clarification.
> Is the bug that the gorc/gotc registers are not getting updated in regular case? How do you suggest that we proceed here?
> Should I look into the qemu code that might be at fault?(I’ll try to upgrade my qemu to the latest and see if that fixes the issue).

Looks like this bug is fixed in the qemu ToT: http://git.qemu.org/?p=qemu.git;a=commit;h=3b27430177498a1728b6765c70b455900f93d73a <http://git.qemu.org/?p=qemu.git;a=commit;h=3b27430177498a1728b6765c70b455900f93d73a> (fix was added recently, so definitely not there on my installation).

Thanks,
Sridhar

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [dpdk-users] e1000 port stats
@ 2015-11-19  2:11 Sridhar.V.Iyer
  0 siblings, 0 replies; 6+ messages in thread
From: Sridhar.V.Iyer @ 2015-11-19  2:11 UTC (permalink / raw)
  To: users

Hi,

In DPDK/lib/librte_pmd_e1000/em_ethdev.c:889 (eth_em_stats_get), for some reason, ibytes and obytes are not getting update, ipackets/opackets seem to be fine (kvm using e1000)

(gdb) p *rte_stats
$3 = {ipackets = 228635, opackets = 350, ibytes = 0, obytes = 0, imissed = 0, ibadcrc = 0, ibadlen = 0, ierrors = 0, oerrors = 0, imcasts = 0, rx_nombuf = 0, igoodpkts = 0,
  fdirmatch = 0, fdirmiss = 0, tx_pause_xon = 0, rx_pause_xon = 0, tx_pause_xoff = 0, rx_pause_xoff = 0, q_ipackets = {0 <repeats 16 times>}, q_opackets = {0 <repeats 16 times>},
  q_ibytes = {0 <repeats 16 times>}, q_obytes = {0 <repeats 16 times>}, q_errors = {0 <repeats 16 times>}, ilbpackets = 0, olbpackets = 0, ilbbytes = 0, olbbytes = 0, hw_stats = {
    crcerrs = 0, illerrc = 0, errbc = 0, mpc = {0, 0, 0, 0, 0, 0, 0, 0}, mlfc = 0, mrfc = 0, rlec = 0, lxontxc = 0, lxonrxc = 0, lxofftxc = 0, lxoffrxc = 0, pxontxc = {0, 0, 0, 0,
      0, 0, 0, 0}, pxonrxc = {0, 0, 0, 0, 0, 0, 0, 0}, pxofftxc = {0, 0, 0, 0, 0, 0, 0, 0}, pxoffrxc = {0, 0, 0, 0, 0, 0, 0, 0}, pxon2offc = {0, 0, 0, 0, 0, 0, 0, 0}, prc64 = 0,
    prc127 = 0, prc255 = 0, prc511 = 0, prc1023 = 0, prc1522 = 0, bprc = 0, mprc = 0, gprc = 0, gorc = 0, gptc = 0, gotc = 0, ruc = 0, rfc = 0, roc = 0, rjc = 0, mngprc = 0,
    mngptc = 0, tor = 0, tpr = 0, tpt = 0, ptc64 = 0, ptc127 = 0, ptc255 = 0, ptc511 = 0, ptc1023 = 0, ptc1522 = 0, mptc = 0, bptc = 0, mspdc = 0, xec = 0, otxdropcnt = 0,
    orxdropcnt = 0}}

This works fine on esxi guests using e1000.

I'm using dpdk 1.7. Any pointers would be great.

Regards,
Sridhar.V.Iyer








 <http://www.versa-networks.com/> <http://www.versa-networks.com/>

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2015-12-10  0:12 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-11-30 12:18 [dpdk-users] e1000 port stats Van Haaren, Harry
2015-11-30 21:06 ` Sridhar.V.Iyer
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

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).