netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Patrick McHardy <kaber@trash.net>
To: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Cc: Arturo Borrero Gonzalez <arturo.borrero.glez@gmail.com>,
	Pablo Neira Ayuso <pablo@netfilter.org>,
	Netfilter Development Mailing list
	<netfilter-devel@vger.kernel.org>
Subject: Re: nftables add vs replace
Date: Tue, 21 Jan 2014 12:25:32 +0000	[thread overview]
Message-ID: <20140121122532.GA30955@macbook.localnet> (raw)
In-Reply-To: <52DE655B.9020105@linux.intel.com>

On Tue, Jan 21, 2014 at 02:17:31PM +0200, Tomasz Bursztyka wrote:
> 
> >>Actually, after your patch and Arturo's, it could be possible to
> >>improve the ruleset management so
> >>it would use create/add/replace accordingly.
> >>
> >>Though it means it would need to dump first the targeted
> >>tables/chains to do so,
> >>thus I am not sure how relevant is my blabbering from performance
> >>point of view.
> >How would that work? Dumping rules, flushing the old ones and reinstalling
> >them is prone to race conditions.
> 
> There would be no flushing involved.
> Comparing the dump vs the input ruleset you would know what to
> remove/replace/add.
> 
> But maybe there is no benefit from that anyway.

I still I don't see how this helps. Incremental updates already work,
the two problems I see are:

- create something only iff it doesn't exist: easy, not use NLM_F_EXCL
- replace entire tables or chains: harder since the transactions need to
  handle tables, chains and sets which they currently don't. For basechains
  this goes down all the way to nf_register_hooks() since we need to
  atomically replace the hooks.


  reply	other threads:[~2014-01-21 12:25 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-21 11:06 nftables add vs replace Patrick McHardy
2014-01-21 11:27 ` Pablo Neira Ayuso
2014-01-21 11:32   ` Patrick McHardy
2014-01-21 11:37   ` Arturo Borrero Gonzalez
2014-01-21 11:45     ` Patrick McHardy
2014-01-21 15:15       ` Phil Oester
2014-01-21 17:37         ` Patrick McHardy
2014-01-22  8:38       ` Pablo Neira Ayuso
2014-01-22  8:54         ` Patrick McHardy
2014-01-22  9:17           ` Pablo Neira Ayuso
2014-01-22  9:30             ` Patrick McHardy
2014-01-21 11:46     ` Tomasz Bursztyka
2014-01-21 11:49       ` Patrick McHardy
2014-01-21 12:08         ` Tomasz Bursztyka
2014-01-21 12:11           ` Patrick McHardy
2014-01-21 12:17             ` Tomasz Bursztyka
2014-01-21 12:25               ` Patrick McHardy [this message]
2014-01-21 12:49                 ` Tomasz Bursztyka
2014-01-21 14:05                   ` Arturo Borrero Gonzalez
2014-01-21 15:10                     ` 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=20140121122532.GA30955@macbook.localnet \
    --to=kaber@trash.net \
    --cc=arturo.borrero.glez@gmail.com \
    --cc=netfilter-devel@vger.kernel.org \
    --cc=pablo@netfilter.org \
    --cc=tomasz.bursztyka@linux.intel.com \
    /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).