app: add a test on mbuf alignment
[dpdk.git] / app / test / test_ring.c
index ecc7531..de0489f 100644 (file)
@@ -1,7 +1,7 @@
 /*-
  *   BSD LICENSE
  * 
- *   Copyright(c) 2010-2012 Intel Corporation. All rights reserved.
+ *   Copyright(c) 2010-2013 Intel Corporation. All rights reserved.
  *   All rights reserved.
  * 
  *   Redistribution and use in source and binary forms, with or without 
@@ -58,6 +58,7 @@
 #include <rte_random.h>
 #include <rte_common.h>
 #include <rte_errno.h>
+#include <rte_hexdump.h>
 
 #include <cmdline_parse.h>
 
@@ -476,7 +477,7 @@ do_one_ring_test(unsigned enq_core_count, unsigned deq_core_count,
 static int
 check_live_watermark_change(__attribute__((unused)) void *dummy)
 {
-       uint64_t hz = rte_get_hpet_hz();
+       uint64_t hz = rte_get_timer_hz();
        void *obj_table[MAX_BULK];
        unsigned watermark, watermark_old = 16;
        uint64_t cur_time, end_time;
@@ -486,7 +487,7 @@ check_live_watermark_change(__attribute__((unused)) void *dummy)
 
        /* init the object table */
        memset(obj_table, 0, sizeof(obj_table));
-       end_time = rte_get_hpet_cycles() + (hz * 2);
+       end_time = rte_get_timer_cycles() + (hz * 2);
 
        /* check that bulk and watermark are 4 and 32 (respectively) */
        while (diff >= 0) {
@@ -524,7 +525,7 @@ check_live_watermark_change(__attribute__((unused)) void *dummy)
                        }
                }
 
-               cur_time = rte_get_hpet_cycles();
+               cur_time = rte_get_timer_cycles();
                diff = end_time - cur_time;
        }
 
@@ -696,8 +697,8 @@ test_ring_basic(void)
 
        /* check data */
        if (memcmp(src, dst, cur_dst - dst)) {
-               test_hexdump("src", src, cur_src - src);
-               test_hexdump("dst", dst, cur_dst - dst);
+               rte_hexdump("src", src, cur_src - src);
+               rte_hexdump("dst", dst, cur_dst - dst);
                printf("data after dequeue is not the same\n");
                goto fail;
        }
@@ -742,8 +743,8 @@ test_ring_basic(void)
 
        /* check data */
        if (memcmp(src, dst, cur_dst - dst)) {
-               test_hexdump("src", src, cur_src - src);
-               test_hexdump("dst", dst, cur_dst - dst);
+               rte_hexdump("src", src, cur_src - src);
+               rte_hexdump("dst", dst, cur_dst - dst);
                printf("data after dequeue is not the same\n");
                goto fail;
        }
@@ -764,8 +765,8 @@ test_ring_basic(void)
 
        /* check data */
        if (memcmp(src, dst, cur_dst - dst)) {
-               test_hexdump("src", src, cur_src - src);
-               test_hexdump("dst", dst, cur_dst - dst);
+               rte_hexdump("src", src, cur_src - src);
+               rte_hexdump("dst", dst, cur_dst - dst);
                printf("data after dequeue is not the same\n");
                goto fail;
        }
@@ -810,8 +811,8 @@ test_ring_basic(void)
 
        /* check data */
        if (memcmp(src, dst, cur_dst - dst)) {
-               test_hexdump("src", src, cur_src - src);
-               test_hexdump("dst", dst, cur_dst - dst);
+               rte_hexdump("src", src, cur_src - src);
+               rte_hexdump("dst", dst, cur_dst - dst);
                printf("data after dequeue is not the same\n");
                goto fail;
        }
@@ -905,8 +906,8 @@ test_ring_burst_basic(void)
 
        /* check data */
        if (memcmp(src, dst, cur_dst - dst)) {
-               test_hexdump("src", src, cur_src - src);
-               test_hexdump("dst", dst, cur_dst - dst);
+               rte_hexdump("src", src, cur_src - src);
+               rte_hexdump("dst", dst, cur_dst - dst);
                printf("data after dequeue is not the same\n");
                goto fail;
        }
@@ -971,8 +972,8 @@ test_ring_burst_basic(void)
 
        /* check data */
        if (memcmp(src, dst, cur_dst - dst)) {
-               test_hexdump("src", src, cur_src - src);
-               test_hexdump("dst", dst, cur_dst - dst);
+               rte_hexdump("src", src, cur_src - src);
+               rte_hexdump("dst", dst, cur_dst - dst);
                printf("data after dequeue is not the same\n");
                goto fail;
        }
@@ -1020,8 +1021,8 @@ test_ring_burst_basic(void)
 
        /* check data */
        if (memcmp(src, dst, cur_dst - dst)) {
-               test_hexdump("src", src, cur_src - src);
-               test_hexdump("dst", dst, cur_dst - dst);
+               rte_hexdump("src", src, cur_src - src);
+               rte_hexdump("dst", dst, cur_dst - dst);
                printf("data after dequeue is not the same\n");
                goto fail;
        }
@@ -1043,8 +1044,8 @@ test_ring_burst_basic(void)
 
        /* check data */
        if (memcmp(src, dst, cur_dst - dst)) {
-               test_hexdump("src", src, cur_src - src);
-               test_hexdump("dst", dst, cur_dst - dst);
+               rte_hexdump("src", src, cur_src - src);
+               rte_hexdump("dst", dst, cur_dst - dst);
                printf("data after dequeue is not the same\n");
                goto fail;
        }
@@ -1093,8 +1094,8 @@ test_ring_burst_basic(void)
 
        /* check data */
        if (memcmp(src, dst, cur_dst - dst)) {
-               test_hexdump("src", src, cur_src - src);
-               test_hexdump("dst", dst, cur_dst - dst);
+               rte_hexdump("src", src, cur_src - src);
+               rte_hexdump("dst", dst, cur_dst - dst);
                printf("data after dequeue is not the same\n");
                goto fail;
        }