netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: florz@florz.de
Cc: mostrows@earthlink.net, netdev@vger.kernel.org
Subject: Re: [RESEND][PATCH 1/3] PPPoE: improved hashing routine
Date: Tue, 31 Jul 2007 01:26:09 -0700 (PDT)	[thread overview]
Message-ID: <20070731.012609.41193630.davem@davemloft.net> (raw)
In-Reply-To: <20070731080719.GA12071@florz.florz.dyndns.org>

From: Florian Zumbiehl <florz@florz.de>
Date: Tue, 31 Jul 2007 10:07:19 +0200

> Erm, I'd say this not only produces different results than the old
> version, but it also produces "wrong" results, in that it ignores quite
> a bit of the data that's supposed to be hashed. If I didn't overlook
> something, it only considers addr&0x0f0f0f0f0f00 and sid&0x0f0f, given
> the right endianness of addr and that PPPOE_HASH_SIZE stays 16.

You're right, I need to fix the shifts up.  How does this version
look?

	hash ^= (hash >> 4) ^ (hash >> 12) ^ (hash >> 20);
	return (head ^ (hash >> 8) ^ (hash >> 24)) &
		(PPPOE_HASH_SIZE - 1);

Actually it might be simpler and more efficient to just make
PPPOE_HASH_SHIFT be 8.

  reply	other threads:[~2007-07-31  8:26 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-29  6:04 [RESEND][PATCH 1/3] PPPoE: improved hashing routine Florian Zumbiehl
2007-07-31  0:47 ` David Miller
2007-07-31  8:07   ` Florian Zumbiehl
2007-07-31  8:26     ` David Miller [this message]
2007-07-31  9:01       ` Florian Zumbiehl
2007-07-31  9:16         ` David Miller
2007-07-31 11:05           ` Florian Zumbiehl
2007-07-31 20:51             ` 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=20070731.012609.41193630.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=florz@florz.de \
    --cc=mostrows@earthlink.net \
    --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 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).