All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Ming Lei <ming.lei@canonical.com>, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] scsi-disk: provide "max write same length" for block limits VPD page
Date: Fri, 05 Dec 2014 16:51:01 +0100	[thread overview]
Message-ID: <5481D465.2010804@redhat.com> (raw)
In-Reply-To: <1417784418-32259-1-git-send-email-ming.lei@canonical.com>



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 <ming.lei@canonical.com>
> ---
>  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

      reply	other threads:[~2014-12-05 15:51 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-05 13:00 [Qemu-devel] [PATCH] scsi-disk: provide "max write same length" for block limits VPD page Ming Lei
2014-12-05 15:51 ` Paolo Bonzini [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5481D465.2010804@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=ming.lei@canonical.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.