Subject: Re: alignment crash in v6 ipfilter when receiving on gif
To: Martin Husemann <martin@duskware.de>
From: David Laight <david@l8s.co.uk>
List: port-sparc64
Date: 07/11/2007 00:14:20
On Tue, Jul 10, 2007 at 09:01:27PM +0200, Martin Husemann wrote:
> On Tue, Jul 10, 2007 at 02:53:03PM -0400, Chris Ross wrote:
> >   I'm curious if this is actually the best fix, or if Darren's  
> > suggestion(1) of
> > using a bcmp instead of using the IP6_NEQ() macro might be a better
> > fix?  I guess it's a function-call either way, so it may not matter...
> 
> Actually if that works it is better - and gcc might even inline it.

Hmmm, you probably don't want the compiler to inline bcmp() as
'rep cmpsb' - unless the buffers are the same for a considerable
number of bytes, the C loop is likely to be faster.

As an excercise try to get the C compiler from a well known O/S supplier
to generate a byte copy loop, rather than converting it to a
'rep movls', 'rep movsb' pair (the 2nd of which is particularly expensive).

	David

-- 
David Laight: david@l8s.co.uk