netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Phil Sutter <phil@nwl.cc>
To: Pablo Neira Ayuso <pablo@netfilter.org>
Cc: netfilter-devel@vger.kernel.org, fw@strlen.de
Subject: Re: [PATCH nft,v2] cache: do not populate the cache in case of flush ruleset command
Date: Fri, 14 Jun 2019 15:41:24 +0200	[thread overview]
Message-ID: <20190614134124.GP31548@orbyte.nwl.cc> (raw)
In-Reply-To: <20190614130438.y6stvoi3ydz33s55@salvia>

Hi Pablo,

On Fri, Jun 14, 2019 at 03:04:38PM +0200, Pablo Neira Ayuso wrote:
> On Fri, Jun 14, 2019 at 02:59:10PM +0200, Pablo Neira Ayuso wrote:
> > On Fri, Jun 14, 2019 at 02:54:32PM +0200, Phil Sutter wrote:
> > > Hi Pablo,
> > > 
> > > On Fri, Jun 14, 2019 at 02:36:30PM +0200, Pablo Neira Ayuso wrote:
> > > > __CMD_FLUSH_RULESET is a dummy definition that used to skip the netlink
> > > > dump to populate the cache. This patch is a workaround until we have a
> > > > better infrastructure to track the state of the cache objects.
> > > 
> > > I assumed the problem wouldn't exist anymore since we're populating the
> > > cache just once. Can you maybe elaborate a bit on the problem you're
> > > trying to solve with that workaround?
> > 
> > If nft segfaults to dump the cache, 'nft flush ruleset' will not work
> > since it always fetches the cache, it will segfault too.
> > 
> > The flush ruleset command was still dumping the cache before this
> > patch.
> 
> In general, we still need to improve the cache logic, to make it finer
> grain. Now that we have a single point to populate the cache, things
> will get more simple. We need to replace the cache command level to
> cache flags or our own cache level definitions. The existing approach
> that uses of commands to define the cache level completeness has its
> own limitations. We can discuss this during the NFWS :-).

Yes, I had the same thought already. It is quite unintuitive how we link
cache completeness to certain commands. :)

Regarding your problem, maybe cache_update() should exit immediately if
passed cmd is CMD_INVALID? Unless I miss something, if cache_evaluate()
returns that value, we don't need a cache at all.

Cheers, Phil

  reply	other threads:[~2019-06-14 13:41 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-14 12:36 [PATCH nft,v2] cache: do not populate the cache in case of flush ruleset command Pablo Neira Ayuso
2019-06-14 12:54 ` Phil Sutter
2019-06-14 12:59   ` Pablo Neira Ayuso
2019-06-14 13:04     ` Pablo Neira Ayuso
2019-06-14 13:41       ` Phil Sutter [this message]
2019-06-17 13:07         ` 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=20190614134124.GP31548@orbyte.nwl.cc \
    --to=phil@nwl.cc \
    --cc=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;
as well as URLs for NNTP newsgroup(s).