From owner-freebsd-scsi Mon Mar 22 10:16:58 1999 Delivered-To: freebsd-scsi@freebsd.org Received: from pluto.plutotech.com (mail.plutotech.com [206.168.67.137]) by hub.freebsd.org (Postfix) with ESMTP id 1A05614BD4 for ; Mon, 22 Mar 1999 10:16:56 -0800 (PST) (envelope-from gibbs@plutotech.com) Received: from narnia.plutotech.com (narnia.plutotech.com [206.168.67.130]) by pluto.plutotech.com (8.9.2/8.9.1) with ESMTP id LAA32198; Mon, 22 Mar 1999 11:16:30 -0700 (MST) (envelope-from gibbs@plutotech.com) Message-Id: <199903221816.LAA32198@pluto.plutotech.com> X-Mailer: exmh version 2.0.2 2/24/98 To: "Matthew N. Dodd" Cc: "Kenneth D. Merry" , gibbs@plutotech.com, scsi@FreeBSD.ORG Subject: Re: CAM entry point for SCSI-to-Ethernet device. In-reply-to: Your message of "Mon, 22 Mar 1999 01:18:22 EST." Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Mon, 22 Mar 1999 11:07:29 -0700 From: "Justin T. Gibbs" Sender: owner-freebsd-scsi@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org >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