[dpdk-dev] [PATCH v2] test: reduce test duration for efd autotest
Jananee Parthasarathy
jananeex.m.parthasarathy at intel.com
Wed Oct 31 15:30:16 CET 2018
Reduced test time for efd_autotest.
Key length is updated, invoke times of random function is reduced.
Signed-off-by: Jananee Parthasarathy <jananeex.m.parthasarathy at intel.com>
---
v2: value updated for each hash key
---
test/test/test_efd.c | 17 ++++++++---------
1 file changed, 8 insertions(+), 9 deletions(-)
diff --git a/test/test/test_efd.c b/test/test/test_efd.c
index ced091aab..bf2c7b42a 100644
--- a/test/test/test_efd.c
+++ b/test/test/test_efd.c
@@ -331,8 +331,9 @@ static int test_average_table_utilization(void)
{
struct rte_efd_table *handle = NULL;
uint32_t num_rules_in = TABLE_SIZE;
- uint8_t simple_key[EFD_TEST_KEY_LEN];
- unsigned int i, j;
+ uint64_t simple_key;
+ unsigned int j;
+ efd_value_t val;
unsigned int added_keys, average_keys_added = 0;
printf("Evaluating table utilization and correctness, please wait\n");
@@ -340,7 +341,7 @@ static int test_average_table_utilization(void)
for (j = 0; j < ITERATIONS; j++) {
handle = rte_efd_create("test_efd", num_rules_in,
- EFD_TEST_KEY_LEN, efd_get_all_sockets_bitmask(),
+ sizeof(uint8_t), efd_get_all_sockets_bitmask(),
test_socket_id);
if (handle == NULL) {
printf("efd table creation failed\n");
@@ -353,15 +354,13 @@ static int test_average_table_utilization(void)
/* Add random entries until key cannot be added */
for (added_keys = 0; added_keys < num_rules_in; added_keys++) {
- for (i = 0; i < EFD_TEST_KEY_LEN; i++)
- simple_key[i] = rte_rand() & 0xFF;
+ simple_key = rte_rand();
+ val = simple_key & 0xFF;
- efd_value_t val = simple_key[0];
-
- if (rte_efd_update(handle, test_socket_id, simple_key,
+ if (rte_efd_update(handle, test_socket_id, &simple_key,
val))
break; /* continue;*/
- if (rte_efd_lookup(handle, test_socket_id, simple_key)
+ if (rte_efd_lookup(handle, test_socket_id, &simple_key)
!= val)
lost_keys++;
else
--
2.13.6
More information about the dev
mailing list