From: "Michael S. Tsirkin" <mst@redhat.com>
To: "Nicholas A. Bellinger" <nab@linux-iscsi.org>
Cc: Al Viro <viro@ZenIV.linux.org.uk>,
"Nicholas A. Bellinger" <nab@daterainc.com>,
target-devel <target-devel@vger.kernel.org>,
linux-scsi <linux-scsi@vger.kernel.org>,
kvm-devel <kvm@vger.kernel.org>,
Paolo Bonzini <pbonzini@redhat.com>,
Christoph Hellwig <hch@lst.de>
Subject: Re: [PATCH-v3 5/9] vhost/scsi: Add ANY_LAYOUT vhost_virtqueue callback
Date: Wed, 4 Feb 2015 11:20:20 +0100 [thread overview]
Message-ID: <20150204102020.GA14325@redhat.com> (raw)
In-Reply-To: <1423044680.28700.37.camel@haakon3.risingtidesystems.com>
On Wed, Feb 04, 2015 at 02:11:20AM -0800, Nicholas A. Bellinger wrote:
> On Tue, 2015-02-03 at 23:56 +0000, Al Viro wrote:
> > On Tue, Feb 03, 2015 at 06:29:59AM +0000, Nicholas A. Bellinger wrote:
> > > + * Copy over the virtio-scsi request header, which when
> > > + * ANY_LAYOUT is enabled may span multiple iovecs, or a
> > > + * single iovec may contain both the header + outgoing
> > > + * WRITE payloads.
> > > + *
> > > + * copy_from_iter() is modifying the iovecs as copies over
> > > + * req_size bytes into req, so the returned out_iter.iov[0]
> > > + * will contain the correct start + offset of the outgoing
> > > + * WRITE payload, if DMA_TO_DEVICE is set.
> >
> > It does no such thing. What it does, though, is changing out_iter so
> > that subsequent copy_from_iter() will return the data you want. Note
> > that out_iter.iov[0] will contain the correct _segment_ of that vector,
> > with the data you want at out_iter.iov_offset bytes from the beginning
> > of that segment. .iov may come to point to subsequent segments and .iov_offset
> > keeps changing, but segments themselves are never changed.
>
> Yes, sorry. Updating that comment to read:
>
> /*
> * Copy over the virtio-scsi request header, which for a
> * ANY_LAYOUT enabled guest may span multiple iovecs, or a
> * single iovec may contain both the header + outgoing
> * WRITE payloads.
> *
> * copy_from_iter() copies over req_size bytes, and sets up
> * out_iter.iov[0] + out_iter.iov_offset to contain the start
> * of the outgoing WRITE payload, if DMA_TO_DEVICE is set.
> */
I'm still confused wrt what this refers to.
You don't actually play with iovs directly anymore,
why bother explaining what happens to the underlying iov?
Can we just say
copy_from_iter will advance out_iter, so that it will point
at the start of the outgoing WRITE payload, if DMA_TO_DEVICE is
set.
Seems clearer to me.
next prev parent reply other threads:[~2015-02-04 10:20 UTC|newest]
Thread overview: 37+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-02-03 6:29 [PATCH-v3 0/9] vhost/scsi: Add ANY_LAYOUT + VERSION_1 support Nicholas A. Bellinger
2015-02-03 6:29 ` [PATCH-v3 1/9] vhost/scsi: Convert completion path to use copy_to_iser Nicholas A. Bellinger
2015-02-03 9:24 ` Michael S. Tsirkin
2015-02-04 8:47 ` Nicholas A. Bellinger
2015-02-03 6:29 ` [PATCH-v3 2/9] vhost/scsi: Fix incorrect early vhost_scsi_handle_vq failures Nicholas A. Bellinger
2015-02-03 6:29 ` [PATCH-v3 3/9] vhost/scsi: Change vhost_scsi_map_to_sgl to accept iov ptr + len Nicholas A. Bellinger
2015-02-03 6:29 ` [PATCH-v3 4/9] vhost/scsi: Add ANY_LAYOUT iov -> sgl mapping prerequisites Nicholas A. Bellinger
2015-02-03 9:32 ` Michael S. Tsirkin
2015-02-04 8:48 ` Nicholas A. Bellinger
2015-02-03 6:29 ` [PATCH-v3 5/9] vhost/scsi: Add ANY_LAYOUT vhost_virtqueue callback Nicholas A. Bellinger
2015-02-03 10:14 ` Michael S. Tsirkin
2015-02-04 9:40 ` Nicholas A. Bellinger
2015-02-04 9:42 ` Michael S. Tsirkin
2015-02-04 10:41 ` Nicholas A. Bellinger
2015-02-04 10:55 ` Nicholas A. Bellinger
2015-02-04 13:16 ` Michael S. Tsirkin
2015-02-04 13:13 ` Michael S. Tsirkin
2015-02-04 13:15 ` Michael S. Tsirkin
2015-02-03 15:22 ` Michael S. Tsirkin
2015-02-03 23:56 ` Al Viro
2015-02-04 7:14 ` Michael S. Tsirkin
2015-02-04 10:11 ` Nicholas A. Bellinger
2015-02-04 10:20 ` Michael S. Tsirkin [this message]
2015-02-04 10:41 ` Nicholas A. Bellinger
2015-02-03 6:30 ` [PATCH-v3 6/9] vhost/scsi: Set VIRTIO_F_ANY_LAYOUT + VIRTIO_F_VERSION_1 feature bits Nicholas A. Bellinger
2015-02-03 9:40 ` Michael S. Tsirkin
2015-02-04 9:13 ` Nicholas A. Bellinger
2015-02-04 9:34 ` Michael S. Tsirkin
2015-02-03 6:30 ` [PATCH-v3 7/9] vhost/scsi: Drop legacy pre virtio v1.0 !ANY_LAYOUT logic Nicholas A. Bellinger
2015-02-03 9:37 ` Michael S. Tsirkin
2015-02-04 9:03 ` Nicholas A. Bellinger
2015-02-03 6:30 ` [PATCH-v3 8/9] vhost/scsi: Drop left-over scsi_tcq.h include Nicholas A. Bellinger
2015-02-03 9:38 ` Michael S. Tsirkin
2015-02-03 6:30 ` [PATCH-v3 9/9] vhost/scsi: Global tcm_vhost -> vhost_scsi rename Nicholas A. Bellinger
2015-02-03 9:38 ` Michael S. Tsirkin
2015-02-03 9:35 ` [PATCH-v3 0/9] vhost/scsi: Add ANY_LAYOUT + VERSION_1 support Michael S. Tsirkin
2015-02-04 8:51 ` Nicholas A. Bellinger
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=20150204102020.GA14325@redhat.com \
--to=mst@redhat.com \
--cc=hch@lst.de \
--cc=kvm@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=nab@daterainc.com \
--cc=nab@linux-iscsi.org \
--cc=pbonzini@redhat.com \
--cc=target-devel@vger.kernel.org \
--cc=viro@ZenIV.linux.org.uk \
/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.