netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: shemminger@vyatta.com
Cc: roland@purestorage.com, johnwheffner@gmail.com, mj@ucw.cz,
	netdev@vger.kernel.org
Subject: Re: ipv4: Simplify ARP hash function.
Date: Fri, 08 Jul 2011 16:47:51 -0700 (PDT)	[thread overview]
Message-ID: <20110708.164751.1543109601226116469.davem@davemloft.net> (raw)
In-Reply-To: <20110708164128.50155c9c@nehalam.ftrdhcpuser.net>

From: Stephen Hemminger <shemminger@vyatta.com>
Date: Fri, 8 Jul 2011 16:41:28 -0700

> What about using murmur hash which has a four byte pass as well.
>   https://sites.google.com/site/murmurhash/

I'm trying to avoid multiplies that are not done in hardware on some
cpus.

Right now I'm looking at one of Thomas Wang's hashes, referenced on
Bob Jenkin's hash analysis page:

u32 hashint(u32 a)
{
	a += ~(a<<15);
	a ^=  (a>>10);
	a +=  (a<<3);
	a ^=  (a>>6);
	a += ~(a<<11);
	a ^=  (a>>16);

	return a;
}

It's 15 instructions, and produces better entropy in the low bits of
the result than the high bits, which is fine for how we'll use this
thing.

  reply	other threads:[~2011-07-08 23:48 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-08 17:10 ipv4: Simplify ARP hash function David Miller
2011-07-08 17:40 ` Martin Mares
2011-07-08 17:47   ` David Miller
2011-07-08 17:54     ` David Miller
2011-07-08 18:03     ` John Heffner
2011-07-08 18:06       ` David Miller
2011-07-08 19:26         ` Roland Dreier
2011-07-08 19:27           ` David Miller
2011-07-08 19:39             ` Michał Mirosław
2011-07-08 19:51               ` David Miller
2011-07-08 19:59                 ` David Miller
2011-07-08 20:10                   ` Michał Mirosław
2011-07-08 20:34                     ` Michał Mirosław
2011-07-08 20:35                       ` David Miller
2011-07-08 20:44             ` Roland Dreier
2011-07-08 22:32               ` David Miller
2011-07-08 23:11                 ` Roland Dreier
2011-07-10 19:07                   ` David Miller
2011-07-08 23:41                 ` Stephen Hemminger
2011-07-08 23:47                   ` David Miller [this message]
2011-07-09  3:08                     ` Stephen Hemminger

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=20110708.164751.1543109601226116469.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=johnwheffner@gmail.com \
    --cc=mj@ucw.cz \
    --cc=netdev@vger.kernel.org \
    --cc=roland@purestorage.com \
    --cc=shemminger@vyatta.com \
    /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).