DPDK patches and discussions
 help / color / mirror / Atom feed
* Re: [dpdk-dev] [PATCH] hash: new function to retrieve a key given its position
       [not found] <576261C6.2050600@ericsson.com>
@ 2016-06-16  9:50 ` Bruce Richardson
       [not found]   ` <3781680C02E745459CFC91251B914AEB5F099E@ESESSMB207.ericsson.se>
  2016-06-16 12:23 ` De Lara Guarch, Pablo
  1 sibling, 1 reply; 3+ messages in thread
From: Bruce Richardson @ 2016-06-16  9:50 UTC (permalink / raw)
  To: Yari Adan Petralanda
  Cc: pablo.de.lara.guarch, Juan Antonio Montesinos Delgado, dev

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [dpdk-dev] [PATCH] hash: new function to retrieve a key given its position
       [not found]   ` <3781680C02E745459CFC91251B914AEB5F099E@ESESSMB207.ericsson.se>
@ 2016-06-16 10:55     ` Bruce Richardson
  0 siblings, 0 replies; 3+ messages in thread
From: Bruce Richardson @ 2016-06-16 10:55 UTC (permalink / raw)
  To: Juan Antonio Montesinos Delgado
  Cc: Yari Adan PETRALANDA, pablo.de.lara.guarch, dev

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 <yari.adan.petralanda@ericsson.com>
> Cc: pablo.de.lara.guarch@intel.com; Juan Antonio Montesinos Delgado <juan.antonio.montesinos.delgado@ericsson.com>; 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
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [dpdk-dev] [PATCH] hash: new function to retrieve a key given its position
       [not found] <576261C6.2050600@ericsson.com>
  2016-06-16  9:50 ` [dpdk-dev] [PATCH] hash: new function to retrieve a key given its position Bruce Richardson
@ 2016-06-16 12:23 ` De Lara Guarch, Pablo
  1 sibling, 0 replies; 3+ messages in thread
From: De Lara Guarch, Pablo @ 2016-06-16 12:23 UTC (permalink / raw)
  To: Yari Adan Petralanda, Richardson, Bruce, Juan Antonio Montesinos Delgado
  Cc: dev



> -----Original Message-----
> From: Yari Adan Petralanda [mailto:yari.adan.petralanda@ericsson.com]
> Sent: Thursday, June 16, 2016 9:23 AM
> To: Richardson, Bruce; De Lara Guarch, Pablo; Juan Antonio Montesinos
> Delgado
> Cc: dev@dpdk.org
> Subject: [PATCH] hash: new function to retrieve a key given its position
> 
> 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.
> 
> Signed-off-by: Juan Antonio Montesinos
> <juan.antonio.montesinos.delgado@ericsson.com>
> Signed-off-by: Yari Adan Petralanda <yari.adan.petralanda@ericsson.com>
> 
> ---
>   app/test/test_hash.c                 | 42
> ++++++++++++++++++++++++++++++++++++
>   lib/librte_hash/rte_cuckoo_hash.c    | 18 ++++++++++++++++
>   lib/librte_hash/rte_hash.h           | 18 ++++++++++++++++
>   lib/librte_hash/rte_hash_version.map |  7 ++++++
>   4 files changed, 85 insertions(+)
> 

[...]

> diff --git a/lib/librte_hash/rte_hash_version.map
> b/lib/librte_hash/rte_hash_version.map
> index 4f25436..19a7b26 100644
> --- a/lib/librte_hash/rte_hash_version.map
> +++ b/lib/librte_hash/rte_hash_version.map
> @@ -38,3 +38,10 @@ DPDK_2.2 {
>   	rte_hash_set_cmp_func;
> 
>   } DPDK_2.1;
> +
> +DPDK_16.04 {

This should be DPDK_16.07.

> +	global:
> +
> +	rte_hash_get_key_with_position;
> +
> +}; DPDK_2.2
> --
> 2.1.4
> 


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-06-16 12:23 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <576261C6.2050600@ericsson.com>
2016-06-16  9:50 ` [dpdk-dev] [PATCH] hash: new function to retrieve a key given its position Bruce Richardson
     [not found]   ` <3781680C02E745459CFC91251B914AEB5F099E@ESESSMB207.ericsson.se>
2016-06-16 10:55     ` Bruce Richardson
2016-06-16 12:23 ` De Lara Guarch, Pablo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).