From: Pablo Neira Ayuso <pablo@netfilter.org>
To: Herbert Xu <herbert@gondor.apana.org.au>
Cc: Alexander Aring <aahringo@redhat.com>,
Network Development <netdev@vger.kernel.org>,
kadlec@netfilter.org, fw@strlen.de, gfs2@lists.linux.dev,
David Teigland <teigland@redhat.com>,
tgraf@suug.ch
Subject: Re: nft_rhash_walk, rhashtable and resize event
Date: Mon, 18 Sep 2023 13:59:47 +0200 [thread overview]
Message-ID: <ZQg7s8MtByk4kfzP@calendula> (raw)
In-Reply-To: <ZQUjD0liUnH+ykKY@gondor.apana.org.au>
Hi Herbert,
On Sat, Sep 16, 2023 at 11:37:51AM +0800, Herbert Xu wrote:
> On Fri, Sep 15, 2023 at 10:05:06AM -0400, Alexander Aring wrote:
> >
> > My question is here? Is that allowed to do because a resize event may
> > change the order how to iterate over a rhashtable.
>
> Walking over an rhashtable should be a last resort. There is
> no guarantee of stability.
>
> If you skip entries after a resize then you may miss entries.
One more question: this walk might miss entries but may it also
duplicate the same entries?
> If you want a stable walk, allocate an extra 8 bytes and use
> a linked list.
I will work on a patch to update netfilter clients for this code to
use a rcu linked list.
Thanks.
next prev parent reply other threads:[~2023-09-18 12:00 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-15 14:05 nft_rhash_walk, rhashtable and resize event Alexander Aring
2023-09-16 3:37 ` Herbert Xu
2023-09-18 11:59 ` Pablo Neira Ayuso [this message]
2023-09-18 12:25 ` Herbert Xu
2023-09-18 12:38 ` Alexander Aring
2023-09-19 3:24 ` Herbert Xu
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=ZQg7s8MtByk4kfzP@calendula \
--to=pablo@netfilter.org \
--cc=aahringo@redhat.com \
--cc=fw@strlen.de \
--cc=gfs2@lists.linux.dev \
--cc=herbert@gondor.apana.org.au \
--cc=kadlec@netfilter.org \
--cc=netdev@vger.kernel.org \
--cc=teigland@redhat.com \
--cc=tgraf@suug.ch \
/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.