From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bruce Richardson Subject: Re: [PATCH v2 2/2] hash: flush the rings instead of dequeuing one by one Date: Wed, 12 Dec 2018 03:15:59 -0700 Message-ID: <20181212101558.GB28296@bricha3-MOBL.ger.corp.intel.com> References: <20181212062404.30243-1-gavin.hu@arm.com> <20181212064733.1008-1-gavin.hu@arm.com> <20181212064733.1008-3-gavin.hu@arm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: dev@dpdk.org, nd@arm.com, thomas@monjalon.net, jerin.jacob@caviumnetworks.com, hemant.agrawal@nxp.com, Honnappa.Nagarahalli@arm.com, stable@dpdk.org To: Gavin Hu Return-path: Content-Disposition: inline In-Reply-To: <20181212064733.1008-3-gavin.hu@arm.com> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Wed, Dec 12, 2018 at 02:47:33PM +0800, 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@dpdk.org > > Signed-off-by: Gavin Hu > Reviewed-by: Honnappa Nagarahalli > --- > 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 > CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR) > LDLIBS += -lrte_eal -lrte_ring > Is a similar change needed to meson.build?