From owner-freebsd-hackers Tue Jul 17 10:34: 6 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from mail.matriplex.com (ns1.matriplex.com [208.131.42.8]) by hub.freebsd.org (Postfix) with ESMTP id B2EDE37B40B for ; Tue, 17 Jul 2001 10:33:59 -0700 (PDT) (envelope-from rh@matriplex.com) Received: from mail.matriplex.com (mail.matriplex.com [208.131.42.9]) by mail.matriplex.com (8.9.2/8.9.2) with ESMTP id KAA42306; Tue, 17 Jul 2001 10:33:57 -0700 (PDT) (envelope-from rh@matriplex.com) Date: Tue, 17 Jul 2001 10:33:57 -0700 (PDT) From: Richard Hodges To: Terry Lambert Cc: hackers@FreeBSD.ORG Subject: Re: NatSemi DP83820 gigE driver kit for 4.2 and 4.3 In-Reply-To: <3B5463E1.BE28526C@mindspring.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG 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