git.droids-corp.org
/
dpdk.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
app/test: shorten execution time
[dpdk.git]
/
app
/
test
/
test_ring.c
diff --git
a/app/test/test_ring.c
b/app/test/test_ring.c
index
2cd8e77
..
4f8dc8f
100644
(file)
--- a/
app/test/test_ring.c
+++ b/
app/test/test_ring.c
@@
-46,7
+46,6
@@
#include <rte_memzone.h>
#include <rte_launch.h>
#include <rte_cycles.h>
#include <rte_memzone.h>
#include <rte_launch.h>
#include <rte_cycles.h>
-#include <rte_tailq.h>
#include <rte_eal.h>
#include <rte_per_lcore.h>
#include <rte_lcore.h>
#include <rte_eal.h>
#include <rte_per_lcore.h>
#include <rte_lcore.h>
@@
-113,7
+112,7
@@
static struct rte_ring *r;
printf("error at %s:%d\tcondition " #exp " failed\n", \
__func__, __LINE__); \
rte_ring_dump(stdout, r); \
printf("error at %s:%d\tcondition " #exp " failed\n", \
__func__, __LINE__); \
rte_ring_dump(stdout, r); \
- return
(-1);
\
+ return
-1;
\
}
#define TEST_RING_FULL_EMTPY_ITER 8
}
#define TEST_RING_FULL_EMTPY_ITER 8
@@
-131,7
+130,7
@@
check_live_watermark_change(__attribute__((unused)) void *dummy)
/* init the object table */
memset(obj_table, 0, sizeof(obj_table));
/* init the object table */
memset(obj_table, 0, sizeof(obj_table));
- end_time = rte_get_timer_cycles() + (hz
* 2
);
+ end_time = rte_get_timer_cycles() + (hz
/ 4
);
/* check that bulk and watermark are 4 and 32 (respectively) */
while (diff >= 0) {
/* check that bulk and watermark are 4 and 32 (respectively) */
while (diff >= 0) {
@@
-195,9
+194,9
@@
test_live_watermark_change(void)
* watermark and quota */
rte_eal_remote_launch(check_live_watermark_change, NULL, lcore_id2);
* watermark and quota */
rte_eal_remote_launch(check_live_watermark_change, NULL, lcore_id2);
- rte_delay_ms(100
0
);
+ rte_delay_ms(100);
rte_ring_set_water_mark(r, 32);
rte_ring_set_water_mark(r, 32);
- rte_delay_ms(100
0
);
+ rte_delay_ms(100);
if (rte_eal_wait_lcore(lcore_id2) < 0)
return -1;
if (rte_eal_wait_lcore(lcore_id2) < 0)
return -1;
@@
-275,7
+274,7
@@
test_ring_basic_full_empty(void * const src[], void *dst[])
TEST_RING_VERIFY(0 == memcmp(src, dst, rsz));
rte_ring_dump(stdout, r);
}
TEST_RING_VERIFY(0 == memcmp(src, dst, rsz));
rte_ring_dump(stdout, r);
}
- return
(0)
;
+ return
0
;
}
static int
}
static int
@@
-472,17
+471,13
@@
test_ring_basic(void)
if (ret != 0)
goto fail;
if (ret != 0)
goto fail;
- if (src)
- free(src);
- if (dst)
- free(dst);
+ free(src);
+ free(dst);
return 0;
fail:
return 0;
fail:
- if (src)
- free(src);
- if (dst)
- free(dst);
+ free(src);
+ free(dst);
return -1;
}
return -1;
}
@@
-760,17
+755,13
@@
test_ring_burst_basic(void)
goto fail;
/* Free memory before test completed */
goto fail;
/* Free memory before test completed */
- if (src)
- free(src);
- if (dst)
- free(dst);
+ free(src);
+ free(dst);
return 0;
fail:
return 0;
fail:
- if (src)
- free(src);
- if (dst)
- free(dst);
+ free(src);
+ free(dst);
return -1;
}
return -1;
}
@@
-1169,17
+1160,13
@@
test_ring_stats(void)
memset(&r->stats[lcore_id], 0, sizeof(r->stats[lcore_id]));
/* Free memory before test completed */
memset(&r->stats[lcore_id], 0, sizeof(r->stats[lcore_id]));
/* Free memory before test completed */
- if (src)
- free(src);
- if (dst)
- free(dst);
+ free(src);
+ free(dst);
return 0;
fail:
return 0;
fail:
- if (src)
- free(src);
- if (dst)
- free(dst);
+ free(src);
+ free(dst);
return -1;
#endif
}
return -1;
#endif
}
@@
-1259,7
+1246,7
@@
test_ring_basic_ex(void)
struct rte_ring * rp;
void **obj = NULL;
struct rte_ring * rp;
void **obj = NULL;
- obj =
(void **)rte_zmalloc("test_ring_basic_ex_malloc", (RING_SIZE * sizeof(void *)
), 0);
+ obj =
rte_calloc("test_ring_basic_ex_malloc", RING_SIZE, sizeof(void *
), 0);
if (obj == NULL) {
printf("test_ring_basic_ex fail to rte_malloc\n");
goto fail_test;
if (obj == NULL) {
printf("test_ring_basic_ex fail to rte_malloc\n");
goto fail_test;