[dpdk-dev] [PATCH v2 2/2] hash: flush the rings instead of dequeuing one by one

Mattias Rönnblom mattias.ronnblom at ericsson.com
Wed Dec 12 20:28:15 CET 2018


On 2018-12-12 07:47, Gavin Hu wrote:
> Within rte_hash_reset, calling a while loop to dequeue one by
> one from the ring, while not using them at all, is wasting cycles,
> The patch just flush the ring by resetting the indices can save cpu
> cycles.
> 
> Fixes: b26473ff8f4a ("hash: add reset function")
> Fixes: 75706568a7eb ("hash: add extendable bucket feature")
> Cc: stable at dpdk.org
> 
> Signed-off-by: Gavin Hu <gavin.hu at arm.com>
> Reviewed-by: Honnappa Nagarahalli <Honnappa.Nagarahalli at arm.com>
> ---
>   lib/librte_hash/Makefile          |  2 +-
>   lib/librte_hash/rte_cuckoo_hash.c | 11 ++++-------
>   2 files changed, 5 insertions(+), 8 deletions(-)
> 
> diff --git a/lib/librte_hash/Makefile b/lib/librte_hash/Makefile
> index c8c435dfd..5669d83f4 100644
> --- a/lib/librte_hash/Makefile
> +++ b/lib/librte_hash/Makefile
> @@ -6,7 +6,7 @@ include $(RTE_SDK)/mk/rte.vars.mk
>   # library name
>   LIB = librte_hash.a
>   
> -CFLAGS += -O3
> +CFLAGS += -O3 -DALLOW_EXPERIMENTAL_API

You need to update meson.build as well.


More information about the dev mailing list