From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id D050B1B134 for ; Wed, 26 Sep 2018 16:19:27 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 26 Sep 2018 07:19:26 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.54,306,1534834800"; d="scan'208";a="92069352" Received: from irvmail001.ir.intel.com ([163.33.26.43]) by fmsmga004.fm.intel.com with ESMTP; 26 Sep 2018 07:19:25 -0700 Received: from wgcvswdev001.ir.intel.com (wgcvswdev001.ir.intel.com [10.102.246.100]) by irvmail001.ir.intel.com (8.14.3/8.13.6/MailSET/Hub) with ESMTP id w8QEJOFC002540; Wed, 26 Sep 2018 15:19:24 +0100 Received: from wgcvswdev001.ir.intel.com (localhost [127.0.0.1]) by wgcvswdev001.ir.intel.com with ESMTP id w8QEJBwj031509; Wed, 26 Sep 2018 15:19:11 +0100 Received: (from jmparthx@localhost) by wgcvswdev001.ir.intel.com with œ id w8QEJBxa031505; Wed, 26 Sep 2018 15:19:11 +0100 From: Jananee Parthasarathy To: dev@dpdk.org Cc: byron.marohn@intel.com, pablo.de.lara.guarch@intel.com, reshma.pattan@intel.com, Jananee Parthasarathy Date: Wed, 26 Sep 2018 15:19:00 +0100 Message-Id: <1537971540-31443-1-git-send-email-jananeex.m.parthasarathy@intel.com> X-Mailer: git-send-email 1.7.12.2 Subject: [dpdk-dev] [PATCH] test: reduce test duration for efd autotest X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Sep 2018 14:19:28 -0000 Reduced test time for efd_autotest. Key length is updated, invoke times of random function is reduced. Signed-off-by: Jananee Parthasarathy --- 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..893a09c03 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; + uint8_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"); @@ -350,18 +351,16 @@ static int test_average_table_utilization(void) unsigned int succeeded = 0; unsigned int lost_keys = 0; + val = mrand48() & VALUE_BITMASK; /* 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() & 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