From: Patrick McHardy <kaber@trash.net>
To: Jesper Dangaard Brouer <netdev@brouer.com>
Cc: Daniel Borkmann <daniel@iogearbox.net>,
Pablo Neira Ayuso <pablo@netfilter.org>,
netfilter-devel@vger.kernel.org, netdev@vger.kernel.org,
davem@davemloft.net
Subject: Re: [PATCH 1/7] net: refactor __netif_receive_skb_core
Date: Thu, 16 Apr 2015 06:49:05 +0100 [thread overview]
Message-ID: <20150416054904.GC3285@acer.localdomain> (raw)
In-Reply-To: <20150415180927.4592eb6e@brouer.com>
On 15.04, Jesper Dangaard Brouer wrote:
> > Out of curiosity, what is actually the performance impact on all
> > of this? We were just arguing on a different matter on two more
> > instructions in the fast-path, here it's refactoring the whole
> > function into several ones, I presume gcc won't inline it.
>
> Pablo asked me to performance test this change. Full test report below.
>
> The performance effect (of this patch) depend on the Gcc compiler
> version.
>
> Two tests:
> 1. IP-forwarding (unloaded netfilter modules)
> 2. Early drop in iptables "raw" table
>
> With GCC 4.4.7, which does not inline the new functions
> (__netif_receive_skb_ingress and __netif_receive_skb_finish) the
> performance impact/regression is definitly measurable.
>
> With GCC 4.4.7:
> 1. IP-forwarding: +25.18 ns (slower) (-27776 pps)
> 2. Early-drop : +7.55 ns (slower) (-66577 pps)
>
> With GCC 4.9.1, the new functions gets inlined, thus the refactor
> splitup of __netif_receive_skb_core() is basically "cancled".
> Strangly there is a small improvement for forwarding, likely due to
> some lucky assember reordering that give less icache/fetch-misses.
> The early-drop improvement is below accuracy levels, can cannot be
> trusted.
>
> With GCC 4.9.1:
> 1. IP-forwarding: -10.05ns (faster) (+17532 pps)
> 2. Early-drop : -1.54ns (faster) (+16216 pps) below accuracy levels
>
> I don't know what to conclude, as the result depend on the compiler
> version... but these kind of change do affect performance, and should
> be tested/measured.
Thanks Jesper. This effect without inlinging was to be expected I guess.
The interesting question would be a patch that uses nf_hook() without okfn
callback, moves the ingress qdisc to register with the netfilter ingress
hook and moves the TTL tracking of ing_filter() to the ingress qdisc,
where it belongs.
My expectation would be that this would result in an overall performance
gain.
next prev parent reply other threads:[~2015-04-16 5:49 UTC|newest]
Thread overview: 39+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-04-10 12:15 [PATCH 0/7 RFC] Netfilter/nf_tables ingress support Pablo Neira Ayuso
2015-04-10 12:15 ` [PATCH 1/7] net: refactor __netif_receive_skb_core Pablo Neira Ayuso
2015-04-10 13:47 ` Daniel Borkmann
2015-04-15 16:09 ` Jesper Dangaard Brouer
2015-04-16 5:49 ` Patrick McHardy [this message]
2015-04-10 19:56 ` Alexander Duyck
2015-04-15 12:44 ` David Laight
2015-04-15 13:28 ` Alexander Duyck
2015-04-10 12:15 ` [PATCH 2/7] netfilter: add nf_hook_list_active() Pablo Neira Ayuso
2015-04-10 12:15 ` [PATCH 3/7] netfilter: add hook list to nf_hook_state Pablo Neira Ayuso
2015-04-10 12:15 ` [PATCH 4/7] netfilter: cleanup struct nf_hook_ops struct indentation Pablo Neira Ayuso
2015-04-10 13:27 ` Sergei Shtylyov
2015-04-10 12:15 ` [PATCH 5/7] net: add netfilter ingress hook Pablo Neira Ayuso
2015-04-10 13:21 ` Thomas Graf
2015-04-10 13:36 ` Patrick McHardy
2015-04-10 20:17 ` Pablo Neira Ayuso
2015-04-10 21:33 ` Patrick McHardy
2015-04-11 12:55 ` Pablo Neira Ayuso
2015-04-11 13:06 ` Patrick McHardy
2015-04-11 13:32 ` Pablo Neira Ayuso
2015-04-10 20:08 ` Pablo Neira Ayuso
2015-04-10 12:15 ` [PATCH 6/7] netfilter: nf_tables: allow to bind table to net_device Pablo Neira Ayuso
2015-04-10 12:15 ` [PATCH 7/7] netfilter: nf_tables: add netdev table to filter from ingress Pablo Neira Ayuso
2015-04-10 13:22 ` [PATCH 0/7 RFC] Netfilter/nf_tables ingress support Thomas Graf
2015-04-10 20:09 ` Pablo Neira Ayuso
2015-04-13 1:14 ` David Miller
2015-04-13 20:19 ` Patrick McHardy
2015-04-14 9:00 ` Thomas Graf
2015-04-14 9:06 ` Patrick McHardy
2015-04-14 10:08 ` Thomas Graf
2015-04-14 10:13 ` Patrick McHardy
2015-04-14 10:32 ` Thomas Graf
2015-04-14 20:05 ` Jesper Dangaard Brouer
2015-04-14 12:27 ` Jamal Hadi Salim
2015-04-14 15:12 ` John Fastabend
2015-04-14 15:36 ` Alexei Starovoitov
2015-04-15 7:35 ` John Fastabend
2015-04-15 9:19 ` Daniel Borkmann
2015-04-15 16:24 ` Alexei Starovoitov
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=20150416054904.GC3285@acer.localdomain \
--to=kaber@trash.net \
--cc=daniel@iogearbox.net \
--cc=davem@davemloft.net \
--cc=netdev@brouer.com \
--cc=netdev@vger.kernel.org \
--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