From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1N3MlH-0002Ji-Kz for qemu-devel@nongnu.org; Thu, 29 Oct 2009 00:37:23 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1N3MlD-0002JG-1M for qemu-devel@nongnu.org; Thu, 29 Oct 2009 00:37:23 -0400 Received: from [199.232.76.173] (port=53237 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1N3MlC-0002JD-Un for qemu-devel@nongnu.org; Thu, 29 Oct 2009 00:37:18 -0400 Received: from verein.lst.de ([213.95.11.210]:40214) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_3DES_EDE_CBC_SHA1:24) (Exim 4.60) (envelope-from ) id 1N3MlC-0002xO-FM for qemu-devel@nongnu.org; Thu, 29 Oct 2009 00:37:18 -0400 Date: Thu, 29 Oct 2009 05:37:08 +0100 From: Christoph Hellwig Subject: Re: [Qemu-devel] [PATCH 0/4] megaraid_sas HBA emulation Message-ID: <20091029043708.GA3552@lst.de> References: <4AE71116.6080809@suse.de> <4AE72419.60608@redhat.com> <20091028091129.n46xqd1lww8oosc8@imap.suse.de> <4AE822E7.2010108@redhat.com> <4AE84E09.7090002@redhat.com> <20091028202522.r53660olwsk8cokk@imap.suse.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20091028202522.r53660olwsk8cokk@imap.suse.de> List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Hannes Reinecke Cc: virtualization@lists.linux-foundation.org, Gerd Hoffmann , kvm@vger.kernel.org, qemu-devel@nongnu.org On Wed, Oct 28, 2009 at 08:25:22PM +0100, Hannes Reinecke wrote: > I don't think we really need two modes. > My preferred interface here is to pass down scatter-gather lists down > with every xfer; this way it'll be the responsibility of the driver to > create the lists in the first place. If it has hardware scatter-gather > support it can just pass them down, if not it can as easily create a > scatter-gather list with just one element as a bounce buffer. Yes. If this really causes performance problems for esp we can add bounce buffering in that driver later. > So something like > - Get next request > - Attach iovec/bounc-buffer > - handle request (command/write/read) > - complete request (callback) Btw, from some previuous attempts to sort out this code here are some thing that I think would be beneficial: - try to create generic scsi device/request structures that the hba driver can access, and which contain additional private data for scsi-disk/generic. Information in the generic one would include the information about the data transfer, the tag and the command block. - try to get rid of the tag indexing stuff by just using a pointer to the generic scsi request in the hba drivers. That should get rid of a lot of useless list searching.