Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 22 Mar 1999 11:07:29 -0700
From:      "Justin T. Gibbs" <gibbs@plutotech.com>
To:        "Matthew N. Dodd" <winter@jurai.net>
Cc:        "Kenneth D. Merry" <ken@plutotech.com>, gibbs@plutotech.com, scsi@FreeBSD.ORG
Subject:   Re: CAM entry point for SCSI-to-Ethernet device. 
Message-ID:  <199903221816.LAA32198@pluto.plutotech.com>
In-Reply-To: Your message of "Mon, 22 Mar 1999 01:18:22 EST." <Pine.BSF.4.02.9903220036430.2158-100000@sasami.jurai.net> 

next in thread | previous in thread | raw e-mail | index | archive | help
>Is there any way of handing the CAM subsystem a list of CCBs to be
>executed or adding a CCB to the queue of runable CCBs?  I'd like to submit
>CCBs to the queue, xpt_schedule() then pull the next available CCB to be
>executed, clean up after it in se_cam_done() and call xpt_schedule() again
>if there are still runable CCBs in the queue.

xpt_schedule() doesn't schedule the I/O to the controller, it schedules
you to receive CCB resources.  It seems that the networking stack already
provides you with a convenient queue of packets for you to consume as
CCBs become available.  So, instead of doing what a conventional ethernet
driver does in it's ether-start routine, simply call xpt_schedule().  In
your CAM peripheral start routine, remove a single packet, stuff it into
a CCB, send it with xpt_action(), and reschedule yourself if the packet
queue is not empty.

>That really depends on how much work I want to do at splnet() vs.
>splbio().

You won't be doing any work at splbio().  You should register your
device as a 'network device' with CAM and use splnet() at all times.
I had ethernet devices in mind when I setup the interrupt framework
for CAM.

>My thought was to de-queue and process the mbufs and return them to the
>system since I'll be able to allocate a buffer of the correct size for
>each packet.  Its unfortunate that I can't get CAM to do a scatter/gather
>type thing and pass it a descriptor list that describes the location and
>length of each mbuf data element.

But you can.  Give me a little time, and I'll finish the support for this
in the bus dma framework and hook it up in the controller drivers.  You
will need to set the CAM_SCATTER_VALID flag in the ccb-ccb_h.flags and
not set the CAM_SG_LIST_PHYS flag.  S/G lists with physical addresses
(really bus addresses) are already supported by all controllers.

--
Justin




To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-scsi" in the body of the message




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