qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [question] the patch which affect performance of virtio


From: Paolo Bonzini
Subject: Re: [Qemu-devel] [question] the patch which affect performance of virtio-scsi
Date: Tue, 03 Feb 2015 09:49:54 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0

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 via email to

[Prev in Thread] Current Thread [Next in Thread]