netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Eric Garver <eric@garver.life>
To: Pablo Neira Ayuso <pablo@netfilter.org>
Cc: netfilter-devel@vger.kernel.org, nhofmeyr@sysmocom.de,
	Phil Sutter <phil@nwl.cc>
Subject: Re: [PATCH nft 2/2,v2] cache: recycle existing cache with incremental updates
Date: Mon, 22 Jul 2024 16:48:40 -0400	[thread overview]
Message-ID: <Zp7FqL_YK3p_dQ8B@egarver-mac> (raw)
In-Reply-To: <20240528152817.856211-2-pablo@netfilter.org>

On Tue, May 28, 2024 at 05:28:17PM +0200, Pablo Neira Ayuso wrote:
> Cache tracking has improved over time by incrementally adding/deleting
> objects when evaluating commands that are going to be sent to the kernel.
> 
> nft_cache_is_complete() already checks that the cache contains objects
> that are required to handle this batch of commands by comparing cache
> flags.
> 
> Infer from the current generation ID if no other transaction has
> invalidated the existing cache, this allows to skip unnecessary cache
> flush then refill situations which slow down incremental updates.
> 
> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
> ---
> v2: no changes

Hi Pablo,

This patch introduced a regression with the index keyword. It seems to
be triggered by adding a rule with "insert", then referencing the new
rule with by "add"-ing another rule using index.

https://github.com/firewalld/firewalld/issues/1366#issuecomment-2243772215

I'm happy to test any fixes.

Thanks.
Eric.


--->8---


# cat /tmp/foo2
add table inet foo
add chain inet foo bar { type filter hook input priority filter; }
add rule inet foo bar accept
insert rule inet foo bar index 0 accept
add rule inet foo bar index 0 accept

# nft delete table inet foo; nft -i < /tmp/foo2 ; nft list table inet foo
Error: Could not process rule: No such file or directory
add rule inet foo bar index 0 accept
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
table inet foo {
        chain bar {
                type filter hook input priority filter; policy accept;
                accept
                accept
        }
}

# git revert e791dbe109b6dd891a63a4236df5dc29d7a4b863
[master 30ae3c684990] Revert "cache: recycle existing cache with incremental updates"
 1 file changed, 3 insertions(+), 15 deletions(-)

# make install
[..]

# nft delete table inet foo; nft -i < /tmp/foo2 ; nft list table inet foo
table inet foo {
        chain bar {
                type filter hook input priority filter; policy accept;
                accept
                accept
                accept
        }
}


  reply	other threads:[~2024-07-22 20:48 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-28 15:28 [PATCH nft 1/2,v2] cache: check for NFT_CACHE_REFRESH in current requested cache too Pablo Neira Ayuso
2024-05-28 15:28 ` [PATCH nft 2/2,v2] cache: recycle existing cache with incremental updates Pablo Neira Ayuso
2024-07-22 20:48   ` Eric Garver [this message]
2024-07-22 21:34     ` Pablo Neira Ayuso
2024-07-23  5:29       ` Phil Sutter
2024-07-23 11:56       ` Phil Sutter
2024-07-23 12:19         ` Pablo Neira Ayuso
2024-07-23 12:57           ` Pablo Neira Ayuso
2024-07-23 15:09             ` Phil Sutter
2024-07-24  7:51               ` Pablo Neira Ayuso
2024-07-23 14:34           ` Phil Sutter
2024-07-23 19:30             ` Eric Garver
2024-07-23 20:56               ` Phil Sutter
2024-07-24  7:44               ` Pablo Neira Ayuso
2024-07-24 11:51                 ` Eric Garver

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=Zp7FqL_YK3p_dQ8B@egarver-mac \
    --to=eric@garver.life \
    --cc=netfilter-devel@vger.kernel.org \
    --cc=nhofmeyr@sysmocom.de \
    --cc=pablo@netfilter.org \
    --cc=phil@nwl.cc \
    /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).