Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 17 Jul 2001 10:33:57 -0700 (PDT)
From:      Richard Hodges <rh@matriplex.com>
To:        Terry Lambert <tlambert2@mindspring.com>
Cc:        hackers@FreeBSD.ORG
Subject:   Re: NatSemi DP83820 gigE driver kit for 4.2 and 4.3
Message-ID:  <Pine.BSF.4.10.10107171021390.42094-100000@mail.matriplex.com>
In-Reply-To: <3B5463E1.BE28526C@mindspring.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, 17 Jul 2001, Terry Lambert wrote:

> Richard Hodges wrote:

> > Go ahead and beat me up if you have to :-)  But why is there _any_ issue
> > with RX buffer alignment?  I get some mbufs and set the data pointer to
> > any point I want, or I get a cluster, which is always on a 2k boundary.
> 
> Because of the ethernet header being 14 bytes instead of 16,

Yes, I see it now.  It is pretty obvious (now) that the ethernet
header and the payload cannot both be aligned.

> > Now TX buffers are a problem - I have to take what I get and just
> > "deal with it".  If both start address and length need to be aligned,
> > then I'm pretty much screwed - I have to copy...
> 
> No, exactly ythe opposite: the TX buffer is _not_ a problem.  This
> is because it's assembled from mbuf's, so you can actually put it
> on a 16 byte boundary, and index the mbuf into only the forst 14
> bytes of the packet for the header.

It is still a problem.  If the hardware requires buffer start and length
to be word aligned, I have to copy the entire mbuf chain if it is not
perfectly aligned to start with.  The very rare exception is if an mbuf
in the middle just happens to have a length off by exactly the alignment
offset - in that case I can stop there, so long as the rest of the chain
is aligned, of course.  This is a very real issue for me (in the form of
the IDT 77211 ATM SAR...)  To be fair, this may not be a great example,
since I don't have an ethernet header to worry about.

-Richard

-------------------------------------------
   Richard Hodges   | Matriplex, inc.
   Product Manager  | 769 Basque Way
  rh@matriplex.com  | Carson City, NV 89706
    775-886-6477    | www.matriplex.com 


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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.10.10107171021390.42094-100000>