From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.lysator.liu.se (mail.lysator.liu.se [130.236.254.3]) by dpdk.org (Postfix) with ESMTP id E63181B433; Wed, 12 Dec 2018 20:28:25 +0100 (CET) Received: from mail.lysator.liu.se (localhost [127.0.0.1]) by mail.lysator.liu.se (Postfix) with ESMTP id 2FAC94001B; Wed, 12 Dec 2018 20:28:25 +0100 (CET) Received: by mail.lysator.liu.se (Postfix, from userid 1004) id E2AB140016; Wed, 12 Dec 2018 20:28:24 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on bernadotte.lysator.liu.se X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,AWL autolearn=disabled version=3.4.1 X-Spam-Score: -0.9 Received: from [192.168.1.59] (host-90-232-140-56.mobileonline.telia.com [90.232.140.56]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.lysator.liu.se (Postfix) with ESMTPSA id 9813840014; Wed, 12 Dec 2018 20:28:16 +0100 (CET) To: Gavin Hu , dev@dpdk.org Cc: nd@arm.com, thomas@monjalon.net, jerin.jacob@caviumnetworks.com, hemant.agrawal@nxp.com, Honnappa.Nagarahalli@arm.com, stable@dpdk.org References: <20181212062404.30243-1-gavin.hu@arm.com> <20181212064733.1008-1-gavin.hu@arm.com> <20181212064733.1008-3-gavin.hu@arm.com> From: =?UTF-8?Q?Mattias_R=c3=b6nnblom?= Message-ID: <4b9c273a-643d-6421-c0c0-2b0b047e2079@ericsson.com> Date: Wed, 12 Dec 2018 20:28:15 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 MIME-Version: 1.0 In-Reply-To: <20181212064733.1008-3-gavin.hu@arm.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV using ClamSMTP Subject: Re: [dpdk-dev] [PATCH v2 2/2] hash: flush the rings instead of dequeuing one by one 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, 12 Dec 2018 19:28:26 -0000 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@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 You need to update meson.build as well.