[dpdk-dev] [PATCH v2] hash table: add an iterator over conflicting entries

Michel Machado michel at digirati.com.br
Sun Aug 19 01:08:10 CEST 2018


On 08/17/2018 03:41 PM, Honnappa Nagarahalli wrote:
> Can you elaborate more on using ' struct rte_conflict_iterator_state' as the argument for the API?
> 
> If the API signature is changed to: rte_hash_iterate_conflict_entries (const struct rte_hash *h, void **key, void **data, const hash_sig_t sig, struct rte_conflict_iterator_state *state) - it will be inline with the existing APIs. Contents of 'state' must be initialized to 0 for the first call. This will also avoid creating 'rte_hash_iterator_conflict_entries_init' API.

    Testing `state' every time rte_hash_iterate_conflict_entries() is 
called to find out if it's the first call of the iterator will possibly 
add some small, but unnecessary, overhead on 
rte_hash_iterate_conflict_entries() and constraints on struct 
rte_conflict_iterator_state. Moreover, 
rte_hash_iterator_conflict_entries_init() enables one to easily add 
variations of the init function to initialize the state (e.g. using a 
key instead of a sig) and still use the exactly same iterator.

[ ]'s
Michel Machado


More information about the dev mailing list