From owner-freebsd-current@FreeBSD.ORG Tue Oct 21 00:20:53 2003 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 058A816A4B3; Tue, 21 Oct 2003 00:20:53 -0700 (PDT) Received: from razorbill.mail.pas.earthlink.net (razorbill.mail.pas.earthlink.net [207.217.121.248]) by mx1.FreeBSD.org (Postfix) with ESMTP id EF67D43F3F; Tue, 21 Oct 2003 00:20:51 -0700 (PDT) (envelope-from tlambert2@mindspring.com) Received: from user-38lc0fk.dialup.mindspring.com ([209.86.1.244] helo=mindspring.com) by razorbill.mail.pas.earthlink.net with asmtp (SSLv3:RC4-MD5:128) (Exim 3.33 #1) id 1ABqoz-0001Wo-00; Tue, 21 Oct 2003 00:20:50 -0700 Message-ID: <3F94DDAA.32CB1254@mindspring.com> Date: Tue, 21 Oct 2003 00:18:02 -0700 From: Terry Lambert X-Mailer: Mozilla 4.79 [en] (Win98; U) X-Accept-Language: en MIME-Version: 1.0 To: Robert Watson References: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-ELNK-Trace: b1a02af9316fbb217a47c185c03b154d40683398e744b8a458bda9166011d520da56018be5180525350badd9bab72f9c350badd9bab72f9c350badd9bab72f9c cc: current@freebsd.org cc: Steve Kargl Subject: Re: ethercons: ethernet console driver for 5-current X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 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: Tue, 21 Oct 2003 07:20:53 -0000 Robert Watson wrote: > On Mon, 20 Oct 2003, Steve Kargl wrote: > > This looks very interesting! Can we run ddb over the ethercon to debug > > a wedged machine? [ ... ] > To support ethernet debugging, the debugger would need to be able to drive > polling of the network interface in an interrupt-thread-free environment, > and reproduce more of the lower level network code (i.e., not use mbufs, > etc). This is feasible to do, but would probably require adding new > interfaces to the ethernet driver, and supporting only ethernet cards that > had these additional debugging interfaces. Compared to serial console, > you'd also have a lot more situations where the driver/hardware state > would be sufficiently inconsistent as to make debugging network-related > crashes difficult. On the other hand, Darwin runs quite well with a > network debugger; I believe they have a fairly complex UDP/IP > implementation in the network debugger, although I haven't inspected it. > Apple has the advantage, though, of providing very few ethernet drivers. It's pretty nifty. It's very infrequent that a hang results in something that can't be debugged remotely. The only cases are when an IP address and default route are unknown to the machine at the time of the crash. This can be overridden by providing Open Firmware values, up front, to avoid the need to wait until DHCP is up enough to get the IP (the DHCP implementation is very low level, and happens very early on). Assuming the bug reproduces. You're right about the card support: it's a polled mode driver; on the other hand, it's not really that difficult, even though many ethernet drivers are loaded into the kernel as kext's (Kernel Extensions); FreeBSD boot code can do similar magic up front, in loading drivers as kernel modules. So this actually should not be very hard to put into any/all drivers. It could go in slowly, like multicast, soft interrupt coelescing, or DEVICE_POLLING did, so it's not that big an issue (IMO): at least it's not all or nothing. > So I'm happy to look at it, but the level of time investment to get to > network debugging from the current (and pretty simple) ethercons device > will be fairly high. I know Jonathan Lemon was looking at network console > and debugging code previously, but I don't have copies of his patches. If > I had to guess, I'd assume he had modified the if_fxp driver, and perhaps > others, to provide an appropriate polled interface for use with a > debugger, but I don't know for sure. If someone has copies of these > patches, I'd be happy to take a look at them. The Darwin code is available, and isn't much changed in that area from Jaguar to Panther, so the sources should still be good (FWIW), if you wanted to look there. If anything gets done, I'd dearly love it to get done so that there was binary compatability enough to be able to cross-debug systems, but of course, that would be up to whoever had the time to invest in doing the work. A neat feature of Panther is the ability to actually do system dumps over the wire, if you enable them (and set the magic values). The graduate student who did the original network kernel debugging code in Darwin did that work over the past summer (I did the code for integrating the sysctl's for him). This might be more valuable to FreeBSD than actually running a source debugger (or not), but it's a lot of fun to play with (it uses a dumping protocol based on a modified TFTP). It would at least be useful in shops with 10 or more BSD working machines and one monitoring box, which have the occasional crash. -- Terry