[dpdk-dev] [PATCH 4/4] fm10k: remove crc size from all byte counters
Harry van Haaren
harry.van.haaren at intel.com
Mon Nov 16 11:35:17 CET 2015
This patch removes the crc bytes from byte counter statistics.
Signed-off-by: Harry van Haaren <harry.van.haaren at intel.com>
---
drivers/net/fm10k/fm10k_ethdev.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/drivers/net/fm10k/fm10k_ethdev.c b/drivers/net/fm10k/fm10k_ethdev.c
index 441f713..fdb2e81 100644
--- a/drivers/net/fm10k/fm10k_ethdev.c
+++ b/drivers/net/fm10k/fm10k_ethdev.c
@@ -1183,11 +1183,13 @@ fm10k_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats)
ipackets = opackets = ibytes = obytes = 0;
for (i = 0; (i < RTE_ETHDEV_QUEUE_STAT_CNTRS) &&
- (i < hw->mac.max_queues); ++i) {
+ (i < hw->mac.max_queues); ++i) {
stats->q_ipackets[i] = hw_stats->q[i].rx_packets.count;
stats->q_opackets[i] = hw_stats->q[i].tx_packets.count;
- stats->q_ibytes[i] = hw_stats->q[i].rx_bytes.count;
- stats->q_obytes[i] = hw_stats->q[i].tx_bytes.count;
+ stats->q_ibytes[i] = hw_stats->q[i].rx_bytes.count -
+ (stats->q_ipackets[i] * 4);
+ stats->q_obytes[i] = hw_stats->q[i].tx_bytes.count -
+ (stats->q_opackets[i] * 4);
ipackets += stats->q_ipackets[i];
opackets += stats->q_opackets[i];
ibytes += stats->q_ibytes[i];
--
1.9.1
More information about the dev
mailing list