Received: from eggs.gnu.org ([2001:4830:134:3::10]:40730) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X876u-0003LV-NH for qemu-devel@nongnu.org; Fri, 18 Jul 2014 08:18:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X876m-0005b9-A9 for qemu-devel@nongnu.org; Fri, 18 Jul 2014 08:18:00 -0400 Received: from annex.linet.gr.jp ([182.163.76.19]:51763 helo=mail.linet.jp) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X876m-0005ai-1b for qemu-devel@nongnu.org; Fri, 18 Jul 2014 08:17:52 -0400 Message-Id: <201407181217.AA01538@tamuki.linet.gr.jp> From: TAMUKI Shoichi Date: Fri, 18 Jul 2014 21:17:26 +0900 In-Reply-To: <1405515290-12497-1-git-send-email-pbonzini@redhat.com> References: <1405515290-12497-1-git-send-email-pbonzini@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Subject: Re: [Qemu-devel] [PATCH for-2.2 0/5] scsi: enable passthrough of vendor-specific commands List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Paolo Bonzini , TAMUKI Shoichi Hello, From: Paolo Bonzini Subject: [PATCH for-2.2 0/5] scsi: enable passthrough of vendor-specific commands Date: Wed, 16 Jul 2014 14:54:45 +0200 > Right now scsi-generic is parsing the CDB, in order to compute > the expected number of bytes to be transferred. This is necessary > if DMA is done by the HBA via scsi_req_data, but it prevents executing > vendor-specific commands via scsi-generic because we don't know how > to parse them. > > If DMA is delegated to the SCSI layer via get_sg_list, we know in > advance how many bytes the guest will want to receive and we can pass > the information straight from the guest to SG_IO. In this case, it is > unnecessary to parse the CDB to get the same information. scsi-disk needs > it to detect underruns and overruns, but scsi-generic and scsi-block can > just ask the HBA about the transfer direction and size. > > This series introduces a new parse_cdb callback in both the device and > the HBA. The latter is called by scsi_bus_parse_cdb, which devices can > call for passthrough requests in their implementation of parse_cdb. Great, thanks a lot. > Tamuki-san, can you please test if these patches are okay for your > usecase? I tested these patches against 5a73480 (Update version for v2.1.0-rc2 release,) and confirmed that a vendor-specific command sent from the initiator in a guest successfully reach (at least) the host using sg_raw and ftrace. That works fine. Regards, TAMUKI Shoichi