summaryrefslogtreecommitdiffstats
path: root/VNFs/DPPD-PROX/stats_task.c
diff options
context:
space:
mode:
authorXavier Simonart <xavier.simonart@intel.com>2018-10-22 15:46:23 +0200
committerXavier Simonart <xavier.simonart@intel.com>2018-10-28 16:14:57 +0100
commit085c7a581ff15b46207eb2fe27068f21796a01ca (patch)
treea4b3a0a7b702b31d09b51990b8eb74b4618bd7c1 /VNFs/DPPD-PROX/stats_task.c
parentffdcfa6b834d3ad00188ee9805370d6aefc44b4b (diff)
Add support for counting non dataplane related packets
When performing some zero packet loss performance testing on dataplane, it is important (not) to count non dataplane packets. For instance, one might receive uexpected packets from a switch, or ARP packets. Or one might need to transmit ARP packets. Such packets should not be counted as dataplane packets as for thse packets there is no 1:1 mapping between transmitted packets and received packets. To support this, the counters reporting numbers of transmitted and received packets remain unchanged but two new counters have been added to PROX, counting respectively number of received and number of transmitted non-dataplane packets. On RX side, packets are counsidered as non-dataplane if being ARP or if they do not countain the proper signature On TX side, ARP packets are not considered as dataplane packets. This feature requires configuration of signature. "dp core stats" command has been added Change-Id: I98e113cd02f36d540383d343a433592867ad86a9 Signed-off-by: Xavier Simonart <xavier.simonart@intel.com>
Diffstat (limited to 'VNFs/DPPD-PROX/stats_task.c')
-rw-r--r--VNFs/DPPD-PROX/stats_task.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/VNFs/DPPD-PROX/stats_task.c b/VNFs/DPPD-PROX/stats_task.c
index 6b4dc2dd..2aed7720 100644
--- a/VNFs/DPPD-PROX/stats_task.c
+++ b/VNFs/DPPD-PROX/stats_task.c
@@ -58,6 +58,8 @@ void stats_task_reset(void)
cur_task_stats->tot_drop_tx_fail = 0;
cur_task_stats->tot_drop_discard = 0;
cur_task_stats->tot_drop_handled = 0;
+ cur_task_stats->tot_rx_non_dp = 0;
+ cur_task_stats->tot_tx_non_dp = 0;
}
}
@@ -78,6 +80,16 @@ uint64_t stats_core_task_tot_drop(uint8_t lcore_id, uint8_t task_id)
lcore_task_stats_all[lcore_id].task_stats[task_id].tot_drop_handled;
}
+uint64_t stats_core_task_tot_tx_non_dp(uint8_t lcore_id, uint8_t task_id)
+{
+ return lcore_task_stats_all[lcore_id].task_stats[task_id].tot_tx_non_dp;
+}
+
+uint64_t stats_core_task_tot_rx_non_dp(uint8_t lcore_id, uint8_t task_id)
+{
+ return lcore_task_stats_all[lcore_id].task_stats[task_id].tot_rx_non_dp;
+}
+
uint64_t stats_core_task_last_tsc(uint8_t lcore_id, uint8_t task_id)
{
return lcore_task_stats_all[lcore_id].task_stats[task_id].sample[last_stat].tsc;
@@ -102,6 +114,8 @@ void stats_task_post_proc(void)
cur_task_stats->tot_drop_tx_fail += last->drop_tx_fail - prev->drop_tx_fail;
cur_task_stats->tot_drop_discard += last->drop_discard - prev->drop_discard;
cur_task_stats->tot_drop_handled += last->drop_handled - prev->drop_handled;
+ cur_task_stats->tot_rx_non_dp += last->rx_non_dp - prev->rx_non_dp;
+ cur_task_stats->tot_tx_non_dp += last->tx_non_dp - prev->tx_non_dp;
}
}
@@ -127,6 +141,8 @@ void stats_task_update(void)
last->tx_bytes = stats->tx_bytes;
last->rx_bytes = stats->rx_bytes;
last->drop_bytes = stats->drop_bytes;
+ last->rx_non_dp = stats->rx_non_dp;
+ last->tx_non_dp = stats->tx_non_dp;
after = rte_rdtsc();
last->tsc = (before >> 1) + (after >> 1);
}