From owner-freebsd-alpha@FreeBSD.ORG Mon Nov 15 20:21:10 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 68D7D16A4CE for ; Mon, 15 Nov 2004 20:21:10 +0000 (GMT) Received: from mail1.speakeasy.net (mail1.speakeasy.net [216.254.0.201]) by mx1.FreeBSD.org (Postfix) with ESMTP id 327E243D1F for ; Mon, 15 Nov 2004 20:21:10 +0000 (GMT) (envelope-from jhb@FreeBSD.org) Received: (qmail 17221 invoked from network); 15 Nov 2004 20:21:08 -0000 Received: from dsl027-160-063.atl1.dsl.speakeasy.net (HELO server.baldwin.cx) ([216.27.160.63]) (envelope-sender ) encrypted SMTP for ; 15 Nov 2004 20:21:07 -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 iAFKL4ML076280; Mon, 15 Nov 2004 15:21:05 -0500 (EST) (envelope-from jhb@FreeBSD.org) From: John Baldwin To: Sten Spans Date: Mon, 15 Nov 2004 15:10:07 -0500 User-Agent: KMail/1.6.2 References: <200411151111.11950.jhb@FreeBSD.org> In-Reply-To: MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <200411151510.07790.jhb@FreeBSD.org> X-Spam-Checker-Version: SpamAssassin 2.63 (2004-01-11) on server.baldwin.cx cc: Robert Watson cc: freebsd-alpha@FreeBSD.org 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: Mon, 15 Nov 2004 20:21:10 -0000 On Monday 15 November 2004 02:34 pm, Sten Spans wrote: > On Mon, 15 Nov 2004, John Baldwin wrote: > > On Sunday 14 November 2004 04:26 pm, Sten Spans wrote: > >> I upgraded my ds10 with an intel gigabit card, > >> and encountered the following issue (RELENG_5): > >> > >> deepthought# ifconfig em0 mtu 1501 > >> deepthought# > >> fatal kernel trap: > >> > >> trap entry = 0x4 (unaligned access fault) > >> faulting va = 0xfffffc001847a02e > >> opcode = 0x28 > >> register = 0x1 > >> pc = 0xfffffc00004cd0f8 > >> ra = 0xfffffc00004cce24 > >> sp = 0xfffffe00187a9af0 > >> curthread = 0xfffffc001f3a70e0 > >> pid = 14, comm = swi1: net > >> > >> [thread 100006] > >> Stopped at tcp_input+0x368: srl t0,#0x2,t0 > >> db> trace > >> tcp_input() at tcp_input+0x368 > > > > Can you do 'gdb kernel.debug' in your kernel build directory and then do > > 'l *tcp_input+0x368' to determine which source line it is panic'ing at? > > This might help us figure out what the unaligned access is so it can be > > fixed. If you don't have a debug kernel, please build one and reproduce > > the panic to get the updated 'tcp_input+0xblah' line and then do the gdb > > command with the updated 'tcp_input+0xblah' bit. Thanks. > > Sure, I anticipated this, but couldn't quite > recall how to do the gdb magics :). > > (gdb) l *tcp_input+0x368 > 0xfffffc00004cd0f8 is in tcp_input (/usr/src/sys/netinet/tcp_input.c:552). > 547 > 548 /* > 549 * Check that TCP offset makes sense, > 550 * pull out TCP options and adjust length. XXX > 551 */ > 552 off = th->th_off << 2; > 553 if (off < sizeof (struct tcphdr) || off > tlen) { > 554 tcpstat.tcps_rcvbadoff++; > 555 goto drop; > 556 } > > > The box that talks to the alpha has mtu 9014, this might > help to expose the bug. It may be that the off0 argument is less than the size of an IP header but is not a multiple of 4. Can you try this to see if it prints anything out before crashing: Index: netinet/tcp_input.c =================================================================== RCS file: /usr/cvs/src/sys/netinet/tcp_input.c,v retrieving revision 1.255 diff -u -r1.255 tcp_input.c --- netinet/tcp_input.c 7 Nov 2004 19:19:35 -0000 1.255 +++ netinet/tcp_input.c 15 Nov 2004 20:09:27 -0000 @@ -497,6 +497,8 @@ ip_stripoptions(m, (struct mbuf *)0); off0 = sizeof(struct ip); } + if (off0 & 0x3 != 0) + printf("%s: off0 %d is misaligned\n", __func__, off0); if (m->m_len < sizeof (struct tcpiphdr)) { if ((m = m_pullup(m, sizeof (struct tcpiphdr))) == 0) { tcpstat.tcps_rcvshort++; -- John Baldwin <>< http://www.FreeBSD.org/~jhb/ "Power Users Use the Power to Serve" = http://www.FreeBSD.org