From owner-freebsd-current@FreeBSD.ORG Fri Nov 7 19:48:51 2008 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4C36F1065676 for ; Fri, 7 Nov 2008 19:48:51 +0000 (UTC) (envelope-from shuvaev@physik.uni-wuerzburg.de) Received: from mailrelay.rz.uni-wuerzburg.de (mailrelay.rz.uni-wuerzburg.de [132.187.3.28]) by mx1.freebsd.org (Postfix) with ESMTP id C97118FC0A for ; Fri, 7 Nov 2008 19:48:50 +0000 (UTC) (envelope-from shuvaev@physik.uni-wuerzburg.de) Received: from virusscan.mail (localhost [127.0.0.1]) by mailrelay.mail (Postfix) with ESMTP id D6754198EF9; Fri, 7 Nov 2008 20:48:49 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by virusscan.mail (Postfix) with ESMTP id CAD6C198EF7; Fri, 7 Nov 2008 20:48:49 +0100 (CET) Received: from mail.physik.uni-wuerzburg.de (wthp192.physik.uni-wuerzburg.de [132.187.40.192]) by mailmaster.uni-wuerzburg.de (Postfix) with ESMTP id A7F1A198EDB; Fri, 7 Nov 2008 20:48:49 +0100 (CET) Received: from localhost.my.domain ([132.187.37.59]) by mail.physik.uni-wuerzburg.de (Lotus Domino Release 8.0.2) with ESMTP id 2008110720484889-30801 ; Fri, 7 Nov 2008 20:48:48 +0100 Received: by localhost.my.domain (sSMTP sendmail emulation); Fri, 7 Nov 2008 20:48:44 +0100 Date: Fri, 7 Nov 2008 20:48:44 +0100 From: Alexey Shuvaev To: Pyun YongHyeon Message-ID: <20081107194844.GA55053@localhost.my.domain> References: <20081015003745.GG14769@cdnetworks.co.kr> <20081103183556.GA2009@localhost.my.domain> <20081104014246.GA98154@cdnetworks.co.kr> MIME-Version: 1.0 In-Reply-To: <20081104014246.GA98154@cdnetworks.co.kr> Organization: Universitaet Wuerzburg User-Agent: Mutt/1.5.18 (2008-05-17) X-MIMETrack: Itemize by SMTP Server on domino1/uni-wuerzburg(Release 8.0.2|August 07, 2008) at 11/07/2008 08:48:48 PM, Serialize by Router on domino1/uni-wuerzburg(Release 8.0.2|August 07, 2008) at 11/07/2008 08:48:49 PM, Serialize complete at 11/07/2008 08:48:49 PM Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Virus-Scanned: by amavisd-new at uni-wuerzburg.de Cc: freebsd-current@freebsd.org Subject: Re: Call for testers: fxp(4) WOL X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Nov 2008 19:48:51 -0000 On Tue, Nov 04, 2008 at 10:42:46AM +0900, Pyun YongHyeon wrote: > On Mon, Nov 03, 2008 at 07:35:56PM +0100, Alexey Shuvaev wrote: > > Here are relevant messages from the verbose boot: > > > > fxp0: port 0xdf40-0xdf7f mem 0xfceff000-0xfcefffff irq 11 at device 8.0 on pci2 > > If it's based on ICH controller it would be 82559. > > > fxp0: Reserved 0x1000 bytes for rid 0x10 type 3 at 0xfceff000 > > fxp0: using memory space register mapping > > fxp0: PCI IDs: 8086 1031 1179 0001 0042 > > fxp0: Dynamic Standby mode is disabled > > miibus0: on fxp0 > > fxp0: XXX: driver didn't set ifq_maxlen > > ^^^ > > Is this something to fix? > > > > fxp(4) didn't set ifq_maxlen and if_attach corrected this with > its default value. Normally network device drivers set this queue > length to number of Tx descriptors but it's completely up to > driver writers and I don't see compeling reason to change that. > Ok, I just was attracted by something with 'XXX'. > > However the system seems to honors only the BIOS settings, if I enable WOL in > > the BIOS the system wakes up from power-down or suspend (to ram) states > > regardless of fxp settings and with disabled WOL in BIOS it never > > wakes up. > > > > Yes that's an expected behaviour. BIOS option should be changed to > enable WOL if you want to wake up your box from power down. If > you don't want to wake up your box regardless of BIOS configuration > you have to disable WOL with ifconfig before shutting down your > box. Likewise even if you enable WOL with ifconfig(8) to wake up > your system, BIOS WOL option also should be enabled to make it > work. > > > The worse thing I have noticed is if I send WOL packet while the system is > > running it reliably hangs. It does not panic and switching virtual > > consoles works (and typing/deleting something in the shell prompt too), > > but the cooler runs at full power and you can't do anything else. > > This is both with patched fxp and that from -CURRENT. > > Hmm, I think that was old bebahviour of stock fxp(4). Previously > fxp(4) was programmed to accept WOL packets regardless of running > state of hardware. With my patch the WOL should be disabled for > normal operation and WOL is enabled again when you shutdown your > box. If sotck fxp(4) also show the same behaviour it's big security > hole. > ATM I have no idea how WOL packets can affect running box. :-( > I have tested more thoroughly and here are the results. FreeBSD-CURRENT (late oktober) without your patch (is it what you call 'stock'?): interface up or down, WOL disabled or enabled in the BIOS - system hangs when receiving WOL packet. Breaking to debugger shows kernel running, namely 3 acpi threads, acpi_task_[0-2]. FreeBSD-CURRENT from 4 Nov 2008 with your patch: again, with WOL enabled in BIOS or not, system hangs with WOL packet, but only if interface is down. With interface (fxp0) up and running, nothing happens. However, I failed to disable WOL with ifconfig, notebook boots always when WOL enabled in the BIOS. Linux-Ubuntu uname: Linux ubuntu 2.6.22-14-generic #1 SMP Sun Oct 14 23:05:12 GMT 2007 i686 GNU/Linux (booted live from CD) The same results as with FreeBSD-CURRENT with your patch. Disabling wol with ethtool does not produce the desired results. Receiving WOL packet when interface is down does not hang the system, but it (according to top) consumes 70% in system with kacpid process consuming 98.5% of cpu. > Thanks for testing. I'll think again. > By chance can you try Linux on your system and check whether it > works? > So, it seems your patch is making FreeBSD on par with Linux. If you need something more, you are welcome! Alexey.