From: Patrick McHardy <kaber@trash.net>
To: Herbert Xu <herbert@gondor.apana.org.au>
Cc: David Miller <davem@davemloft.net>,
hadi@cyberus.ca, netdev@vger.kernel.org, kuznet@ms2.inr.ac.ru
Subject: [IPV4]: Uninline netfilter okfns
Date: Mon, 15 Oct 2007 09:57:24 +0200 [thread overview]
Message-ID: <47131D64.3080008@trash.net> (raw)
In-Reply-To: <20071014042604.GA11431@gondor.apana.org.au>
[-- Attachment #1: Type: text/plain, Size: 280 bytes --]
Your patches work fine so far, tested with fragments, packet
content mangling etc. Thanks again for doing this. And they
really do enable gcc to generate tail-calls for the NF_HOOK
okfns, so this patch changes net/ipv4 to take advantage of
this. IPv6 and bridge will follow ...
[-- Attachment #2: x --]
[-- Type: text/plain, Size: 2795 bytes --]
[IPV4]: Uninline netfilter okfns
Now that we don't pass double skb pointers to nf_hook_slow anymore, gcc
can generate tail calls for some of the netfilter hook okfn invocations,
so there is no need to inline the functions anymore. This caused huge
code bloat since we ended up with one inlined version and one out-of-line
version since we pass the address to nf_hook_slow.
Before:
text data bss dec hex filename
8997385 1016524 524652 10538561 a0ce41 vmlinux
After:
text data bss dec hex filename
8994009 1016524 524652 10535185 a0c111 vmlinux
-------------------------------------------------------
-3376
All cases have been verified to generate tail-calls with and without
netfilter. The okfns in ipmr and xfrm4_input still remain inline because
gcc can't generate tail-calls for them.
Signed-off-by: Patrick McHardy <kaber@trash.net>
---
commit 39533dafc9b0458fecebd2da36d682837c6ff9a2
tree af5f872142f9a0703c167843a1f51642f89c5662
parent 3e7e83795236b54106ef3ac57f140d97300aa5f5
author Patrick McHardy <kaber@trash.net> Mon, 15 Oct 2007 09:56:24 +0200
committer Patrick McHardy <kaber@trash.net> Mon, 15 Oct 2007 09:56:24 +0200
net/ipv4/ip_forward.c | 2 +-
net/ipv4/ip_input.c | 4 ++--
net/ipv4/ip_output.c | 2 +-
3 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/net/ipv4/ip_forward.c b/net/ipv4/ip_forward.c
index afbf938..877da3e 100644
--- a/net/ipv4/ip_forward.c
+++ b/net/ipv4/ip_forward.c
@@ -40,7 +40,7 @@
#include <net/route.h>
#include <net/xfrm.h>
-static inline int ip_forward_finish(struct sk_buff *skb)
+static int ip_forward_finish(struct sk_buff *skb)
{
struct ip_options * opt = &(IPCB(skb)->opt);
diff --git a/net/ipv4/ip_input.c b/net/ipv4/ip_input.c
index 8f75e43..168c871 100644
--- a/net/ipv4/ip_input.c
+++ b/net/ipv4/ip_input.c
@@ -195,7 +195,7 @@ int ip_call_ra_chain(struct sk_buff *skb)
return 0;
}
-static inline int ip_local_deliver_finish(struct sk_buff *skb)
+static int ip_local_deliver_finish(struct sk_buff *skb)
{
__skb_pull(skb, ip_hdrlen(skb));
@@ -324,7 +324,7 @@ drop:
return -1;
}
-static inline int ip_rcv_finish(struct sk_buff *skb)
+static int ip_rcv_finish(struct sk_buff *skb)
{
const struct iphdr *iph = ip_hdr(skb);
struct rtable *rt;
diff --git a/net/ipv4/ip_output.c b/net/ipv4/ip_output.c
index 699f067..f508835 100644
--- a/net/ipv4/ip_output.c
+++ b/net/ipv4/ip_output.c
@@ -202,7 +202,7 @@ static inline int ip_skb_dst_mtu(struct sk_buff *skb)
skb->dst->dev->mtu : dst_mtu(skb->dst);
}
-static inline int ip_finish_output(struct sk_buff *skb)
+static int ip_finish_output(struct sk_buff *skb)
{
#if defined(CONFIG_NETFILTER) && defined(CONFIG_XFRM)
/* Policy lookup after SNAT yielded a new policy */
next prev parent reply other threads:[~2007-10-15 7:57 UTC|newest]
Thread overview: 80+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-09-27 7:34 [PKT_SCHED]: Add stateless NAT Herbert Xu
2007-09-27 9:25 ` Evgeniy Polyakov
2007-09-27 9:33 ` Herbert Xu
2007-09-27 10:07 ` Evgeniy Polyakov
2007-09-27 10:29 ` Herbert Xu
2007-09-27 12:41 ` Evgeniy Polyakov
2007-09-27 12:45 ` Herbert Xu
2007-09-27 13:10 ` Evgeniy Polyakov
2007-09-27 13:16 ` Patrick McHardy
2007-09-27 13:25 ` Evgeniy Polyakov
2007-09-27 13:30 ` Patrick McHardy
2007-09-27 13:33 ` Evgeniy Polyakov
2007-09-27 13:34 ` jamal
2007-09-27 13:20 ` Herbert Xu
2007-09-27 13:29 ` Evgeniy Polyakov
2007-09-27 13:39 ` Patrick McHardy
2007-09-27 19:52 ` David Miller
2007-09-28 8:19 ` Evgeniy Polyakov
2007-09-28 9:16 ` Evgeniy Polyakov
2007-09-28 16:31 ` Patrick McHardy
2007-09-27 12:52 ` jamal
2007-09-27 13:06 ` Evgeniy Polyakov
2007-09-27 12:27 ` Herbert Xu
2007-09-27 12:46 ` jamal
2007-09-27 12:39 ` jamal
2007-09-27 12:58 ` Herbert Xu
2007-09-27 19:48 ` David Miller
2007-09-27 13:01 ` Herbert Xu
2007-09-27 13:16 ` jamal
2007-09-27 19:08 ` David Miller
2007-09-28 16:55 ` Patrick McHardy
2007-09-29 0:51 ` Herbert Xu
2007-09-29 3:37 ` Herbert Xu
2007-09-29 15:21 ` Patrick McHardy
2007-09-29 23:36 ` Herbert Xu
2007-09-30 0:13 ` David Miller
2007-09-30 0:26 ` Herbert Xu
2007-09-30 0:43 ` Herbert Xu
2007-09-30 15:38 ` Patrick McHardy
2007-10-14 4:26 ` [0/10] Remove sk_buff ** from netfilter API Herbert Xu
2007-10-14 4:27 ` [PATCH 1/10] [SKBUFF]: Merge common code between copy_skb_header and skb_clone Herbert Xu
2007-10-14 10:36 ` jamal
2007-10-14 4:27 ` [PATCH 2/10] [SKBUFF]: Add skb_morph Herbert Xu
2007-11-26 6:50 ` Yasuyuki KOZAKAI
[not found] ` <200711260650.lAQ6oOL9006774@toshiba.co.jp>
2007-11-26 15:10 ` Herbert Xu
2007-11-27 6:50 ` Yasuyuki KOZAKAI
2007-10-14 4:27 ` [PATCH 3/10] [IPV4]: Make ip_defrag return the same packet Herbert Xu
2007-10-14 4:27 ` [PATCH 4/10] [IPV4]: Change ip_defrag to return an integer Herbert Xu
2007-10-14 4:27 ` [PATCH 5/10] [NET]: Avoid unnecessary cloning for ingress filtering Herbert Xu
2007-10-14 10:49 ` jamal
2007-10-15 13:57 ` jamal
2007-10-15 14:28 ` Patrick McHardy
2007-10-15 14:55 ` Alexey Kuznetsov
2007-10-16 10:28 ` jamal
2007-10-14 4:27 ` [PATCH 6/10] [BRIDGE]: Unshare skb upon entry Herbert Xu
2007-10-15 7:20 ` Patrick McHardy
2007-10-15 8:04 ` Herbert Xu
2007-10-15 8:50 ` David Miller
2007-10-14 4:27 ` [PATCH 7/10] [NETFILTER]: Do not copy skb in skb_make_writable Herbert Xu
2007-10-14 4:27 ` [PATCH 8/10] [IPVS]: Replace local version of skb_make_writable Herbert Xu
2007-10-14 4:27 ` [PATCH 9/10] [NETFILTER]: Avoid skb_copy/pskb_copy/skb_realloc_headroom Herbert Xu
2007-10-14 4:27 ` [PATCH 10/10] [NETFILTER]: Replace sk_buff ** with sk_buff * Herbert Xu
2007-10-14 9:55 ` Herbert Xu
2007-10-14 14:46 ` [0/3] [IPV6]: Kill sk_buff ** usage on input path Herbert Xu
2007-10-14 14:49 ` [PATCH 1/3] [IPV6]: Make ipv6_frag_rcv return the same packet Herbert Xu
2007-10-15 8:28 ` David Miller
2007-10-14 14:49 ` [PATCH 2/3] [IPV6]: Avoid skb_copy/pskb_copy/skb_realloc_headroom on input Herbert Xu
2007-10-15 8:29 ` David Miller
2007-10-14 14:49 ` [PATCH 3/3] [IPV6]: Replace sk_buff ** with sk_buff * in input handlers Herbert Xu
2007-10-14 15:43 ` YOSHIFUJI Hideaki / 吉藤英明
2007-10-15 8:30 ` David Miller
2007-10-15 8:29 ` David Miller
2007-10-15 14:21 ` Herbert Xu
2007-10-15 8:27 ` [PATCH 10/10] [NETFILTER]: Replace sk_buff ** with sk_buff * David Miller
2007-10-15 6:25 ` [0/10] Remove sk_buff ** from netfilter API Patrick McHardy
2007-10-15 7:57 ` Patrick McHardy [this message]
2007-10-15 8:05 ` [IPV4]: Uninline netfilter okfns Herbert Xu
2007-10-15 8:30 ` [IPV6]: " Patrick McHardy
2007-10-15 8:51 ` David Miller
2007-10-15 8:49 ` [IPV4]: " David Miller
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=47131D64.3080008@trash.net \
--to=kaber@trash.net \
--cc=davem@davemloft.net \
--cc=hadi@cyberus.ca \
--cc=herbert@gondor.apana.org.au \
--cc=kuznet@ms2.inr.ac.ru \
--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.