From: "Michael S. Tsirkin" <mst@redhat.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: qemu-devel <qemu-devel@nongnu.org>,
Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Subject: Re: [Qemu-devel] virtio scsi host draft specification, v2
Date: Thu, 2 Jun 2011 15:54:41 +0300 [thread overview]
Message-ID: <20110602125441.GG7141@redhat.com> (raw)
In-Reply-To: <4DE77BEC.1050707@redhat.com>
On Thu, Jun 02, 2011 at 02:02:52PM +0200, Paolo Bonzini wrote:
> On 06/02/2011 01:41 PM, Michael S. Tsirkin wrote:
> >Now to our problem:
> >As far as I can tell there are two input buffers in each request: sense
> >and data. Right?
> >
> >If sense is fixed length, we can simply put it first, have device write
> >sense then data. This does not seem too limiting, if you want a lot of
> >flexibility sense length can be in device config. If we don't want to
> >limit ourselves to fixed length sense, we would have driver use two
> >heads for a request. This is possible but one needs to be careful in
> >the driver to make sure there's enough space for both requests. Maybe
> >add_bufs API to add multiple bufs might be a good idea here.
>
> I should be on holiday today so I'll answer this quickly. Sounds
> like we can converge, I'll put data at the end and define the length
> of sense in the config: the device writes a default (defined by the
> spec to be always 96) and the driver can modify it. The _single_
> head would contain:
>
> - read-only: command etc.
>
> followed by:
>
> - write-only: sense, status etc.
>
> followed by:
>
> - read-only: data to device
> - write-only: data from device
Yes, this works.
> IIUC, qemu only sees a bunch of read-only and write-only buffers.
> It doesn't see the relative ordering of read-only vs. write-only.
In virtio write is always before read.
> But it knows the sizes of read-only and write-only data, so it can
> figure out datain_size and dataout_size. sense_size is in the
> config, so neither of the three needs to be in the request.
>
> sense_len needs to stay, since any number of bytes can be written in
> the sense buffer.
I think this means sense_len needs to go into the in buffer
as well. As head is first it's an out buffer.
> The used-length field should be usable for
> uni-directional commands, but I'm not sure about commands that have
> both datain and dataout. I'll read the SCSI spec about it tomorrow.
used-length is the part of in buffer actually written.
actual data len is thus used-length - 96
(sense is assumed to be fixed length by virtio ring,
sense_len tells driver how many bytes are
actually valid).
>
> Making qemu support arbitrarily partitioned buffers may require some
> extra utility functions to work on iovecs, but nothing too complex.
> If your patches already contain something like that, please dig them
> up so I can avoid duplicate work!
>
> Paolo
Yes. Will do.
--
MST
next prev parent reply other threads:[~2011-06-02 12:54 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-05-20 8:21 [Qemu-devel] virtio scsi host draft specification, v2 Paolo Bonzini
2011-05-28 19:33 ` Stefan Hajnoczi
2011-05-30 9:22 ` Paolo Bonzini
2011-06-01 4:44 ` Stefan Hajnoczi
2011-06-01 8:49 ` Michael S. Tsirkin
2011-06-01 11:59 ` Paolo Bonzini
2011-06-01 12:51 ` Michael S. Tsirkin
2011-06-01 13:31 ` Paolo Bonzini
2011-06-01 14:36 ` Michael S. Tsirkin
2011-06-01 14:51 ` Avi Kivity
2011-06-02 10:42 ` Michael S. Tsirkin
2011-06-02 11:42 ` Avi Kivity
2011-06-02 11:56 ` Michael S. Tsirkin
2011-06-02 12:18 ` Avi Kivity
2011-06-01 15:59 ` Paolo Bonzini
2011-06-02 11:41 ` Michael S. Tsirkin
2011-06-02 12:02 ` Paolo Bonzini
2011-06-02 12:54 ` Michael S. Tsirkin [this message]
2011-06-01 13:46 ` Avi Kivity
2011-06-01 16:25 ` Paolo Bonzini
2011-06-01 16:29 ` Avi Kivity
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=20110602125441.GG7141@redhat.com \
--to=mst@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@linux.vnet.ibm.com \
/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).