From owner-freebsd-hackers Mon Jul 16 16:54:40 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 2158137B407; Mon, 16 Jul 2001 16:54:35 -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 QAA40303; Mon, 16 Jul 2001 16:54:33 -0700 (PDT) (envelope-from rh@matriplex.com) Date: Mon, 16 Jul 2001 16:54:32 -0700 (PDT) From: Richard Hodges To: Bill Paul Cc: hackers@FreeBSD.ORG Subject: Re: NatSemi DP83820 gigE driver kit for 4.2 and 4.3 In-Reply-To: <20010716233436.7C0DB37B407@hub.freebsd.org> 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 Mon, 16 Jul 2001, Bill Paul wrote: > > On Mon, 16 Jul 2001, Bill Paul wrote: > > > > > They're "okay." The NatSemi chip has one flaw, which is that RX buffers > > > must be aligned on a 64-bit boundary. None of the more expensive NICs have > > > this restriction. > > > > 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. > > The OS wants the _payload_ to be aligned on a 32-bit boundary. It tries > to do 32-bit accesses to the IP header, and the NFS code also does 32-bit > accesses when trying to un-XDR NFS requests. Oh... I see... I guess you could grab an mbuf and copy just the IP header for that, no? (Just curious at this point :-) > But on other CPUs such as the alpha, SPARC, PPC and (I suspect) the > IA-64, unaligned accesses in the kernel generate a fatal trap and a > panic. In user space, an unaligned access may result in a bus error, > unless the OS is kind enough to handle the trap, which I believe > FreeBSD/alpha does. I don't think that is the case. I seem to remember FreeBSD Alpha 4.3 sysinstall croaking on me once with an alignment error. > Most chips place no restrictions on the alignment of TX buffers. The only > exceptions I know of where the chip API simply doesn't permit it are the > RealTek 8139/if_rl (surprise) and the VIA Rhine I and Rhine II/if_vr. And the IDT 77211 ATM SAR chip. Fortunately, most of the PDUs I see are perfectly aligned, and no copy is needed. Thanks for the explanation! -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