Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 9 Jul 2004 10:48:18 -0400 (EDT)
From:      Andrew Gallatin <gallatin@cs.duke.edu>
To:        Robert Watson <rwatson@FreeBSD.org>
Cc:        current@FreeBSD.org
Subject:   Re: ethercons updated for -CURRENT
Message-ID:  <16622.45106.992924.734398@grasshopper.cs.duke.edu>
In-Reply-To: <Pine.NEB.3.96L.1040709101417.60816J-100000@fledge.watson.org>
References:  <16622.41619.355522.170000@grasshopper.cs.duke.edu> <Pine.NEB.3.96L.1040709101417.60816J-100000@fledge.watson.org>

next in thread | previous in thread | raw e-mail | index | archive | help

Robert Watson writes:
 > In order to support really low level I/O, you basically need a polled
 > network API that doesn't really care where it's called from -- the
 > physical console and sio both fall into this category, but the current
 > ethernet stack pieces don't as well.  It's not impossible to imagine
 > writing one, but the tricks that are pulled in the 4.x gdb-over-ethernet
 > kernel debugging won't work -- they call into the mbuf allocator and
 > assume it's "safe" -- in 4.x, it was risky, in 5.x you would get a panic
 > for trying to acquire locks in the debugger.

For what its worth, Darwin has this for their KDP ethernet debugging.
To receive something, the debugger provides a buffer and specifies a
timeout.  The driver keeps the same memory mapped for DMA, and just
copies into the provided void *buffer.  There is also a polled
transmit routine, where the driver does not return until the outgoing
packet has been DMA'ed.  In both cases, the driver is not allowed to
allocate memory, or do anything which can block.

One thing that's always concerned me is how do they ensure the driver
is not in the middle of a "normal" transmit or recv when the debugger
is entered..

Drew



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