Skip to contentSkip to conversation

app/test: reduce lpm6 test case size

PATCH Applied Wei Dai 2 participants 2 messages Sep 29, 2016 – Oct 13, 2016

lore
Share & tools
lore

Wei Dai

author
#0 lore raw

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.

---
 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
index 0fd0ef7..61134f7 100644
@@ -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
index be47d4a..0723081 100644
@@ -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
deleted file mode 100644
index 7892732..0000000
Signature · 1 line
2.7.4
#1 lore raw

2016-09-30 02:11, Wei Dai:

Quoted 7 lines

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.

Applied, thanks