qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: "Wangting (Kathy)" <kathy.wangting@huawei.com>
Cc: qemu-devel <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] [question] the patch which affect performance of virtio-scsi
Date: Tue, 03 Feb 2015 09:49:54 +0100	[thread overview]
Message-ID: <54D08BB2.1070400@redhat.com> (raw)
In-Reply-To: <54D038EB.9020508@huawei.com>

On 03/02/2015 03:56, Wangting (Kathy) wrote:
> Sorry, I find that the patch of "virtio-scsi: Optimize virtio_scsi_init_req" can slove this problem.

Great that you could confirm that. :)

> By the way, can you tell me the reason of the change about cdb and sense?

cdb and sense are variable-size items.  ANY_LAYOUT support changed
VirtIOSCSIReq: instead of having a pointer to the request, it copies the
request from guest memory into VirtIOSCSIReq.  This is required because
the request might not be contiguous in guest memory.  And because the
request and response headers (e.g. VirtIOSCSICmdReq and
VirtIOSCSICmdResp) are included by value in VirtIOSCSIReq, the
variable-sized fields have to be treated specially.

Only one of them can remain in VirtIOSCSIReq, because you cannot have a
flexible array member (e.g. "uint_8 sense[];") in the middle of a struct.

cdb is always used, so it is chosen for the variable-sized part of
VirtIOSCSIReq: cdb was simply moved from VirtIOSCSICmdReq to VirtIOSCSIReq.

Instead, requests that complete with sense data are not a fast path.
Hence sense is retrieved from the SCSIRequest, and
virtio_scsi_command_complete copies it into the guest buffer via
scsi_req_get_sense + qemu_iovec_from_buf.

Paolo

  reply	other threads:[~2015-02-03  8:50 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-03  2:31 [Qemu-devel] [question] the patch which affect performance of virtio-scsi Wangting (Kathy)
2015-02-03  2:56 ` Wangting (Kathy)
2015-02-03  8:49   ` Paolo Bonzini [this message]
2015-02-07 11:26     ` Wangting (Kathy)
2015-02-08 10:10       ` Paolo Bonzini
2015-02-09  2:53         ` Wangting (Kathy)
2015-02-03  8:42 ` Paolo Bonzini

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=54D08BB2.1070400@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=kathy.wangting@huawei.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).