diff mbox series

[v4,1/5] test/hash: fix bucket size in hash perf test

Message ID 1538143869-152808-2-git-send-email-yipeng1.wang@intel.com (mailing list archive)
State Accepted, archived
Delegated to: Thomas Monjalon
Headers show
Series hash: fix multiple issues | expand

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK

Commit Message

Wang, Yipeng1 Sept. 28, 2018, 2:11 p.m. UTC
The bucket size was changed from 4 to 8 but the corresponding
perf test was not changed accordingly.

In the test, the bucket size and number of buckets are used
to map to the underneath rte_hash structure. They are used
to test performance of two conditions: keys in primary
buckets only and keys in both primary and secondary buckets.

Although there is no functional issue with bucket size set
to 4, it mismatches the underneath rte_hash structure,
which may affect code readability and future extension.

Fixes: 58017c98ed53 ("hash: add vectorized comparison")
Cc: stable@dpdk.org

Signed-off-by: Yipeng Wang <yipeng1.wang@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
---
 test/test/test_hash_perf.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Honnappa Nagarahalli Oct. 1, 2018, 8:28 p.m. UTC | #1
> 
> The bucket size was changed from 4 to 8 but the corresponding perf test was
> not changed accordingly.
> 
> In the test, the bucket size and number of buckets are used to map to the
> underneath rte_hash structure. They are used to test performance of two
> conditions: keys in primary buckets only and keys in both primary and
> secondary buckets.
> 
> Although there is no functional issue with bucket size set to 4, it mismatches
> the underneath rte_hash structure, which may affect code readability and
> future extension.
> 
> Fixes: 58017c98ed53 ("hash: add vectorized comparison")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Yipeng Wang <yipeng1.wang@intel.com>
> Acked-by: Bruce Richardson <bruce.richardson@intel.com>
> ---
>  test/test/test_hash_perf.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/test/test/test_hash_perf.c b/test/test/test_hash_perf.c index
> 33dcb9f..fe11632 100644
> --- a/test/test/test_hash_perf.c
> +++ b/test/test/test_hash_perf.c
> @@ -20,7 +20,8 @@
>  #define MAX_ENTRIES (1 << 19)
>  #define KEYS_TO_ADD (MAX_ENTRIES * 3 / 4) /* 75% table utilization */
> #define NUM_LOOKUPS (KEYS_TO_ADD * 5) /* Loop among keys added,
> several times */ -#define BUCKET_SIZE 4
> +/* BUCKET_SIZE should be same as RTE_HASH_BUCKET_ENTRIES in rte_hash
> +library */ #define BUCKET_SIZE 8
>  #define NUM_BUCKETS (MAX_ENTRIES / BUCKET_SIZE)  #define
> MAX_KEYSIZE 64  #define NUM_KEYSIZES 10
> --
> 2.7.4
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
diff mbox series

Patch

diff --git a/test/test/test_hash_perf.c b/test/test/test_hash_perf.c
index 33dcb9f..fe11632 100644
--- a/test/test/test_hash_perf.c
+++ b/test/test/test_hash_perf.c
@@ -20,7 +20,8 @@ 
 #define MAX_ENTRIES (1 << 19)
 #define KEYS_TO_ADD (MAX_ENTRIES * 3 / 4) /* 75% table utilization */
 #define NUM_LOOKUPS (KEYS_TO_ADD * 5) /* Loop among keys added, several times */
-#define BUCKET_SIZE 4
+/* BUCKET_SIZE should be same as RTE_HASH_BUCKET_ENTRIES in rte_hash library */
+#define BUCKET_SIZE 8
 #define NUM_BUCKETS (MAX_ENTRIES / BUCKET_SIZE)
 #define MAX_KEYSIZE 64
 #define NUM_KEYSIZES 10