bogdanPricope replied on github web page:

example/generator/odp_generator.c
line 23
@@ -786,8 +787,14 @@ static void print_global_stats(int num_workers)
                }
 
                cur = odp_time_local();
-               if (odp_time_cmp(next, cur) > 0)
+               if (odp_time_cmp(next, cur) > 0) {
+                       left = odp_time_diff(next, cur);
+                       stall = odp_time_to_ns(left);
+                       stall = (stall / ODP_TIME_SEC_IN_NS) + 1;
+                       stall &= 0xFFFFFFFF;


Comment:
I'm afraid it is a false positive - you are sending/receiving packets for 21 s 
(verbose_interval + 1) but calculate pps against 20 s (verbose_interval)
stall = 20
stall = 1
sent: 0, drops: 0, send rate: 0 pps, max send rate: 0 pps, rcv: 38703598, recv 
rate: 988582 pps, max recv rate: 988582 pps

Try this:
#if 0
                        stall = (stall / ODP_TIME_SEC_IN_NS) + 1;
                        stall &= 0xFFFFFFFF;
                        printf("stall = %d\n", (unsigned int)stall);
                        sleep((unsigned int)stall);
#else
                        if (stall / ODP_TIME_SEC_IN_NS)
                                sleep(1);
                        else
                                usleep(stall / ODP_TIME_USEC_IN_NS);
#endif

With this change I can still see an increase on performance but with reasonable 
value.

https://github.com/Linaro/odp/pull/157#discussion_r136561390
updated_at 2017-09-04 07:27:11

Reply via email to