Linux Netfilter development
 help / color / mirror / Atom feed
From: Florian Westphal <fw@strlen.de>
To: Pablo Neira Ayuso <pablo@netfilter.org>
Cc: Florian Westphal <fw@strlen.de>, netfilter-devel@vger.kernel.org
Subject: Re: [RFC nf] netfilter: nf_tables: nft_set_rbtree: invalidate greater range element on removal
Date: Fri, 22 Sep 2023 12:27:42 +0200	[thread overview]
Message-ID: <20230922102742.GE17533@breakpoint.cc> (raw)
In-Reply-To: <ZQ1ohTAB/u2XZRpV@calendula>

Pablo Neira Ayuso <pablo@netfilter.org> wrote:
> > Main agenda here is to not just fix the spurious failure but to
> > get rid of the async gc worker.
> 
> I would like to move this sync GC collection from insert() path, it is
> sloppy and zapping entries that we hold references to as in this case.
> I would like to move to use the .commit phase just like pipapo.

I can experiment with this next week.

I already have a patch that converts async to sync gc similar to
pipapo but it currently keeps the limited on-demand cycle too.

> The only solution I can see right now is to maintain two copies of the
> rbtree, just like pipapo, then use the .commit phase, I started
> sketching this updates.

I would like to avoid this, see below.

> Meanwhile setting rbe_ge and rbe_le to NULL if the element that is
> referenced is removed makes sense to me.

Great, I will submit this patch formally with a slightly updated
commit message.

> The current GC sync inlined in insert() is also making it hard to
> support for timeout refresh (element update command) without
> reintroducing the _BUSY bit, which is something I would like to skip.

Ugh, yes, no busy bit please.

> Then, there is another possibility that is to provide a hint to
> userspace to use pipapo instead rbtree, via _GENMSG, but there is a
> need to update pipapo to allow for singleton sets (with no
> concatenation), which requires a oneliner in the kernel.
>
> The rbtree set backend is the corner that holds more technical debt
> IMO.

I'm all in favor of getting rid of rbtree where possible.
So we can keep it in-tree with 'acceptable' shortcomings (= no crashes)
but userspace would no longer use it.

  reply	other threads:[~2023-09-22 10:27 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-21 13:52 [RFC nf] netfilter: nf_tables: nft_set_rbtree: invalidate greater range element on removal Florian Westphal
2023-09-22 10:12 ` Pablo Neira Ayuso
2023-09-22 10:27   ` Florian Westphal [this message]
2023-09-22 11:15     ` Pablo Neira Ayuso

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=20230922102742.GE17533@breakpoint.cc \
    --to=fw@strlen.de \
    --cc=netfilter-devel@vger.kernel.org \
    --cc=pablo@netfilter.org \
    /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