Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 18 Mar 2005 01:24:29 -0800
From:      John-Mark Gurney <gurney_j@resnet.uoregon.edu>
To:        Mike Silbersack <silby@silby.com>
Cc:        freebsd-net@FreeBSD.org
Subject:   Re: changes to make ethernet packets able to be unaligned...
Message-ID:  <20050318092429.GD37984@funkthat.com>
In-Reply-To: <20050318024418.D844@odysseus.silby.com>
References:  <20050317221359.GN89312@funkthat.com> <20050318021907.H844@odysseus.silby.com> <20050318082810.GC37984@funkthat.com> <20050318024418.D844@odysseus.silby.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Mike Silbersack wrote this message on Fri, Mar 18, 2005 at 02:48 -0600:
> 
> On Fri, 18 Mar 2005, John-Mark Gurney wrote:
> 
> >>I'm confused - don't sparc64 and alpha have similar alignment
> >>requirements?  Why does arm require code changes?
> >
> >yes, the alignment constraints for arm are the same.. the reason I
> >said the above is only for arm is the epe driver (which is only on
> >an ARM core) has been made to use the new feature...
> >
> >The changes to ip_input.c will work with other drivers as well... it
> >just needs to make sure that the proper defines are in amd64 and i386
> >so that we don't do the fix up when we don't need to...
> >
> >-- 
> > John-Mark Gurney				Voice: +1 415 225 5579
> 
> Ok, I see what you're saying now, I had forgotten the #ifdef i386 sections 
> we have scattered throughout the network drivers.  When I read your 
> original commit, I was thinking about the transmit paths in drivers, which 
> is why m_copyup made no sense to me.
> 
> Moving the alignment out of the drivers and into a common place seems like 
> a good idea, but I wonder if it should be done in the ethernet code 
> instead of in the ip code; won't other protocols have unaligned access 
> problems if the change is made exactly as is?

Why force it on the protocols that might not need it?

We don't know how much of the ip or foo header to bring in at the
ethernet layer, so the ip or foo layer might have to bring in more data...

IMO, it's the protocol's job to ensure that it has correct alignment
to access the data...  what happens when a protocol comes along that
requires the packet to be 8byte aligned? and the ethernet layer only
aligned it on a 4byte boundary?  should we add a third mbuf to it?

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

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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20050318092429.GD37984>