From owner-freebsd-hackers@FreeBSD.ORG Thu Sep 2 00:20:26 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D5D4C16A4CE for ; Thu, 2 Sep 2004 00:20:26 +0000 (GMT) Received: from c00l3r.networx.ch (c00l3r.networx.ch [62.48.2.2]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0A95543D39 for ; Thu, 2 Sep 2004 00:20:26 +0000 (GMT) (envelope-from andre@freebsd.org) Received: (qmail 99196 invoked from network); 2 Sep 2004 00:18:06 -0000 Received: from dotat.atdotat.at (HELO [62.48.0.47]) ([62.48.0.47]) (envelope-sender ) by c00l3r.networx.ch (qmail-ldap-1.03) with SMTP for ; 2 Sep 2004 00:18:06 -0000 Message-ID: <41366746.1080404@freebsd.org> Date: Thu, 02 Sep 2004 02:20:22 +0200 From: Andre Oppermann User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.8a1) Gecko/20040520 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Sam References: In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit cc: freebsd-hackers@freebsd.org Subject: Re: kernel panic, unknown / reserved trap X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Sep 2004 00:20:26 -0000 Sam wrote: > Hello, > > I'm working on a driver for AoE (ATA over Ethernet) > for the 4.x kernel (check recent freebsd-arch > postings for info). I have modified a few files in order to support > catching ethernet frames of type > 0x88a2. The make kernel completes successfully, > but on boot the kernel panics with an unknown/reserved > trap failure. I've modified the following: > > freebsd% for i in `find . -type f | tr \\\n ' '`; do > >> echo $i; diff $i ../sysorig/$i; done Please provice unified diffs. That makes them a lot easier to read. > ./net/ethernet.h > 310d309 > < #define ETHERTYPE_AOE 0x88A2 /* ATA over Ethernet */ > ./net/if_ethersubr.c > 43d42 > < #include "opt_aoe.h" > 103,106d101 > < #ifdef AOE > < struct ifqueue *aoeintrq; > < #endif /* AOE */ > < > 751,761d745 > < #ifdef AOE > < case ETHERTYPE_AOE: > < if(aoeintrq) { > < schednetisr(NETISR_AOE); > < inq = aoeintrq; > < break; > < } > < m_freem(m); ^^^^^^^^^^ This looks wrong. If you free the packet here you get a stale pointer in the netisr queue leading to interesting panics. ;-) If there is no aoeintrq then it will free'd at the end of the switch statement. > < return; > < #endif /* AOE */ > < > ./net/netisr.h > 59d58 > < #define NETISR_AOE 17 /* ATA over Ethernet */ > ./conf/options > 256,258d255 > < # AoE network option > < AOE opt_aoe.h > < > ./conf/files > 288,293d287 > < dev/aoe/aoe.c optional aoe > < dev/aoe/aoedev.c optional aoe > < dev/aoe/aoecmd.c optional aoe > < dev/aoe/aoenet.c optional aoe > < dev/aoe/aoeblk.c optional aoe > < dev/aoe/utils.c optional aoe > > I've also added dev/aoe/ with the files listed > above and modules/aoe/ with a makefile similar > to modules/md/Makefile. > > I don't really see how what I did is causing > the kernel to panic so early ... is anything > obvious? -- Andre