All of lore.kernel.org
 help / color / mirror / Atom feed
From: Imre Palik <imrep@amazon.de>
To: Florian Westphal <fw@strlen.de>, Imre Palik <imrep.amz@gmail.com>
Cc: netdev@vger.kernel.org, bridge@lists.linux-foundation.org,
	linux-kernel@vger.kernel.org,
	Anthony Liguori <aliguori@amazon.com>,
	"David S. Miller" <davem@davemloft.net>
Subject: Re: [Bridge] [RFC PATCH v2] bridge: make it possible for packets to traverse the bridge without hitting netfilter
Date: Thu, 26 Feb 2015 11:19:25 +0100	[thread overview]
Message-ID: <54EEF32D.2010202@amazon.de> (raw)
In-Reply-To: <20150223160619.GF24297@breakpoint.cc>

On 02/23/15 17:06, Florian Westphal wrote:
> Imre Palik <imrep.amz@gmail.com> wrote:
>> The netfilter code is made with flexibility instead of performance in mind.
>> So when all we want is to pass packets between different interfaces, the
>> performance penalty of hitting netfilter code can be considerable, even when
>> all the firewalling is disabled for the bridge.
>>
>> This change makes it possible to disable netfilter on a per bridge basis.
>> In the case interesting to us, this can lead to more than 15% speedup
>> compared to the case when only bridge-iptables is disabled.
> 
> I wonder what the speed difference is between no-rules (i.e., we hit jump label
> in NF_HOOK), one single (ebtables) accept-all rule, and this patch, for
> the call_nf==false case.

ebtables is completely empty:

# ebtables -L
Bridge table: filter

Bridge chain: INPUT, entries: 0, policy: ACCEPT

Bridge chain: FORWARD, entries: 0, policy: ACCEPT

Bridge chain: OUTPUT, entries: 0, policy: ACCEPT


on some bridges I have iptables rules, but on the critical bridges I am running with iptables disabled.

> I guess your 15% speedup figure is coming from ebtables' O(n) rule
> evaluation overhead?  If yes, how many rules are we talking about?

If you are looking for peculiarities in my setup then here they are:
I am on 4k pages, and perf is not working :-(
(I am trying to fix those too, but that is far from being a low hanging fruit.)
So my guess would be that the packet pipeline doesn't fit in the cache/tlb

> Iff thats true, then the 'better' (I know, it won't help you) solution
> would be to use nftables bridgeport-based verdict maps...
> 
> If thats still too much overhead, then we clearly need to do *something*...
> 
> Thanks,
> Florian
> 


WARNING: multiple messages have this Message-ID (diff)
From: Imre Palik <imrep@amazon.de>
To: Florian Westphal <fw@strlen.de>, Imre Palik <imrep.amz@gmail.com>
Cc: <bridge@lists.linux-foundation.org>,
	Stephen Hemminger <stephen@networkplumber.org>,
	"David S. Miller" <davem@davemloft.net>, <netdev@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>,
	Anthony Liguori <aliguori@amazon.com>
Subject: Re: [RFC PATCH v2] bridge: make it possible for packets to traverse the bridge without hitting netfilter
Date: Thu, 26 Feb 2015 11:19:25 +0100	[thread overview]
Message-ID: <54EEF32D.2010202@amazon.de> (raw)
In-Reply-To: <20150223160619.GF24297@breakpoint.cc>

On 02/23/15 17:06, Florian Westphal wrote:
> Imre Palik <imrep.amz@gmail.com> wrote:
>> The netfilter code is made with flexibility instead of performance in mind.
>> So when all we want is to pass packets between different interfaces, the
>> performance penalty of hitting netfilter code can be considerable, even when
>> all the firewalling is disabled for the bridge.
>>
>> This change makes it possible to disable netfilter on a per bridge basis.
>> In the case interesting to us, this can lead to more than 15% speedup
>> compared to the case when only bridge-iptables is disabled.
> 
> I wonder what the speed difference is between no-rules (i.e., we hit jump label
> in NF_HOOK), one single (ebtables) accept-all rule, and this patch, for
> the call_nf==false case.

ebtables is completely empty:

# ebtables -L
Bridge table: filter

Bridge chain: INPUT, entries: 0, policy: ACCEPT

Bridge chain: FORWARD, entries: 0, policy: ACCEPT

Bridge chain: OUTPUT, entries: 0, policy: ACCEPT


on some bridges I have iptables rules, but on the critical bridges I am running with iptables disabled.

> I guess your 15% speedup figure is coming from ebtables' O(n) rule
> evaluation overhead?  If yes, how many rules are we talking about?

If you are looking for peculiarities in my setup then here they are:
I am on 4k pages, and perf is not working :-(
(I am trying to fix those too, but that is far from being a low hanging fruit.)
So my guess would be that the packet pipeline doesn't fit in the cache/tlb

> Iff thats true, then the 'better' (I know, it won't help you) solution
> would be to use nftables bridgeport-based verdict maps...
> 
> If thats still too much overhead, then we clearly need to do *something*...
> 
> Thanks,
> Florian
> 


  reply	other threads:[~2015-02-26 10:19 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-23 15:26 [Bridge] [RFC PATCH v2] bridge: make it possible for packets to traverse the bridge without hitting netfilter Imre Palik
2015-02-23 15:26 ` Imre Palik
2015-02-23 16:06 ` [Bridge] " Florian Westphal
2015-02-23 16:06   ` Florian Westphal
2015-02-23 16:06   ` Florian Westphal
2015-02-26 10:19   ` Imre Palik [this message]
2015-02-26 10:19     ` Imre Palik
2015-02-26 16:34     ` [Bridge] " David Miller
2015-02-26 16:34       ` David Miller
2015-02-26 16:34       ` David Miller
2015-03-06 10:34       ` [Bridge] " Imre Palik
2015-03-06 10:34         ` Imre Palik
2015-03-06 14:29         ` [Bridge] " Pablo Neira Ayuso
2015-03-06 14:29           ` Pablo Neira Ayuso
2015-03-06 16:37           ` [Bridge] " Florian Westphal
2015-03-06 16:37             ` Florian Westphal
2018-03-09 15:31             ` [Bridge] " David Woodhouse
2018-03-09 15:31               ` David Woodhouse
2018-03-09 15:57               ` [Bridge] " David Miller
2018-03-09 15:57                 ` David Miller
2018-03-09 16:15                 ` [Bridge] " David Woodhouse
2018-03-09 16:15                   ` David Woodhouse
2018-03-09 16:26               ` [Bridge] " Florian Westphal
2018-03-09 16:26                 ` Florian Westphal
2015-03-06 17:49         ` [Bridge] " David Miller
2015-03-06 17:49           ` David Miller
2015-03-06 17:49           ` David Miller
2015-02-26 21:17   ` [Bridge] " Felix Fietkau
2015-02-26 21:17     ` Felix Fietkau

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=54EEF32D.2010202@amazon.de \
    --to=imrep@amazon.de \
    --cc=aliguori@amazon.com \
    --cc=bridge@lists.linux-foundation.org \
    --cc=davem@davemloft.net \
    --cc=fw@strlen.de \
    --cc=imrep.amz@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.