Subject: Re: Cabletron "etherd" program for NetBSD
To: Ian Dall <Ian.Dall@dsto.defence.gov.au>
From: Jason Thorpe <thorpej@nas.nasa.gov>
List: port-pc532
Date: 08/25/1996 20:07:51
On Mon, 26 Aug 1996 09:38:03 +0930 
 Ian Dall <Ian.Dall@dsto.defence.gov.au> wrote:

 > Regarding moving the etherd functionality into the kernel: I haven't
 > looked at the scsi code, but surely scsi commands are executed from
 > inside the kernel for multiple reasons. Inquiry, Request Sense, and
 > write file mark commands must be initiated inside the kernel and I
 > assume block IO and paging/swapping is not done in a process context.

All I/O to SCSI disks is done via SCSI command, of course.  There are 
very few cases where SCSI commands themselves actually originate 
_outside_ the kernel.

It seems as if "if_ctsc" (Cabletron SCSI :-) could do something like:

	Packet transmission:

	- Copy mbuf chain into linear buffer.

	- Use that linear buffer as the SCSI command data.  Set
	  the `NOSLEEP' flag on the SCSI transfer so that Bad Things(tm)
	  won't happen.

	- Use the "scsi_done" hook like you would a transmit completion
	  interrupt on a regular network interface.

If I'm not mistaken, the original author mentioned to me that he was
concerned about interactions with the buffer cache (am I totally spacing
out?  I remember exchanging e-mail with him, but lately my brain has
had too much traffic to remember the conversation clearly...)  Anyhow,
there wouldn't really be any interaction with _any_ buffer caches.
However, mbuf chain -> linear buffer does imply copying the entire
packet, but most (all?) network interface drivers do that anyhow.

It's not obvious to me how the Cabletron device notifies the host that
it's received a packet.  However, it seems as if the device would
fill a linear buffer with the packet, which would then be copied into
an mbuf chain (or cluster).  Really, in general, it seems like it could
basically look like a regular network interface driver with a strange way
of accessing the device registers :-)

 -- save the ancient forests - http://www.bayarea.net/~thorpej/forest/ -- 
Jason R. Thorpe                                       thorpej@nas.nasa.gov
NASA Ames Research Center                               Home: 408.866.1912
NAS: M/S 258-6                                          Work: 415.604.0935
Moffett Field, CA 94035                                Pager: 415.428.6939