From: Phil Sutter <phil@nwl.cc>
To: Pablo Neira Ayuso <pablo@netfilter.org>
Cc: netfilter-devel@vger.kernel.org
Subject: Re: [iptables PATCH v4 0/8] Improve iptables-nft performance with large rulesets
Date: Thu, 17 Oct 2019 13:21:39 +0200 [thread overview]
Message-ID: <20191017112139.GI12661@orbyte.nwl.cc> (raw)
In-Reply-To: <20191017090332.erwubv7pzxbbowjg@salvia>
Hi,
On Thu, Oct 17, 2019 at 11:03:32AM +0200, Pablo Neira Ayuso wrote:
> On Tue, Oct 15, 2019 at 01:41:44PM +0200, Phil Sutter wrote:
> > Fourth try at caching optimizations implementation.
> >
> > Changes since v3:
> >
> > * Rebase onto current master after pushing the accepted initial three
> > patches.
> > * Avoid cache inconsistency in __nft_build_cache() if kernel ruleset
> > changed since last call.
>
> I still hesitate with this cache approach.
>
> Can this deal with this scenario? Say you have a ruleset composed on N
> rules.
>
> * Rule 1..M starts using generation X for the evaluation, they pass
> OK.
>
> * Generation is bumped.
>
> * Rule M..N is evaluated with a diferent cache.
>
> So the ruleset evaluation is inconsistent itself since it is based on
> different caches for each rule in the batch.
Yes, that is possible. In a discussion with Florian back when he fixed
for concurrent xtables-restore calls, consensus was: If you use
--noflush and concurrent ruleset updates happen, you're screwed anyway.
(Meaning, results are not predictable and we can't do anything about
it.)
In comparison with current code which just fetches full cache upon
invocation of 'xtables-restore --noflush', problems might not be
detected during evaluation but only later when kernel rejects the
commands.
Eventually, commands have to apply to the ruleset as it is after opening
the transaction. If you cache everything first, you don't detect
incompatible ruleset changes at all. If you cache multiple times, you
may detect the incompatible changes while evaluating but the result is
the same, just with different error messages. :)
Cheers, Phil
prev parent reply other threads:[~2019-10-17 11:21 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-15 11:41 [iptables PATCH v4 0/8] Improve iptables-nft performance with large rulesets Phil Sutter
2019-10-15 11:41 ` [iptables PATCH v4 1/8] nft-cache: Introduce cache levels Phil Sutter
2019-10-17 8:50 ` Pablo Neira Ayuso
2019-10-15 11:41 ` [iptables PATCH v4 2/8] nft-cache: Fetch only chains in nft_chain_list_get() Phil Sutter
2019-10-15 11:41 ` [iptables PATCH v4 3/8] nft-cache: Cover for multiple fetcher invocation Phil Sutter
2019-10-15 11:41 ` [iptables PATCH v4 4/8] nft-cache: Support partial cache per table Phil Sutter
2019-10-15 11:41 ` [iptables PATCH v4 5/8] nft-cache: Support partial rule cache per chain Phil Sutter
2019-10-15 11:41 ` [iptables PATCH v4 6/8] nft: Reduce cache overhead of nft_chain_builtin_init() Phil Sutter
2019-10-15 11:41 ` [iptables PATCH v4 7/8] nft: Support nft_is_table_compatible() per chain Phil Sutter
2019-10-15 11:41 ` [iptables PATCH v4 8/8] nft: Optimize flushing all chains of a table Phil Sutter
2019-10-17 9:03 ` [iptables PATCH v4 0/8] Improve iptables-nft performance with large rulesets Pablo Neira Ayuso
2019-10-17 10:08 ` Pablo Neira Ayuso
2019-10-17 17:06 ` Phil Sutter
2019-10-18 8:34 ` Pablo Neira Ayuso
2019-10-17 11:21 ` Phil Sutter [this message]
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=20191017112139.GI12661@orbyte.nwl.cc \
--to=phil@nwl.cc \
--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).