From: Patrick McHardy <kaber@trash.net>
To: Pablo Neira Ayuso <pablo@netfilter.org>
Cc: netfilter-devel@vger.kernel.org
Subject: Re: nft netdev family bindings
Date: Tue, 9 Jun 2015 14:13:25 +0200 [thread overview]
Message-ID: <20150609121325.GA8111@acer.localdomain> (raw)
In-Reply-To: <20150609114630.GA2995@salvia>
On 09.06, Pablo Neira Ayuso wrote:
> On Tue, Jun 09, 2015 at 12:57:12PM +0200, Patrick McHardy wrote:
> > On 09.06, Pablo Neira Ayuso wrote:
> > >
> > > We can also achieve this sharing with the approach I describe above, I
> > > don't see any limitation on that.
> >
> > Its not a limitation, merely something that seems slightly inconsistent.
> > The base chain definitions basically define the entry points and in this
> > case we define them in two steps, unlike in the other cases.
> >
> > It also matches better what we have in the kernel. Its actually the
> > hooks that are per device and nothing else.
>
> It's an abstraction so it's normal that we get out a bit from the hook
> representation in the kernel. Chains are not a 1:1 map with the hook
> object anyway.
The question is if its the correct abstraction, and I don't think so.
The device binding doesn't apply to sets, it doesn't apply to chains,
it doesn't apply to any table objects except for hooks, and this is
exactly where we already have the concept of a binding. I mean, the
binding is not even a binding. Nothing is bound to the device, it
is in fact a hook specification.
We even have the concept of multiple bindings by using multiple base
chains, which would have to be duplicated for your multiple device
binding idea.
> I think this representation is a bit more compact:
>
> table netdev global {
> device { eth0, eth1; }
>
> chain ingress {
> type filter hook ingress priority 0\;
> ... your rules here, no need for shared_chain ...
> }
> }
>
> than this:
>
> table netdev global {
> chain eth0 {
> hook eth0 ingress;
> jump shared_chain;
> }
> chain eth1 {
> hook eth1 ingress;
> jump shared_chain;
> }
> chain shared_chain {
> ... your rules here ...
> }
> }
>
> If we aim to also have an egress hooks as well, then this may look a
> bit convoluted.
>
> On the performance front, this also saves some extra overhead on the
> packet path since we don't need the chain jump.
It really depends. Assuming (which is not unlikely) that people will also
have device specific rules they will create extra chains per device
and jump to them. In the end, it really depends on the use case.
next prev parent reply other threads:[~2015-06-09 12:13 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-05 13:35 nft netdev family bindings Patrick McHardy
2015-06-05 15:58 ` Pablo Neira Ayuso
2015-06-05 15:59 ` Patrick McHardy
2015-06-05 16:47 ` Patrick McHardy
2015-06-08 11:40 ` Pablo Neira Ayuso
2015-06-09 9:23 ` Patrick McHardy
2015-06-09 10:52 ` Pablo Neira Ayuso
2015-06-09 10:57 ` Patrick McHardy
2015-06-09 11:46 ` Pablo Neira Ayuso
2015-06-09 12:13 ` Patrick McHardy [this message]
2015-06-10 14:02 ` Pablo Neira Ayuso
2015-06-10 15:37 ` 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=20150609121325.GA8111@acer.localdomain \
--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).