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:50:36 -0400 [thread overview]
Message-ID: <20190828075036.7af36efe@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:
> +
> +/* To enable the deletion when iterating the list */
> +#ifndef LIST_FOREACH_SAFE
> +#define LIST_FOREACH_SAFE(var, head, field, tvar) \
> + for ((var) = ((head)->lh_first); \
> + (var) && ((tvar) = ((var)->field.le_next), 1); \
> + (var) = (tvar))
> +#endif
> +
> +/* To move the whole list from one head to another */
> +#define LIST_MOVE_TO_NEW_HEAD(new, old, field) do { \
> + (new)->lh_first = (old)->lh_first; \
> + if (((new)->lh_first) != NULL) \
> + (new)->lh_first->field.le_prev = &(new)->lh_first; \
> +} while (/*CONSTCOND*/0)
> +
Why not use BSD style lists, rather than reinventing it here.
next prev parent reply other threads:[~2019-08-28 11:50 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 [this message]
2019-08-28 11:51 ` Stephen Hemminger
2019-08-28 11:53 ` Stephen Hemminger
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=20190828075036.7af36efe@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.