From: Patrick McHardy <kaber@trash.net>
To: Jan Engelhardt <jengelh@medozas.de>
Cc: Netfilter Developer Mailing List <netfilter-devel@vger.kernel.org>
Subject: Re: [NETFILTER]: Move extensions' arguments into compound structure (1/2)
Date: Sun, 05 Oct 2008 16:30:08 +0200 [thread overview]
Message-ID: <48E8CF70.9090309@trash.net> (raw)
In-Reply-To: <alpine.LNX.1.10.0810031851430.13861@fbirervta.pbzchgretzou.qr>
Jan Engelhardt wrote:
> [NETFILTER]: Move extensions' arguments into compound structure (1/2)
>
> The function signatures for Xtables extensions have grown over time.
> It involves a lot of typing/replication, and also a bit of stack space
> even if they are not used. Realize an NFWS2008 idea and pack them into
> structs. The skb remains outside of the struct so gcc can continue to
> apply its optimizations.
>
> This patch does this for matches (only).
This looks good to me, it will reduce the maintenance overhead
considerably when doing changes in this area.
> @@ -223,9 +223,18 @@ do_match(struct ip6t_entry_match *m,
> unsigned int protoff,
> bool *hotdrop)
> {
> + struct xt_match_param par = {
> + .in = in,
> + .out = out,
> + .match = m->u.kernel.match,
> + .matchinfo = m->data,
> + .fragoff = offset,
> + .thoff = protoff,
> + .hotdrop = hotdrop,
> + };
Some of these members are constant during evaluation, so it would save
some overhead to initialize the structure on a higher level and only
fill in the match specific bits in do_match(). Alternatively you could
use two structures, one for the fixes bits related to the packet, one
for the match specific bits.
BTW, networking is using the same patch headline scheme as most of
the other subsystems nowadays, so please use "netfilter: " instead
of [NETFILTER]: in future patches. I also usually add the netfilter
internal subsystem, so this one would probably be
"netfilter: x_tables: move extensions' arguments ...".
next prev parent reply other threads:[~2008-10-05 14:30 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-10-03 22:52 [NETFILTER]: Move extensions' arguments into compound structure (1/2) Jan Engelhardt
2008-10-03 22:54 ` [NETFILTER]: Move extensions' arguments into compound structure (2/2) Jan Engelhardt
2008-10-04 13:48 ` [NETFILTER]: Move extensions' arguments into compound structure (1/2) Jan Engelhardt
2008-10-05 14:30 ` Patrick McHardy [this message]
2008-10-05 14:40 ` Jan Engelhardt
2008-10-05 14:52 ` Patrick McHardy
2008-10-05 14:55 ` Jan Engelhardt
2008-10-05 15:12 ` Patrick McHardy
2008-10-05 15:24 ` Jan Engelhardt
2008-10-05 15:31 ` Patrick McHardy
2008-10-05 16:19 ` Jan Engelhardt
2008-10-05 16:26 ` Patrick McHardy
2008-10-05 16:33 ` Jan Engelhardt
2008-10-05 16:36 ` Patrick McHardy
2008-10-05 20:14 ` Jan Engelhardt
2008-10-06 10:18 ` 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=48E8CF70.9090309@trash.net \
--to=kaber@trash.net \
--cc=jengelh@medozas.de \
--cc=netfilter-devel@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.