summaryrefslogtreecommitdiffstats
path: root/src/main_dpdk.cpp
diff options
context:
space:
mode:
authorIdo Barnea <ibarnea@cisco.com>2016-03-09 11:25:05 +0200
committerIdo Barnea <ibarnea@cisco.com>2016-03-09 11:25:05 +0200
commit5f85bbd057dcf3298c8f1bab7b968952d6ec7693 (patch)
tree6194eacc127504a1b706888ee2637ab3319a3beb /src/main_dpdk.cpp
parentcc8c0e225bc495f67a379a757cc01a3fe778620d (diff)
Flow stat fix for issue of counting more than 1 stream
Diffstat (limited to 'src/main_dpdk.cpp')
-rw-r--r--src/main_dpdk.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/main_dpdk.cpp b/src/main_dpdk.cpp
index 12670969..3f53f83c 100644
--- a/src/main_dpdk.cpp
+++ b/src/main_dpdk.cpp
@@ -4947,13 +4947,13 @@ int CTRexExtendedDriverBase40G::get_rx_stats(CPhyEthIF * _if, uint32_t *stats, u
rte_eth_fdir_stats_get(port_id, hw_stats, start, len);
for (int i = loop_start; i < loop_start + len; i++) {
- if (hw_stats[i] >= prev_stats[i]) {
- stats[i] = (uint64_t)(hw_stats[i] - prev_stats[i]);
+ if (hw_stats[i - min] >= prev_stats[i]) {
+ stats[i] = (uint64_t)(hw_stats[i - min] - prev_stats[i]);
} else {
// Wrap around
- stats[i] = (uint64_t)((hw_stats[i] + ((uint64_t)1 << 32)) - prev_stats[i]);
+ stats[i] = (uint64_t)((hw_stats[i - min] + ((uint64_t)1 << 32)) - prev_stats[i]);
}
- prev_stats[i] = hw_stats[i];
+ prev_stats[i] = hw_stats[i - min];
}
return 0;