Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 19 Jun 2001 23:26:24 -0400
From:      Bosko Milekic <bmilekic@technokratis.com>
To:        Terry Lambert <tlambert@primenet.com>
Cc:        freebsd-alpha@FreeBSD.ORG
Subject:   Re: vx, lge, nge, dc, rl, sf, sis, sk, vr, wb users please TEST
Message-ID:  <20010619232624.A29829@technokratis.com>
In-Reply-To: <200106200224.TAA24251@usr05.primenet.com>; from tlambert@primenet.com on Wed, Jun 20, 2001 at 02:24:02AM %2B0000
References:  <20010619191602.A28591@technokratis.com> <200106200224.TAA24251@usr05.primenet.com>

next in thread | previous in thread | raw e-mail | index | archive | help

On Wed, Jun 20, 2001 at 02:24:02AM +0000, Terry Lambert wrote:
> > 	http://people.freebsd.org/~bmilekic/code/mdevget.patch
>
> Please run this past Bill Paul.

	I already did this. :-)
 
> The reason for the pre-adjustment of the m_devget is to ensure
> that the structure in the IP header is aligned, given the fact
> that there is a 14 byte ethernet header in front of it.

	I know. The problem is that the way the alignment issue is presently
handeled is wrong. See, to trick m_devget() into writing the start of the
data offset two bytes into the target mbuf chain's first mbuf's data region
(to make the alignment OK), what was done was to pass for the `source buffer
address' argument to m_devget(), the actual address of the source buffer MINUS
ETHER_ALIGN (2 bytes). This had the effect of copying the end of the previous
cluster or the end of the mbuf header (depending on where the source buffer is
stored) to the first two bytes of the target mbuf. Admittedly, this is a cute
trick, but it's wrong. What can happen (and will likely happen w/ mb_alloc b/c
mb_alloc keeps separate maps for clusters and mbufs, to make address space
limitations easier to maintain) is that the "previous cluster" sits on
another page which just so happens to not be allocated yet, which will
generate a page fault during the bcopy() in m_devget().

> An alignment of 16 should work on the Alpha and IA64, without
> needing modification.

	As Jonathan Lemon kindly explained to me, the 2 byte alignment at
the start of the data region makes things ok as the ethernet header is 14 bytes
so the data following it will be properly aligned. This makes the Alpha happy
and the x86 faster.

> The m_devget basically copies the data to force it to be aligned
> (ugly, but necessary on brain damaged hardware).

	Again, I know. What the change does, if you just glance over at it,
is change the `offset from source buffer' argument of m_devget() which came
with the initial import of m_devget() [and which is coincidentally not used
ANYWHERE in our code, and is thus useless] to now mean `offset into the data
region of the first mbuf of the target mbuf chain before copying the source
buffer data.' I hope this clarifies things.

> Are these changes really necessary for the Alpha to work?

	Absolutely. To test whether or not they are correct, it would be nice
if the people with the hardware gave it a whirl. By the way, the patch is for
-CURRENT but once it is committed, I'll mark it "MFC in 2 weeks," as this
applies to -STABLE as well (even though -STABLE is not seeing mb_alloc, the
trickery used to fool m_devget() is still technically wrong).
 
> 					Terry Lambert
> 					terry@lambert.org
> ---
> Any opinions in this posting are my own and not those of my present
> or previous employers.

	K?

Cheerio,
-- 
 Bosko Milekic
 bmilekic@technokratis.com


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-alpha" in the body of the message




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