From: Patrick McHardy <kaber@trash.net>
To: Pablo Neira Ayuso <pablo@netfilter.org>
Cc: netfilter-devel@vger.kernel.org
Subject: Re: [PATCH 5/7] netfilter: nf_tables: move set handling to the transaction infrastructure
Date: Fri, 28 Mar 2014 13:00:40 +0000 [thread overview]
Message-ID: <20140328130040.GE7895@macbook.localnet> (raw)
In-Reply-To: <1395957197-4899-6-git-send-email-pablo@netfilter.org>
On Thu, Mar 27, 2014 at 10:53:15PM +0100, Pablo Neira Ayuso wrote:
> This patch reworks the nf_tables API so set updates are moved into
> the same batch that contains rule updates. This speeds up rule-set
> updates we skip a dialog of four messages between kernel and
> user-space (two on each direction).
>
> 1) create the set and send netlink message to the kernel
> 2) process the response from the kernel that contains the allocated name.
> 3) add the set elements and send netlink message to the kernel.
> 4) process the response from the kernel (to check for errors).
>
> To:
>
> 1) add the set to the batch.
> 2) add the set elements to the batch.
> 3) add the rule that points to the set.
> 4) send batch to the kernel.
>
> The idea is to allocate an internal set ID to the batch that can be
> used when adding set elements and rules that refer to the set in the
> batch.
>
> Note that this patch doesn't add atomic set element updates, it just
> helps to leave the set configuration in consistent state in case
> that we fail to load the entire batch for some reason.
Looks fine to me. However I'm wondering whether this couldn't be
simplified. Basically all we need is a way to detect sets contained
in the batch for abort/commit, which could be achieved using a single
flag. The sets don't have any direct impact on runtime and they're
not visible to userspace as long as we hold the nfnl. So all we need
to do on abort is kill all the sets with this flag, on commit we
clear the flag and send notifications.
> Backward compatibility has been only retained in userspace, this
> means that new nft versions can talk to the kernel both in the new
> and the old fashion.
And old nftables can't talk to new kernels?
next prev parent reply other threads:[~2014-03-28 13:00 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-27 21:53 [PATCH 0/7] new transaction infrastructure for nf_tables Pablo Neira Ayuso
2014-03-27 21:53 ` [PATCH 1/7] netfilter: nf_tables: deconstify table and chain in context structure Pablo Neira Ayuso
2014-03-28 12:42 ` Patrick McHardy
2014-03-28 12:57 ` Pablo Neira Ayuso
2014-03-27 21:53 ` [PATCH 2/7] netfilter: nf_tables: generalise transaction infrastructure Pablo Neira Ayuso
2014-03-28 12:42 ` Patrick McHardy
2014-03-27 21:53 ` [PATCH 3/7] netfilter: nf_tables: relocate commit and abort routines in the source file Pablo Neira Ayuso
2014-03-27 21:53 ` [PATCH 4/7] netfilter: nf_tables: better encapsulation for the rule transaction code Pablo Neira Ayuso
2014-03-28 12:53 ` Patrick McHardy
2014-03-27 21:53 ` [PATCH 5/7] netfilter: nf_tables: move set handling to the transaction infrastructure Pablo Neira Ayuso
2014-03-28 13:00 ` Patrick McHardy [this message]
2014-03-27 21:53 ` [PATCH 6/7] netfilter: nf_tables: move chain " Pablo Neira Ayuso
2014-03-28 13:10 ` Patrick McHardy
2014-03-27 21:53 ` [PATCH 7/7] netfilter: nf_tables: move table " Pablo Neira Ayuso
2014-03-28 13:12 ` Patrick McHardy
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=20140328130040.GE7895@macbook.localnet \
--to=kaber@trash.net \
--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).