kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Al Viro <viro@ZenIV.linux.org.uk>
To: "Michael S. Tsirkin" <mst@redhat.com>
Cc: David Miller <davem@davemloft.net>,
	netdev@vger.kernel.org, kvm@vger.kernel.org
Subject: Re: [PATCH v2 17/18] vhost: don't bother copying iovecs in handle_rx(), kill memcpy_toiovecend()
Date: Tue, 3 Feb 2015 22:13:11 +0000	[thread overview]
Message-ID: <20150203221311.GD29656@ZenIV.linux.org.uk> (raw)
In-Reply-To: <20150203152154.GA9072@redhat.com>

On Tue, Feb 03, 2015 at 04:21:54PM +0100, Michael S. Tsirkin wrote:
> > Hmm having second thoughts here.
> > Will this modify the iov in vq->iov?
> > If yes, how will recvmsg fill it?
> 
> OK that was just me misunderstanding what the
> function does. As it doesn't modify the iovec itself,
> I think there's no issue, my ack stands.

That, BTW, was the point of switching ->sendmsg() and ->recvmsg() to
iov_iter primitives - not only do memcpy_toiovec() et.al. change the
iovec, the way it's done was protocol-dependent, up to and including
the things like "have sent 60 caller-supplied bytes, iovec modified
with only 6 bytes consumed".  What's worse, on TCP sendmsg we usually
left iovec unchanged, but sometimes it got drained.  Granted, that
happened only after setsockopt() playing caller with TCP_REPAIR (i.e.
checkpoint/restart stuff), but...

  reply	other threads:[~2015-02-03 22:13 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20150131035513.GK29656@ZenIV.linux.org.uk>
2015-02-02  7:59 ` [PATCH v2 15/18] vhost: switch vhost get_indirect() to iov_iter, kill memcpy_fromiovec() Al Viro
2015-02-03  9:01   ` Michael S. Tsirkin
2015-02-02  7:59 ` [PATCH v2 16/18] vhost: don't bother with copying iovec in handle_tx() Al Viro
2015-02-03  9:14   ` Michael S. Tsirkin
2015-02-02  7:59 ` [PATCH v2 17/18] vhost: don't bother copying iovecs in handle_rx(), kill memcpy_toiovecend() Al Viro
2015-02-03  9:13   ` Michael S. Tsirkin
2015-02-03 10:04   ` Michael S. Tsirkin
2015-02-03 15:21     ` Michael S. Tsirkin
2015-02-03 22:13       ` Al Viro [this message]
2015-02-02  7:59 ` [PATCH v2 18/18] vhost: vhost_scsi_handle_vq() should just use copy_from_user() Al Viro
2015-02-03  0:42   ` Nicholas A. Bellinger
2015-02-03  9:05   ` Michael S. Tsirkin

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=20150203221311.GD29656@ZenIV.linux.org.uk \
    --to=viro@zeniv.linux.org.uk \
    --cc=davem@davemloft.net \
    --cc=kvm@vger.kernel.org \
    --cc=mst@redhat.com \
    --cc=netdev@vger.kernel.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).