From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41205) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XwvA2-0000BN-CY for qemu-devel@nongnu.org; Fri, 05 Dec 2014 10:51:19 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Xwv9x-0000W7-9v for qemu-devel@nongnu.org; Fri, 05 Dec 2014 10:51:14 -0500 Received: from mx1.redhat.com ([209.132.183.28]:44821) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xwv9x-0000Vx-0l for qemu-devel@nongnu.org; Fri, 05 Dec 2014 10:51:09 -0500 Message-ID: <5481D465.2010804@redhat.com> Date: Fri, 05 Dec 2014 16:51:01 +0100 From: Paolo Bonzini MIME-Version: 1.0 References: <1417784418-32259-1-git-send-email-ming.lei@canonical.com> In-Reply-To: <1417784418-32259-1-git-send-email-ming.lei@canonical.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] scsi-disk: provide "max write same length" for block limits VPD page List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Ming Lei , qemu-devel@nongnu.org On 05/12/2014 14:00, Ming Lei wrote: > Since QEMU claims to support UNMAP, WRITE SAME and WRITE SAME 16 > in the LBP VPD page, it is better to provide "max write same length" > in response for block limits VPD page because: > > - T10 SBC-3 doesn't describe priority explicitly when all three > are enabled > - host driver may prefer WRITE/WRITE 16, then try to parse > "max write same length" > > Signed-off-by: Ming Lei > --- > hw/scsi/scsi-disk.c | 14 ++++++++++++++ > 1 file changed, 14 insertions(+) > > diff --git a/hw/scsi/scsi-disk.c b/hw/scsi/scsi-disk.c > index 2f75d7d..b15bf4f 100644 > --- a/hw/scsi/scsi-disk.c > +++ b/hw/scsi/scsi-disk.c > @@ -674,6 +674,20 @@ static int scsi_disk_emulate_inquiry(SCSIRequest *req, uint8_t *outbuf) > outbuf[29] = (unmap_sectors >> 16) & 0xff; > outbuf[30] = (unmap_sectors >> 8) & 0xff; > outbuf[31] = unmap_sectors & 0xff; > + > + /* > + * maximum write same length, just borrow max unmap > + * count because write same command need to support > + * unmap > + */ > + outbuf[36] = 0; > + outbuf[37] = 0; > + outbuf[38] = 0; > + outbuf[39] = 0; > + outbuf[40] = (max_unmap_sectors >> 24) & 0xff; > + outbuf[41] = (max_unmap_sectors >> 16) & 0xff; > + outbuf[42] = (max_unmap_sectors >> 8) & 0xff; > + outbuf[43] = max_unmap_sectors & 0xff; > break; > } > case 0xb2: /* thin provisioning */ > There is support for splitting write_zeroes requests in the block layer, so this is a problem elsewhere in the stack. It could be in QEMU block/ or in Linux. Let's analyze it in the linux-scsi thread. Paolo