app/test: reduce lpm6 test case size
PATCH 1/1 app/test: reduce lpm6 test case size
copy app/test/test_lpm6_routes.h to app/test/test_lpm6_data.h . and then delete app/test/test_lpm6_routes.h and clear the large_ips_table[ ] to make LPM6 test case size much smaller than before. Also add codes in app/test/test_lpm6_data.h to generate test data in large_ips_table[ ] at run time.
Signed-off-by Wei Dai <[email protected]>
--- app/test/test_lpm6.c | 5 +- app/test/test_lpm6_data.h | 1188 + app/test/test_lpm6_perf.c | 7 +- app/test/test_lpm6_routes.h | 101058 ----------------------------------------- 4 files changed, 1198 insertions(+), 101060 deletions(-) create mode 100644 app/test/test_lpm6_data.h delete mode 100644 app/test/test_lpm6_routes.h
app/test/test_lpm6.c +4 -1
@@ -40,7 +40,7 @@#include <rte_lpm6.h> #include "test.h" -#include "test_lpm6_routes.h" +#include "test_lpm6_data.h" #define TEST_LPM_ASSERT (cond) do { \ if (!(cond)) { \
@@ -1597,6 +1597,9 @@ test25(void)TEST_LPM_ASSERT (status ==0 ); } +/* generate large IPS table and expected next_hops */ +generate_large_ips_table (1 ); +for (i =0 ; i <100000 ; i++) {memcpy (ip, large_ips_table[i].ip,16 ); next_hop_expected = large_ips_table[i].next_hop;
app/test/test_lpm6_data.h new file +1188 -0
1,188 lines not on this page · raw message
app/test/test_lpm6_perf.c +6 -1
@@ -42,7 +42,7 @@#include <rte_lpm6.h> #include "test.h" -#include "test_lpm6_routes.h" +#include "test_lpm6_data.h" #define TEST_LPM_ASSERT (cond) do { \ if (!(cond)) { \
@@ -100,6 +100,11 @@ test_lpm6_perf(void)print_route_distribution (large_route_table, (uint32_t )NUM_ROUTE_ENTRIES ); +/* Only generate IPv6 address of each item in large IPS table, +* here next_hop is not needed. +*/ +generate_large_ips_table (0 ); + lpm =rte_lpm6_create (__func__,SOCKET_ID_ANY , &config);TEST_LPM_ASSERT (lpm !=NULL );
app/test/test_lpm6_routes.h deleted +0 -0
Signature · 1 line
2.7.4
Thomas Monjalon
Applied2016-09-30 02:11, Wei Dai:
Quoted 7 lines
copy
app/test/test_lpm6_routes.htoapp/test/test_lpm6_data.h. and then deleteapp/test/test_lpm6_routes.hand clear the large_ips_table[ ] to make LPM6 test case size much smaller than before. Also add codes inapp/test/test_lpm6_data.hto generate test data in large_ips_table[ ] at run time.Signed-off-by Wei Dai <[email protected]>
Applied, thanks