From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1N8GDR-0005X5-My for qemu-devel@nongnu.org; Wed, 11 Nov 2009 11:38:41 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1N8GDN-0005Tb-07 for qemu-devel@nongnu.org; Wed, 11 Nov 2009 11:38:41 -0500 Received: from [199.232.76.173] (port=41546 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1N8GDM-0005TV-Lw for qemu-devel@nongnu.org; Wed, 11 Nov 2009 11:38:36 -0500 Received: from mx20.gnu.org ([199.232.41.8]:41155) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1N8GDM-0001LI-6a for qemu-devel@nongnu.org; Wed, 11 Nov 2009 11:38:36 -0500 Received: from mail.codesourcery.com ([38.113.113.100]) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1N8GDL-0002TG-7p for qemu-devel@nongnu.org; Wed, 11 Nov 2009 11:38:35 -0500 From: Paul Brook Subject: Re: [Qemu-devel] [sneak preview] major scsi overhaul Date: Wed, 11 Nov 2009 16:38:31 +0000 References: <4AF4ACA5.2090701@redhat.com> <200911111413.09320.paul@codesourcery.com> <4AFAD7A8.70707@redhat.com> In-Reply-To: <4AFAD7A8.70707@redhat.com> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <200911111638.31288.paul@codesourcery.com> List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Gerd Hoffmann >> That cap is important. >> For scsi-generic you probably don't have a choice because of the way the >> kernel interface works. > >Exactly. And why is the cap important for scsi-disk if scsi-generic >does fine without? With scsi-generic you're at the mercy of what the kernel API gives you, and if the guest hardware/OS isn't cooperative then you loose. With scsi-disk we can do significantly better. > > The only way to make your API work is to skip straight from step 3 to > > step 6, which effectively looses the command queueing capability. > > It doesn't. The disconnect and thus the opportunity to submit more > commands while the device is busy doing the actual I/O is there. Disconnecting on the first DMA request (after switching to a data phase and transferring zero bytes) is bizarre behavior, but probably allowable. However by my reading DMA transfers must be performed synchronously by the SCRIPTS engine, so you need to do a lot of extra checking to prove that you can safely continue execution without actually performing the transfer. > > It may be that it's > > hard/impossible to get both command queueing and zero-copy. > > I have it working. More likely you have a nasty hack that happens to work with the Linux drivers. IIUC you're pretending that the DMA completed and eventually disconnecting the device, assuming that nothing will read that data until the command complete notification is received. Consider the case there the guest transfers the data from a single command in two blocks, and has the HBA raise an interrupt in-between so that it can start processing before the command completes. This processing could even be done by the SCRIPTS engine itself, or a guest could even reuse the buffer for the second DMA block. Paul