From mboxrd@z Thu Jan 1 00:00:00 1970 From: Gerd Hoffmann Subject: Re: [Qemu-devel] [PATCH 0/4] megaraid_sas HBA emulation Date: Tue, 03 Nov 2009 22:03:25 +0100 Message-ID: <4AF09A9D.8020501@redhat.com> 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> <20091029043708.GA3552@lst.de> <4AE99144.6050904@redhat.com> <4AEA9FD8.6070007@suse.de> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Christoph Hellwig , qemu-devel@nongnu.org, kvm@vger.kernel.org, virtualization@lists.linux-foundation.org To: Hannes Reinecke Return-path: Received: from mx1.redhat.com ([209.132.183.28]:55608 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754249AbZKCVDg (ORCPT ); Tue, 3 Nov 2009 16:03:36 -0500 In-Reply-To: <4AEA9FD8.6070007@suse.de> Sender: kvm-owner@vger.kernel.org List-ID: On 10/30/09 09:12, Hannes Reinecke wrote: > Gerd Hoffmann wrote: >> http://repo.or.cz/w/qemu/kraxel.git?a=shortlog;h=refs/heads/scsi.v1 >> >> It is far from being completed, will continue tomorrow. Should give a >> idea of the direction I'm heading to though. Comments welcome. >> > Yep, this looks good. More bits available now at: http://repo.or.cz/w/qemu/kraxel.git/shortlog/refs/heads/scsi.v3 Please have a look at the new interface, this commit: http://repo.or.cz/w/qemu/kraxel.git/commitdiff/9c825dac540282dd4d5f5f660ca13af617888037 The workflow I have in mind is: ->request_new() Returns a parsed request, i.e. all fields of req->cmd are filled already, so the host adapter can easily check whenever it is a read or write and how many bytes will be transfered. ->request_run() Execute the command. iovec is passed to the dma_bdrv_*() functions, which means it should contain guest physical addresses. When the request is done the complete callback is called. For commands which complete immediately the callback might be called before request_run() returns. Or maybe don't call the callback at all then? We can easily indicate using the return value that we are done already. ->request_del() Release request when done. Questions & comments are welcome. cheers, Gerd From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1N5QXY-0000en-Tg for qemu-devel@nongnu.org; Tue, 03 Nov 2009 16:03:44 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1N5QXU-0000bT-5P for qemu-devel@nongnu.org; Tue, 03 Nov 2009 16:03:44 -0500 Received: from [199.232.76.173] (port=50332 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1N5QXT-0000bM-Rj for qemu-devel@nongnu.org; Tue, 03 Nov 2009 16:03:39 -0500 Received: from mx1.redhat.com ([209.132.183.28]:56286) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1N5QXT-0005yM-7X for qemu-devel@nongnu.org; Tue, 03 Nov 2009 16:03:39 -0500 Message-ID: <4AF09A9D.8020501@redhat.com> Date: Tue, 03 Nov 2009 22:03:25 +0100 From: Gerd Hoffmann MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH 0/4] megaraid_sas HBA emulation 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> <20091029043708.GA3552@lst.de> <4AE99144.6050904@redhat.com> <4AEA9FD8.6070007@suse.de> In-Reply-To: <4AEA9FD8.6070007@suse.de> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit 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, Christoph Hellwig , kvm@vger.kernel.org, qemu-devel@nongnu.org On 10/30/09 09:12, Hannes Reinecke wrote: > Gerd Hoffmann wrote: >> http://repo.or.cz/w/qemu/kraxel.git?a=shortlog;h=refs/heads/scsi.v1 >> >> It is far from being completed, will continue tomorrow. Should give a >> idea of the direction I'm heading to though. Comments welcome. >> > Yep, this looks good. More bits available now at: http://repo.or.cz/w/qemu/kraxel.git/shortlog/refs/heads/scsi.v3 Please have a look at the new interface, this commit: http://repo.or.cz/w/qemu/kraxel.git/commitdiff/9c825dac540282dd4d5f5f660ca13af617888037 The workflow I have in mind is: ->request_new() Returns a parsed request, i.e. all fields of req->cmd are filled already, so the host adapter can easily check whenever it is a read or write and how many bytes will be transfered. ->request_run() Execute the command. iovec is passed to the dma_bdrv_*() functions, which means it should contain guest physical addresses. When the request is done the complete callback is called. For commands which complete immediately the callback might be called before request_run() returns. Or maybe don't call the callback at all then? We can easily indicate using the return value that we are done already. ->request_del() Release request when done. Questions & comments are welcome. cheers, Gerd