[dpdk-dev] [PATCH] table: hash: fix entry size of configurable key size ext and lru

Thomas Monjalon thomas.monjalon at 6wind.com
Wed Nov 26 22:18:22 CET 2014


Hi,

2014-08-11 12:43, Takayuki Usui:
> Signed-off-by: Takayuki Usui <takayuki at midokura.com>
> ---
>  lib/librte_table/rte_table_hash_ext.c | 2 +-
>  lib/librte_table/rte_table_hash_lru.c | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/lib/librte_table/rte_table_hash_ext.c b/lib/librte_table/rte_table_hash_ext.c
> index 6e26d98..8b86fab 100644
> --- a/lib/librte_table/rte_table_hash_ext.c
> +++ b/lib/librte_table/rte_table_hash_ext.c
> @@ -221,7 +221,7 @@ rte_table_hash_ext_create(void *params, int socket_id, uint32_t entry_size)
>  	/* Internal */
>  	t->bucket_mask = t->n_buckets - 1;
>  	t->key_size_shl = __builtin_ctzl(p->key_size);
> -	t->data_size_shl = __builtin_ctzl(p->key_size);
> +	t->data_size_shl = __builtin_ctzl(entry_size);
>  
>  	/* Tables */
>  	table_meta_offset = 0;
> diff --git a/lib/librte_table/rte_table_hash_lru.c b/lib/librte_table/rte_table_hash_lru.c
> index d1a4984..bf92e81 100644
> --- a/lib/librte_table/rte_table_hash_lru.c
> +++ b/lib/librte_table/rte_table_hash_lru.c
> @@ -192,7 +192,7 @@ rte_table_hash_lru_create(void *params, int socket_id, uint32_t entry_size)
>  	/* Internal */
>  	t->bucket_mask = t->n_buckets - 1;
>  	t->key_size_shl = __builtin_ctzl(p->key_size);
> -	t->data_size_shl = __builtin_ctzl(p->key_size);
> +	t->data_size_shl = __builtin_ctzl(entry_size);
>  
>  	/* Tables */
>  	table_meta_offset = 0;

A similar patch has been recently applied:
	http://dpdk.org/browse/dpdk/commit/?id=8595428e50

Cristian, as the author of this library, it would be appreciated that you
review and ack such patch. It's important to accept contributions and give
credit to the first author of a patch.

Thanks
-- 
Thomas


More information about the dev mailing list