svn commit: r257455 - head/sys/net

John-Mark Gurney jmg at funkthat.com
Thu Oct 31 20:49:18 UTC 2013


Luigi Rizzo wrote this message on Thu, Oct 31, 2013 at 21:05 +0100:
> On Thu, Oct 31, 2013 at 01:27:25PM -0600, Ian Lepore wrote:
> ...
> > Is there any chance all this reworking might get us to a position where
> > the protocol header in an mbuf doesn't have to be 32-bit aligned
> > anymore?  We pay a pretty heavy price for that requirement in the
> > drivers of the least capable hardware we support, the systems that have
> > the least horsepower to spare to make an extra copy of each packet to
> > realign it.
> 
> So are you suggesting to use some 'copy_unaligned_32()' function/macro to
> access 32-bit protocol fields in the network stack ?
> (16-bit entries should not be an issue)

my idea has been to make a change to the various ip/tcp/udp layers
that is dependant upon __NO_STRICT_ALIGNMENT and if we do require
strict alignment to copy the header to a stack buffer to align the
data...

Apparently someone started work on this and created IP_HDR_ALIGNED_P,
though it's apparently only used in if_bridge, and why it's necessary,
I'm not sure...

I know ARMv4 takes a serious performance hit because of this... Often
the machines that doesn't support unaligned accesses also have bad
DMA engines that can't do DMA to two byte boundaries forcing us to
copy the packet by using bounce pages...

I haven't audited AVILA to see if it has the issue, but I know that
the TS-7200 port I was working on has this issue...

-- 
  John-Mark Gurney				Voice: +1 415 225 5579

     "All that I will do, has been done, All that I have, has not."


More information about the svn-src-all mailing list