Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 23 Nov 2004 11:17:35 -0500
From:      John Baldwin <jhb@FreeBSD.org>
To:        freebsd-alpha@FreeBSD.org
Cc:        Robert Watson <rwatson@FreeBSD.org>
Subject:   Re: alpha and em mtu
Message-ID:  <200411231117.35467.jhb@FreeBSD.org>
In-Reply-To: <Pine.SOC.4.61.0411230406010.10997@tea.blinkenlights.nl>
References:  <Pine.SOC.4.61.0411142153430.26307@tea.blinkenlights.nl> <Pine.SOC.4.61.0411230259030.10997@tea.blinkenlights.nl> <Pine.SOC.4.61.0411230406010.10997@tea.blinkenlights.nl>

next in thread | previous in thread | raw e-mail | index | archive | help
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 <jhb@FreeBSD.org>  <><  http://www.FreeBSD.org/~jhb/
"Power Users Use the Power to Serve"  =  http://www.FreeBSD.org



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200411231117.35467.jhb>