Received: from eggs.gnu.org ([2001:4830:134:3::10]:37082) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XC1f0-0002Nq-6p for qemu-devel@nongnu.org; Tue, 29 Jul 2014 03:17:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XC1eu-0006NR-18 for qemu-devel@nongnu.org; Tue, 29 Jul 2014 03:17:22 -0400 Received: from mx1.redhat.com ([209.132.183.28]:26318) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XC1et-0006NN-PR for qemu-devel@nongnu.org; Tue, 29 Jul 2014 03:17:15 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s6T7HE38004222 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Tue, 29 Jul 2014 03:17:15 -0400 Date: Tue, 29 Jul 2014 15:17:35 +0800 From: Fam Zheng Message-ID: <20140729071735.GB16854@T430.nay.redhat.com> References: <1406560119-22362-1-git-send-email-pbonzini@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1406560119-22362-1-git-send-email-pbonzini@redhat.com> Subject: Re: [Qemu-devel] [PATCH for-2.2 v2 0/5] scsi: enable passthrough of vendor-specific commands List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: qemu-devel@nongnu.org On Mon, 07/28 17:08, Paolo Bonzini wrote: > 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. > > Paolo > > v1->v2: use the "right" CDB size for non-vendor-specific commands, > as some drivers and/or firmware expect that and complain > if you pass a READ(10) command in a 16-byte CDB. Interdiff > here. More learning than reviewing for me, so take this with a grain of salt: Reviewed-by: Fam Zheng