netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <acme@redhat.com>
To: "Ilpo Järvinen" <ilpo.jarvinen@helsinki.fi>
Cc: David Miller <davem@davemloft.net>,
	Netdev <netdev@vger.kernel.org>, Patrick Hardy <kaber@trash.net>,
	netfilter-devel@vger.kernel.org
Subject: Re: [PATCH net-next] ipv6: almost identical frag hashing funcs combined
Date: Tue, 30 Sep 2008 22:18:38 -0300	[thread overview]
Message-ID: <20081001011838.GB970@ghostprotocols.net> (raw)
In-Reply-To: <Pine.LNX.4.64.0810010146001.27688@wrl-59.cs.helsinki.fi>

Em Wed, Oct 01, 2008 at 01:57:47AM +0300, Ilpo Järvinen escreveu:
> 
> $ diff-funcs ip6qhashfn reassembly.c netfilter/nf_conntrack_reasm.c
>  --- reassembly.c:ip6qhashfn()
>  +++ netfilter/nf_conntrack_reasm.c:ip6qhashfn()
> @@ -1,5 +1,5 @@
> -static unsigned int ip6qhashfn(__be32 id, struct in6_addr *saddr,
> -			       struct in6_addr *daddr)
> +static unsigned int ip6qhashfn(__be32 id, const struct in6_addr *saddr,
> +			       const struct in6_addr *daddr)
>  {
>  	u32 a, b, c;
> 
> @@ -9,7 +9,7 @@
> 
>  	a += JHASH_GOLDEN_RATIO;
>  	b += JHASH_GOLDEN_RATIO;
> -	c += ip6_frags.rnd;
> +	c += nf_frags.rnd;
>  	__jhash_mix(a, b, c);
> 
>  	a += (__force u32)saddr->s6_addr32[3];
> 
> And codiff xx.o.old xx.o.new:
> 
> net/ipv6/netfilter/nf_conntrack_reasm.c:
>   ip6qhashfn         | -512
>   nf_hashfn          |   +6
>   nf_ct_frag6_gather |  +36
>  3 functions changed, 42 bytes added, 512 bytes removed, diff: -470
> net/ipv6/reassembly.c:
>   ip6qhashfn    | -512
>   ip6_hashfn    |   +7
>   ipv6_frag_rcv |  +89
>  3 functions changed, 96 bytes added, 512 bytes removed, diff: -416
> 
> net/ipv6/reassembly.c:
>   inet6_hash_frag | +510
>  1 function changed, 510 bytes added, diff: +510
> 
> Total: -376
> 
> Compile tested.
> 
> Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@helsinki.fi>

Good stuff, I wonder if you can spot possible candidades by sorting by
function size... Or perhaps by function signature... perhaps a new dwarf
that looks just at the parameter types, ordering by type name, and
reducing typedefs :-)

Acked-by: Arnaldo Carvalho de Melo <acme@redhat.com>

- Arnaldo

  reply	other threads:[~2008-10-01  1:20 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-30 22:57 [PATCH net-next] ipv6: almost identical frag hashing funcs combined Ilpo Järvinen
2008-10-01  1:18 ` Arnaldo Carvalho de Melo [this message]
2008-10-01  9:54   ` David Miller
2008-10-01 11:02     ` Ilpo Järvinen
2008-10-01 14:18       ` Brian Haley

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=20081001011838.GB970@ghostprotocols.net \
    --to=acme@redhat.com \
    --cc=davem@davemloft.net \
    --cc=ilpo.jarvinen@helsinki.fi \
    --cc=kaber@trash.net \
    --cc=netdev@vger.kernel.org \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).