[Devel] Re: [BRIDGE] Unaligned access on IA64 when comparing ethernet addresses

Stephen Hemminger shemminger at linux-foundation.org
Thu Apr 19 11:18:57 PDT 2007


On Thu, 19 Apr 2007 16:14:23 +0200
Eric Dumazet <dada1 at cosmosbay.com> wrote:

> On Wed, 18 Apr 2007 13:04:22 -0700 (PDT)
> David Miller <davem at davemloft.net> wrote:
> 
> > 
> > Although I don't think gcc does anything fancy since we don't
> > use memcmp().  It's a tradeoff, we'd like to use unsigned long
> > comparisons when both objects are aligned correctly but we also
> > don't want it to use any more than one potentially mispredicted
> > branch.
> 
> Again, memcmp() *cannot* be optimized, because its semantic is to compare bytes.
> 
> memcpy() can take into account alignement if known at compile time, not memcmp()
> 
> http://lists.openwall.net/netdev/2007/03/13/31

It can if we order bytes in the bridge id properly.  See ktime_t for example.




More information about the Devel mailing list