]> git.droids-corp.org - dpdk.git/commitdiff
e1000: fix total byte statistics
authorHarry van Haaren <harry.van.haaren@intel.com>
Thu, 22 Oct 2015 15:18:04 +0000 (16:18 +0100)
committerThomas Monjalon <thomas.monjalon@6wind.com>
Tue, 27 Oct 2015 17:39:44 +0000 (18:39 +0100)
This patch fixes a bug in reading the 64 bit register reading
which was causing the total octets counters to show zero.
Now the code reads both the lower and higher 32 bits.
Tested in testpmd, byte values are correct.

Fixes: 805803445a02 ("e1000: support EM devices (also known as e1000/e1000e)")
Signed-off-by: Harry van Haaren <harry.van.haaren@intel.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
drivers/net/e1000/igb_ethdev.c

index 848ef6e64ca4e6d45e6d359a572b0020a7c468b7..2b081b19b5c2ceface1edcd177b766e89d74038b 100644 (file)
@@ -1316,8 +1316,10 @@ eth_igb_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);