corrected alignment issues

Signed-off-by: Balakrishna.Garapati <balakrishna.garap...@linaro.org>
---
 example/generator/odp_generator.c | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/example/generator/odp_generator.c 
b/example/generator/odp_generator.c
index d6ec758..5cf7e92 100644
--- a/example/generator/odp_generator.c
+++ b/example/generator/odp_generator.c
@@ -26,6 +26,7 @@
 #define MAX_WORKERS            32              /**< max number of works */
 #define SHM_PKT_POOL_SIZE      (512*2048)      /**< pkt pool size */
 #define SHM_PKT_POOL_BUF_SIZE  1856            /**< pkt pool buf size */
+#define DEFAULT_PKT_INTERVAL   1000             /**< interval btw each pkt */
 
 #define APPL_MODE_UDP    0                     /**< UDP mode */
 #define APPL_MODE_PING   1                     /**< ping mode */
@@ -370,6 +371,7 @@ static odp_pktio_t create_pktio(const char *dev, odp_pool_t 
pool)
 static void *gen_send_thread(void *arg)
 {
        int thr;
+       uint64_t start, now, diff;
        odp_pktio_t pktio;
        thread_args_t *thr_args;
        odp_queue_t outq_def;
@@ -391,6 +393,7 @@ static void *gen_send_thread(void *arg)
                return NULL;
        }
 
+       start = odp_time_cycles();
        printf("  [%02i] created mode: SEND\n", thr);
        for (;;) {
                int err;
@@ -431,6 +434,14 @@ static void *gen_send_thread(void *arg)
                    >= (unsigned int)args->appl.number) {
                        break;
                }
+
+               now = odp_time_cycles();
+               diff = odp_time_diff_cycles(start, now);
+               if (odp_time_cycles_to_ns(diff) > 20 * ODP_TIME_SEC) {
+                       start = odp_time_cycles();
+                       printf("  [%02i] total send: %ju\n",
+                              thr, odp_atomic_load_u64(&counters.seq));
+               }
        }
 
        /* receive number of reply pks until timeout */
@@ -439,7 +450,7 @@ static void *gen_send_thread(void *arg)
                        if (odp_atomic_load_u64(&counters.icmp) >=
                            (unsigned int)args->appl.number)
                                break;
-                       millisleep(1000,
+                       millisleep(DEFAULT_PKT_INTERVAL,
                                   thr_args->tp,
                                   thr_args->tim,
                                   thr_args->tq,
-- 
1.9.1

_______________________________________________
lng-odp mailing list
lng-odp@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/lng-odp

Reply via email to