From: Stephen Hemminger <stephen@networkplumber.org>
To: Bing Zhao <bingz@mellanox.com>
Cc: yipeng1.wang@intel.com, sameh.gobriel@intel.com,
bruce.richardson@intel.com, pablo.de.lara.guarch@intel.com,
dev@dpdk.org
Subject: Re: [dpdk-dev] [RFC] rte_hash: introduce hash list into hash lib
Date: Wed, 28 Aug 2019 07:53:47 -0400 [thread overview]
Message-ID: <20190828075347.0efeee91@xps13> (raw)
In-Reply-To: <1566975109-318949-2-git-send-email-bingz@mellanox.com>
On Wed, 28 Aug 2019 14:51:49 +0800
Bing Zhao <bingz@mellanox.com> wrote:
> +
> +/** Node element structure on the LIST of the link */
> +struct rte_hlist_node_entry {
> + LIST_ENTRY(rte_hlist_node_entry) next; /**< Next element pointer. */
> + /**< Data element inside this noed. */
> + struct rte_hlist_data_element d;
> + char key[]; /**< Copied and stored key. */
> +};
> +
> +/** Head of all the nodes with the same hash value */
> +struct rte_hlist_head_entry {
> + LIST_HEAD(, rte_hlist_node_entry) head; /**< Head for each hash list. */
> + /**< Current items in the list. */
> + uint16_t entries_in_bucket;
> + /**< Shift number for extension */
> + uint16_t bucket_shift;
> +};
> +
> +/** The hlist table structure. */
> +struct rte_hlist_table {
> + char name[RTE_HLIST_NAMESIZE]; /**< Name of the hash. */
> + uint32_t entries; /**< Total number of entries. */
> + uint32_t entries_per_bucket; /**< Number of entries in a list. */
> + /**< Number of entries with data from customer. */
> + uint32_t custom_entries;
> + uint16_t key_len; /**< Length of the key. */
> + /**< Shift number of the whole table. */
> + uint16_t bucket_shift;
> + /**< To find which list the key is in. */
> + uint32_t bucket_mask;
> + rte_hlist_calc_fn hash_func; /**< The hash function to calcuate. */
> + /**< The function to free the custom data. */
> + rte_hlist_free_fn free_func;
> + uint32_t init_val; /**< For initializing hash function. */
> + /**< Reserved for fast shrinking of the table. */
> + char *map;
You probably should use void * for that.
> + /**< A flat and extendible table of all lists. */
> + struct rte_hlist_head_entry *t;
> +};
> +
Since API/ABI considerations are important.
You will save yourself a lot of pain if these structures can be made
private and only part of rte_hlist.c.
next prev parent reply other threads:[~2019-08-28 11:53 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-28 6:51 [dpdk-dev] [RFC] hash: introduce resizable hash list Bing Zhao
2019-08-28 6:51 ` [dpdk-dev] [RFC] rte_hash: introduce hash list into hash lib Bing Zhao
2019-08-28 11:50 ` Stephen Hemminger
2019-08-28 11:51 ` Stephen Hemminger
2019-08-28 11:53 ` Stephen Hemminger [this message]
2019-09-05 19:25 ` [dpdk-dev] [RFC] hash: introduce resizable hash list Wang, Yipeng1
2019-09-12 5:41 ` Bing Zhao
2019-09-21 1:16 ` Wang, Yipeng1
2023-06-12 16:44 ` Stephen Hemminger
2023-06-13 6:34 ` Bing Zhao
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=20190828075347.0efeee91@xps13 \
--to=stephen@networkplumber.org \
--cc=bingz@mellanox.com \
--cc=bruce.richardson@intel.com \
--cc=dev@dpdk.org \
--cc=pablo.de.lara.guarch@intel.com \
--cc=sameh.gobriel@intel.com \
--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).