DPDK patches and discussions
 help / color / mirror / Atom feed
From: Michel Machado <michel@digirati.com.br>
To: Honnappa Nagarahalli <Honnappa.Nagarahalli@arm.com>,
	"Fu, Qiaobin" <qiaobinf@bu.edu>,
	"Richardson, Bruce" <bruce.richardson@intel.com>,
	"De Lara Guarch, Pablo" <pablo.de.lara.guarch@intel.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>,
	"Doucette, Cody, Joseph" <doucette@bu.edu>,
	"Wang, Yipeng1" <yipeng1.wang@intel.com>,
	"Wiles, Keith" <keith.wiles@intel.com>,
	"Gobriel, Sameh" <sameh.gobriel@intel.com>,
	"Tai, Charlie" <charlie.tai@intel.com>,
	Stephen Hemminger <stephen@networkplumber.org>, nd <nd@arm.com>
Subject: Re: [dpdk-dev] [PATCH v2] hash table: add an iterator over conflicting entries
Date: Sat, 18 Aug 2018 18:45:08 -0400	[thread overview]
Message-ID: <c9ffd6f7-7b39-218d-d570-bffae1130cac@digirati.com.br> (raw)
In-Reply-To: <AM6PR08MB3672A461DF5F8D29F607846C983D0@AM6PR08MB3672.eurprd08.prod.outlook.com>

On 08/17/2018 03:41 PM, Honnappa Nagarahalli wrote:
>> Do we also need to have 'rte_hash_iterate_conflict_entries_with_hash' API?
> 
>      I may have not understood the question. We are already working with the hash (i.e. sig). Did you mean something else?
> 
> Let me elaborate. For the API 'rte_hash_lookup', there are multiple variations such as 'rte_hash_lookup_with_hash', 'rte_hash_lookup_data', 'rte_hash_lookup_with_hash_data' etc. We do not need to create similar variations for 'rte_hash_iterate_conflict_entries' API right now. But the naming of the API should be such that these variations can be created in the future.

    So you mean that we should actually name 
rte_hash_iterator_conflict_entries_init() as 
rte_hash_iterator_conflict_entries_init_with_hash()? I'd be fine with this.

>> diff --git a/lib/librte_hash/rte_hash.h b/lib/librte_hash/rte_hash.h
>> index f71ca9fbf..7ecb6a7eb 100644
>> --- a/lib/librte_hash/rte_hash.h
>> +++ b/lib/librte_hash/rte_hash.h
>> @@ -61,6 +61,11 @@ struct rte_hash_parameters {
>>    /** @internal A hash table structure. */  struct rte_hash;
>>    
>> +/** @internal A hash table conflict iterator state structure. */
>> +struct rte_conflict_iterator_state {
>> +	uint8_t space[64];
>> +};
>> +
> Needs aligning to cache line.

    Ok.

>> The size depends on the current size of the state, which is subject to change with the algorithm used.
> 
>      We chose a size that should be robust for any future underlying algorithm. Do you have a suggestion on how to go about it? We chose to have a simple struct to enable applications to allocate a state as a local variable and avoid a memory allocation.
> 
> This looks fine after your explanation. The structure name can be changed to 'rte_iterator_state' so that it can be used in other iterator APIs too.

    I like this suggestion. What about the name 
"rte_hash_iterator_state" to make it specific to the hash table?

[ ]'s
Michel Machado

  reply	other threads:[~2018-08-18 22:45 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-16  7:30 Fu, Qiaobin
2018-08-17  2:33 ` Honnappa Nagarahalli
2018-08-17 13:34   ` Michel Machado
2018-08-17 19:41     ` Honnappa Nagarahalli
2018-08-18 22:45       ` Michel Machado [this message]
2018-08-18 23:08       ` Michel Machado
2018-08-21  5:10         ` Honnappa Nagarahalli
2018-08-21 12:41           ` Michel Machado
2018-08-21 23:42             ` Honnappa Nagarahalli
2018-08-24  0:33               ` Wang, Yipeng1
2018-08-24 12:34                 ` Michel Machado
2018-08-27  3:12                   ` Honnappa Nagarahalli
2018-08-27 18:27                     ` Michel Machado

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=c9ffd6f7-7b39-218d-d570-bffae1130cac@digirati.com.br \
    --to=michel@digirati.com.br \
    --cc=Honnappa.Nagarahalli@arm.com \
    --cc=bruce.richardson@intel.com \
    --cc=charlie.tai@intel.com \
    --cc=dev@dpdk.org \
    --cc=doucette@bu.edu \
    --cc=keith.wiles@intel.com \
    --cc=nd@arm.com \
    --cc=pablo.de.lara.guarch@intel.com \
    --cc=qiaobinf@bu.edu \
    --cc=sameh.gobriel@intel.com \
    --cc=stephen@networkplumber.org \
    --cc=yipeng1.wang@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).