From owner-freebsd-scsi Tue Oct 12 9:54: 5 1999 Delivered-To: freebsd-scsi@freebsd.org Received: from narnia.plutotech.com (narnia.plutotech.com [206.168.67.130]) by hub.freebsd.org (Postfix) with ESMTP id 83C13157D3 for ; Tue, 12 Oct 1999 09:53:36 -0700 (PDT) (envelope-from gibbs@narnia.plutotech.com) Received: (from gibbs@localhost) by narnia.plutotech.com (8.9.3/8.7.3) id KAA34505; Tue, 12 Oct 1999 10:42:52 -0600 (MDT) Date: Tue, 12 Oct 1999 10:42:52 -0600 (MDT) From: "Justin T. Gibbs" Message-Id: <199910121642.KAA34505@narnia.plutotech.com> To: Gerard Roudier Cc: scsi@FreeBSD.org Subject: Re: Driver for GDT6517RD RAID controller X-Newsgroups: pluto.freebsd.scsi In-Reply-To: User-Agent: tin/pre-1.4-980818 ("Laura") (UNIX) (FreeBSD/4.0-CURRENT (i386)) Sender: owner-freebsd-scsi@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org In article you wrote: > > Having to ask a kernel abstraction for providing me a scatter list and > then having to rewalk it for it to conform with the expectations of the > hardware (sometimes modulo device errata) is something that makes me pain > in the ass to run on my Intel machine. For the NCR, I would expect that you wouldn't need to rewalk it at all other than to copy it to your own private storage. With bus-dma, you should be able to specify all of the parameters necessary to get an S/G list that avoids all of your hardware bugs. Other than it being created before the transaction comes to the SIM, this seems very similar to Linux. Having every driver create their own S/G list is problematic when kernel interfaces change. What happens when we change our clustering code to pass down a list of I/O requests to be combined? Hopefully this will just result in the drivers calling a slightly different bus_dma method. > So, even if I ever go with some > BUS abstractions for this kind of stuff, I will keep with the legacy > _simple_ way to do the same thing, conditionnally compilable for my > personnal use (as long as this legacy way will be available, obviously). > > Same pain in the ass if, when doing MMIO I have to call something that > will not only do the memory access, but each time will test for having to > do IO or MMIO. This situation may get just ridiculous for example for a > device that only allows one of the IO methods (only MMIO for example on > PCI). FreeBSD does not cause any penalty for devices that only support a single access method. You just need to include the appropriate header files to indicate this and the extra overhead of supporting additional access methods goes away. Unfortunately, in the generic kernel case, you often need to support multiple access types in the same [PCI] driver as not all machines/chipsets handle the most efficient access method [MMIO]. If the abstraction allows you to create a readable piece of code that can be compiled to run generically but can also be compiled to run optimally this seems ideal. There has been some talk on the lists about adding kernel options that would allow you to globally optimize the access methods so even drivers that sometimes need to support mutliple access methods can be easily tuned for specific machines. Since you seem to have an opinion about these things, perhaps you should join in the discussions. >> The other possible thing I'm considering doing (since a couple of >> the SIM's do have support for target-mode) is to build an IP transport > > You must distinguish between phase cognizant target mode and host target > mode. What I intend to implement in the future is something that avoids > stalling the phase engine as possible, thus host target mode. Note that if > you just read the messages after selection, accept the command and > disconnect prior to signaling the upper layer, then this host target mode > will never stall the phase engine in normal situations when implemented > with 53c8xx chips. This will allow to use both initiator and target mode > on an HBA without wasting uselessly SCSI BUS bandwitch for the target mode > part. I agree phase cognizant isn't that interesting. The aic7xxx driver works in the fashion you describe. > As seen from SIM the handling of the target mode is in fact much simpler > tham initiator mode, since the part that acts as a target has the baton in > SCSI. So, a SIM that will only implement target mode should be > significantly simpler than common ones that only implement initiator mode > (given appropriate hardware). > What is not simple is to provide both modes from a SIM, without the > support for the target mode adding too much complexity (making driver less > reliable) and wasting too much resources. Target mode isn't difficult, but I would refrain from calling it simpler than the initiator role. There are several little gotchas mostly having to do with resource deadlocks when running in both roles at the same time and the initiator tells you that you cannot disconnect. -- Justin To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-scsi" in the body of the message