From: Wisam Jaddo Date: Sun, 14 Mar 2021 09:54:26 +0000 (+0200) Subject: app/flow-perf: report first flow latency X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=96923debefe3f38b56c7fb5a4c171a54e3892e08;p=dpdk.git app/flow-perf: report first flow latency Starting from this commit the app will always report the first flow latency. This is useful in debugging to check the first flow insertion before any caching effect. Signed-off-by: Wisam Jaddo Acked-by: Alexander Kozyrev --- diff --git a/app/test-flow-perf/main.c b/app/test-flow-perf/main.c index 9f0d056fbc..e37a8b7f7a 100644 --- a/app/test-flow-perf/main.c +++ b/app/test-flow-perf/main.c @@ -1140,6 +1140,7 @@ insert_flows(int port_id, uint8_t core_id) struct rte_flow **flows_list; struct rte_flow_error error; clock_t start_batch, end_batch; + double first_flow_latency; double cpu_time_used; double insertion_rate; double cpu_time_per_batch[MAX_BATCHES_COUNT] = { 0 }; @@ -1198,6 +1199,16 @@ insert_flows(int port_id, uint8_t core_id) encap_data, decap_data, core_id, unique_data, &error); + if (!counter) { + first_flow_latency = (double) (rte_get_timer_cycles() - start_batch); + first_flow_latency /= rte_get_timer_hz(); + /* In millisecond */ + first_flow_latency *= 1000; + printf(":: First Flow Latency :: Port %d :: First flow " + "installed in %f milliseconds\n", + port_id, first_flow_latency); + } + if (force_quit) counter = end_counter;