From owner-freebsd-alpha@FreeBSD.ORG Tue Nov 23 19:19:59 2004 Return-Path: Delivered-To: freebsd-alpha@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 22C2416A4CE for ; Tue, 23 Nov 2004 19:19:59 +0000 (GMT) Received: from mail4.speakeasy.net (mail4.speakeasy.net [216.254.0.204]) by mx1.FreeBSD.org (Postfix) with ESMTP id CE7C043D1D for ; Tue, 23 Nov 2004 19:19:58 +0000 (GMT) (envelope-from jhb@FreeBSD.org) Received: (qmail 23797 invoked from network); 23 Nov 2004 19:19:58 -0000 Received: from dsl027-160-063.atl1.dsl.speakeasy.net (HELO server.baldwin.cx) ([216.27.160.63]) (envelope-sender ) encrypted SMTP for ; 23 Nov 2004 19:19:57 -0000 Received: from [10.50.41.235] (gw1.twc.weather.com [216.133.140.1]) (authenticated bits=0) by server.baldwin.cx (8.12.11/8.12.11) with ESMTP id iANJJnrR036800; Tue, 23 Nov 2004 14:19:54 -0500 (EST) (envelope-from jhb@FreeBSD.org) From: John Baldwin To: freebsd-alpha@FreeBSD.org Date: Tue, 23 Nov 2004 11:17:35 -0500 User-Agent: KMail/1.6.2 References: In-Reply-To: MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <200411231117.35467.jhb@FreeBSD.org> X-Spam-Checker-Version: SpamAssassin 2.63 (2004-01-11) on server.baldwin.cx cc: Robert Watson Subject: Re: alpha and em mtu X-BeenThere: freebsd-alpha@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Porting FreeBSD to the Alpha List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Nov 2004 19:19:59 -0000 On Monday 22 November 2004 10:09 pm, Sten Spans wrote: > On Tue, 23 Nov 2004, Sten Spans wrote: > >> doesn't seem to print anything, but ... > >> > >> if_em.c > >> 2442 > >> 2443 /*if (ifp->if_mtu <= ETHERMTU) { */ > >> 2444 m_adj(mp, ETHER_ALIGN); > >> 2445 /*} */ > >> 2446 > >> > >> does seem to fix the crash, also trashes the performance, > >> but that's another matter. It looks like mbuf alignment is > >> needed, if_bge seems to provide reasonable examples. > > > > And looking at netbsd/openbsd clarifies the whole issue, > > > > #ifdef __STRICT_ALIGNMENT > > /* > > * The ethernet payload is not 32-bit aligned when > > * Jumbo packets are enabled, so on architectures > > with > > * strict alignment we need to shift the entire > > packet > > * ETHER_ALIGN bytes. Ugh. > > */ > > > > > > This diff probably should be merged. > > http://www.openbsd.org/cgi-bin/cvsweb/src/sys/dev/pci/if_em.c.diff?r1=1.2 > >2&r2=1.23 > > > > Although I don't know wether freebsd has the STRICT_ALIGNMENT define. > > This is an initial patch based on the openbsd code, > which solves the if_em issue, and seems to give ok performance > ( note to self: turn off debugging when testing network performance ). > > Comments welcome. We do need some kind of __STRICT_ALIGNMENT macro I think if we don't already have one as archs other than i386 might not need the alignment. At the least there could be a block near the top of if_em.h that was: #if defined(__alpha__) #define STRICT_ALIGNMENT #endif and other architectures could be fixed by simply adding another 'defined(__foo__)' clause without having to change the ifdef and comments down in the code itself. As to the correctness of the em(4) change, hopefully Robert can speak to that. -- John Baldwin <>< http://www.FreeBSD.org/~jhb/ "Power Users Use the Power to Serve" = http://www.FreeBSD.org