From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id C6C59C5FE for ; Thu, 16 Jun 2016 12:55:29 +0200 (CEST) Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga103.jf.intel.com with ESMTP; 16 Jun 2016 03:55:28 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.26,480,1459839600"; d="scan'208";a="122962466" Received: from bricha3-mobl3.ger.corp.intel.com ([10.237.220.182]) by fmsmga004.fm.intel.com with SMTP; 16 Jun 2016 03:55:27 -0700 Received: by (sSMTP sendmail emulation); Thu, 16 Jun 2016 11:55:25 +0025 Date: Thu, 16 Jun 2016 11:55:25 +0100 From: Bruce Richardson To: Juan Antonio Montesinos Delgado Cc: Yari Adan PETRALANDA , "pablo.de.lara.guarch@intel.com" , "dev@dpdk.org" Message-ID: <20160616105525.GE11016@bricha3-MOBL3> References: <576261C6.2050600@ericsson.com> <20160616095026.GD11016@bricha3-MOBL3> <3781680C02E745459CFC91251B914AEB5F099E@ESESSMB207.ericsson.se> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3781680C02E745459CFC91251B914AEB5F099E@ESESSMB207.ericsson.se> Organization: Intel Research and =?iso-8859-1?Q?De=ACvel?= =?iso-8859-1?Q?opment?= Ireland Ltd. User-Agent: Mutt/1.5.23 (2014-03-12) Subject: Re: [dpdk-dev] [PATCH] hash: new function to retrieve a key given its position X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Jun 2016 10:55:30 -0000 On Thu, Jun 16, 2016 at 10:23:42AM +0000, Juan Antonio Montesinos Delgado wrote: > Hi, > > As I understand it, the hash table entry can change position in the first hash table but the index in the second hash table remains the same. So, regardless the bucket the entry is in, the index (of the second hash table) stored in that entry will be the same. Am I right? > > Best, > > Juan Antonio > Ah, yes, you are right. The key data should not move, only the hash value. I'd forgotten that. /Bruce > -----Original Message----- > From: Bruce Richardson [mailto:bruce.richardson@intel.com] > Sent: jueves, 16 de junio de 2016 11:50 > To: Yari Adan PETRALANDA > Cc: pablo.de.lara.guarch@intel.com; Juan Antonio Montesinos Delgado ; dev@dpdk.org > Subject: Re: [PATCH] hash: new function to retrieve a key given its position > > On Thu, Jun 16, 2016 at 10:22:30AM +0200, Yari Adan Petralanda wrote: > > The function rte_hash_get_key_with_position is added in this patch. > > As the position returned when adding a key is frequently used as an > > offset into an array of user data, this function performs the > > operation of retrieving a key given this offset. > > > > A possible use case would be to delete a key from the hash table when > > its entry in the array of data has certain value. For instance, the > > key could be a flow 5-tuple, and the value stored in the array a time stamp. > > > > I have my doubts that this will work. With cuckoo hashing, a hash table entry can change position multiple times after it is added, as the table is reorganised to make room for new entries. > > Regards, > /Bruce >