netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stephen Hemminger <shemminger@linux-foundation.org>
To: David Miller <davem@davemloft.net>
Cc: dada1@cosmosbay.com, andi@firstfloor.org, rick.jones2@hp.com,
	netdev@vger.kernel.org
Subject: Re: bridge: faster compare for link local addresses
Date: Tue, 13 Mar 2007 13:06:54 -0700	[thread overview]
Message-ID: <20070313130654.7addde2b@freekitty> (raw)
In-Reply-To: <20070313.123954.21595557.davem@davemloft.net>

On Tue, 13 Mar 2007 12:39:54 -0700 (PDT)
David Miller <davem@davemloft.net> wrote:

> From: Eric Dumazet <dada1@cosmosbay.com>
> Date: Tue, 13 Mar 2007 14:38:32 +0100
> 
> > But memcmp() has a strong semantic (in libc). memcmp(a, b, 6) should
> > do 6 byte compares and conditional branches, regardless of a/b
> > alignment.  Or use the x86 "rep cmpsb" instruction that basically
> > has the same cost.
> 
> Yep, that's the issue, gcc won't make the reductions necessary
> here to get it down to one comparison and one branch.

Also, for our usage we only care about equality, not greater/less than
return value.

-- 
Stephen Hemminger <shemminger@linux-foundation.org>

      reply	other threads:[~2007-03-13 20:07 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-03-12 23:20 bridge: faster compare for link local addresses Stephen Hemminger
2007-03-12 23:26 ` David Miller
2007-03-13  0:05 ` Rick Jones
2007-03-13  0:10   ` David Miller
2007-03-13 14:01     ` Andi Kleen
2007-03-13 13:38       ` Eric Dumazet
2007-03-13 19:39         ` David Miller
2007-03-13 20:06           ` Stephen Hemminger [this message]

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=20070313130654.7addde2b@freekitty \
    --to=shemminger@linux-foundation.org \
    --cc=andi@firstfloor.org \
    --cc=dada1@cosmosbay.com \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    --cc=rick.jones2@hp.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).