From mboxrd@z Thu Jan 1 00:00:00 1970 From: "De Lara Guarch, Pablo" Subject: Re: [PATCH v3 4/8] hash: make duplicated code into functions Date: Mon, 9 Jul 2018 14:25:23 +0000 Message-ID: References: <1528455078-328182-1-git-send-email-yipeng1.wang@intel.com> <1530906406-289697-1-git-send-email-yipeng1.wang@intel.com> <1530906406-289697-5-git-send-email-yipeng1.wang@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Cc: "dev@dpdk.org" , "Richardson, Bruce" , "honnappa.nagarahalli@arm.com" , "vguvva@caviumnetworks.com" , "brijesh.s.singh@gmail.com" To: "Wang, Yipeng1" Return-path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id ACCF01B429 for ; Mon, 9 Jul 2018 16:25:48 +0200 (CEST) In-Reply-To: <1530906406-289697-5-git-send-email-yipeng1.wang@intel.com> Content-Language: en-US List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" > -----Original Message----- > From: Wang, Yipeng1 > Sent: Friday, July 6, 2018 8:47 PM > To: De Lara Guarch, Pablo > Cc: dev@dpdk.org; Wang, Yipeng1 ; Richardson, > Bruce ; honnappa.nagarahalli@arm.com; > vguvva@caviumnetworks.com; brijesh.s.singh@gmail.com > Subject: [PATCH v3 4/8] hash: make duplicated code into functions >=20 > This commit refactors the hash table lookup/add/del code to remove some c= ode > duplication. Processing on primary bucket can also apply to secondary buc= ket > with same code. >=20 > Signed-off-by: Yipeng Wang > --- > lib/librte_hash/rte_cuckoo_hash.c | 186 +++++++++++++++++++-------------= ------ ... > @@ -838,41 +830,45 @@ __rte_hash_del_key_with_hash(const struct rte_hash > *h, const void *key, > if (rte_hash_cmp_eq(key, k->key, h) =3D=3D 0) { > remove_entry(h, bkt, i); >=20 > + ret =3D bkt->key_idx[i] - 1; > + bkt->key_idx[i] =3D EMPTY_SLOT; > /* > * Return index where key is stored, > * subtracting the first dummy index > */ > - ret =3D bkt->key_idx[i] - 1; > - bkt->key_idx[i] =3D EMPTY_SLOT; Actually, this change doesn't look needed, right? It looks like you are just moving the two lines before the comment. Apart from this, Acked-by: Pablo de Lara