From: Pablo Neira Ayuso <pablo@netfilter.org>
To: Alexei Starovoitov <ast@plumgrid.com>
Cc: Daniel Borkmann <daniel@iogearbox.net>,
netdev@vger.kernel.org, davem@davemloft.net, jhs@mojatatu.com
Subject: Re: [PATCH 2/2 net-next] net: move qdisc ingress filtering code where it belongs
Date: Mon, 11 May 2015 15:32:45 +0200 [thread overview]
Message-ID: <20150511133245.GA4430@salvia> (raw)
In-Reply-To: <555044D8.3080606@plumgrid.com>
[-- Attachment #1: Type: text/plain, Size: 2475 bytes --]
On Sun, May 10, 2015 at 10:57:44PM -0700, Alexei Starovoitov wrote:
> On 5/10/15 4:43 PM, Pablo Neira Ayuso wrote:
> >
> >The noop is patched to an unconditional branch to skip that code, but
> >the code is still there in that path, even if it's dormant.
> >
> >What the numbers show is rather simple: The more code is in the path,
> >the less performance you get, and the qdisc ingress specific code
> >embedded there is reducing performance for people that are not using
> >qdisc ingress, hence it should go where it belongs. The static key
> >cannot save you from that.
>
> hmm, did I miss these numbers ?
>
> My numbers are showing the opposite. There is no degradation whatsoever.
> To recap, here are the numbers from my box:
> no ingress - 37.6
> ingress on other dev - 36.5
> ingress on this dev - 28.8
> ingress on this dev + u32 - 24.1
>
> after Daniel's two patches:
> no ingress - 37.6
> ingress on other dev - 36.5
> ingress on this dev - 36.5
> ingress on this dev + u32 - 25.2
I'm refering to the numbers and the scenario that I describe in:
http://patchwork.ozlabs.org/patch/470512/
ie. no qdisc ingress before my patch vs. no qdisc ingress after my patch.
that shows that moving that code to sch_ingress results in a
performance improvements.
Some more numbers. I intentionally added more static key code that
depends on the ingress_needed key, see attached patch, the numbers
show a clear performance drop:
Result: OK: 5049126(c5049126+d0) usec, 100000000 (60byte,0frags)
19805404pps 9506Mb/sec (9506593920bps) errors: 100000000
Remember that the base (the results with my patch applied) is:
Result: OK: 4747078(c4747078+d0) usec, 100000000 (60byte,0frags)
21065587pps 10111Mb/sec (10111481760bps) errors: 100000000
That's 1M pps less because of more code that is under the static key.
So I'm measuring an impact on the use of static keys. Yes, I have
jump_label support as I told to Daniel, and I can reproduce this
numbers over and over again. Perf also show that I'm measuring the
right thing.
I'm running exactly the pktgen tests with netif_receive using the
script from the patch description, so it's basically the same test
here.
My old box is a Intel(R) Core(TM) i5-3320M CPU @ 2.60GHz
lscpu on debian shows:
L1d cache: 32K
L1i cache: 32K
L2 cache: 256K
L3 cache: 3072K
Please, carefully read my patch description. I think you can rebuild
your work on top of this patch. Thanks.
[-- Attachment #2: more-static-keys.patch --]
[-- Type: text/x-diff, Size: 1072 bytes --]
diff --git a/net/core/dev.c b/net/core/dev.c
index f5aeaf5..2a2047b1 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -3689,6 +3689,13 @@ ncls:
if (pfmemalloc && !skb_pfmemalloc_protocol(skb))
goto drop;
+ if (static_key_false(&ingress_needed)) {
+ int i = 0;
+
+ for (i = 0; i < 10; i++)
+ pr_info("this code depends on qdisc ingress\n");
+ }
+
if (skb_vlan_tag_present(skb)) {
if (pt_prev) {
ret = deliver_skb(skb, pt_prev, orig_dev);
@@ -3721,6 +3728,13 @@ ncls:
}
}
+ if (static_key_false(&ingress_needed)) {
+ int i = 0;
+
+ for (i = 0; i < 10; i++)
+ pr_info("this also depends on qdisc ingress\n");
+ }
+
if (unlikely(skb_vlan_tag_present(skb))) {
if (skb_vlan_tag_get_id(skb))
skb->pkt_type = PACKET_OTHERHOST;
@@ -3748,6 +3762,13 @@ ncls:
&skb->dev->ptype_specific);
}
+ if (static_key_false(&ingress_needed)) {
+ int i = 0;
+
+ for (i = 0; i < 10; i++)
+ pr_info("more code that depends on qdisc ingress\n");
+ }
+
if (pt_prev) {
if (unlikely(skb_orphan_frags(skb, GFP_ATOMIC)))
goto drop;
next prev parent reply other threads:[~2015-05-11 13:28 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-10 16:59 [PATCH 0/2 net-next] critical ingress path performance improvements Pablo Neira Ayuso
2015-05-10 16:59 ` [PATCH 1/2 net-next] net: kill useless net_*_ingress_queue() definitions when NET_CLS_ACT is unset Pablo Neira Ayuso
2015-05-10 16:58 ` Sergei Shtylyov
2015-05-10 16:59 ` [PATCH 2/2 net-next] net: move qdisc ingress filtering code where it belongs Pablo Neira Ayuso
2015-05-10 17:25 ` Eric Dumazet
2015-05-10 17:45 ` Alexei Starovoitov
2015-05-10 17:59 ` Pablo Neira Ayuso
2015-05-10 18:05 ` Alexei Starovoitov
2015-05-10 18:24 ` Pablo Neira Ayuso
2015-05-10 18:47 ` Alexei Starovoitov
2015-05-10 19:00 ` Pablo Neira Ayuso
2015-05-10 19:06 ` Alexei Starovoitov
2015-05-10 19:20 ` Pablo Neira Ayuso
2015-05-10 19:37 ` Alexei Starovoitov
2015-05-10 19:50 ` Pablo Neira Ayuso
2015-05-10 21:31 ` Daniel Borkmann
2015-05-10 21:44 ` Daniel Borkmann
2015-05-10 23:43 ` Pablo Neira Ayuso
2015-05-11 5:57 ` Alexei Starovoitov
2015-05-11 12:49 ` Jamal Hadi Salim
2015-05-11 12:58 ` Daniel Borkmann
2015-05-11 17:15 ` Alexei Starovoitov
2015-05-11 13:32 ` Pablo Neira Ayuso [this message]
2015-05-11 14:35 ` Eric Dumazet
2015-05-11 23:02 ` Alexei Starovoitov
2015-05-11 23:30 ` Eric Dumazet
2015-05-12 3:21 ` Alexei Starovoitov
2015-05-12 12:55 ` Pablo Neira Ayuso
2015-05-12 13:27 ` Daniel Borkmann
2015-05-12 21:22 ` Alexei Starovoitov
2015-05-12 21:43 ` Daniel Borkmann
2015-05-10 20:40 ` Daniel Borkmann
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=20150511133245.GA4430@salvia \
--to=pablo@netfilter.org \
--cc=ast@plumgrid.com \
--cc=daniel@iogearbox.net \
--cc=davem@davemloft.net \
--cc=jhs@mojatatu.com \
--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.