Date: Mon, 16 Jul 2001 16:54:32 -0700 (PDT) From: Richard Hodges <rh@matriplex.com> To: Bill Paul <wpaul@FreeBSD.ORG> Cc: hackers@FreeBSD.ORG Subject: Re: NatSemi DP83820 gigE driver kit for 4.2 and 4.3 Message-ID: <Pine.BSF.4.10.10107161645130.38762-100000@mail.matriplex.com> In-Reply-To: <20010716233436.7C0DB37B407@hub.freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.10.10107161645130.38762-100000>