netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Michael S. Tsirkin" <mst@redhat.com>
To: Shirley Ma <mashirle@us.ibm.com>
Cc: David Miller <davem@davemloft.net>,
	Eric Dumazet <eric.dumazet@gmail.com>,
	Avi Kivity <avi@redhat.com>, Arnd Bergmann <arnd@arndb.de>,
	netdev@vger.kernel.org, kvm@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH V5 4/6 net-next] vhost: vhost TX zero-copy support
Date: Tue, 17 May 2011 18:28:40 +0300	[thread overview]
Message-ID: <20110517152840.GA2389@redhat.com> (raw)
In-Reply-To: <1305645734.10756.14.camel@localhost.localdomain>

On Tue, May 17, 2011 at 08:22:14AM -0700, Shirley Ma wrote:
> On Tue, 2011-05-17 at 08:55 +0300, Michael S. Tsirkin wrote:
> > Something in your patch that overwrites the id in vhost
> > and makes it put the wrong id in the used ring?
> > 
> > By the way, need to keep in mind that a guest can
> > give us the same head twice, need to make sure this
> > at least does not corrupt host memory.
> 
> I think I didn't explain the problem very well here.
> 
> This patch doesn't overwrite the id. It just keeps the same coming
> sequence from "head return vhost_get_vq_desc()" to pass to
> vhost_add_used.
> 
> The same ids can be used many times once it passes to guest from
> vhost_add_used. There is no problem. The zero copy patch doesn't have
> any issue.
> 
> The problem is the order of head from return vhost_get_vq_desc should be
> in sequence when it passes to vhost_add_used.

Which is the order the descriptors are put on avail ring.
By design, guest should not depend on used ring entries
being in order with avail ring (and btw with virtio block,
they aren't). If it does, it's a bug I think.

> The original code has no problem, because it gets one head and pass that
> head to vhost_add_used one by one once done the copy. So it's in
> sequence.
> 
> This issue can easily recreate without zerocopy patch by simply changing
> the order from "head return vhost_get_vq_desc" when passing to
> vhost_add_used.
> 
> Thanks
> Shirley

Ah, did you try that? Could you post this patch pls?
This seems to imply a bug in guest virtio.

-- 
MST

  reply	other threads:[~2011-05-17 15:28 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-16 19:34 [PATCH V5 4/6 net-next] vhost: vhost TX zero-copy support Shirley Ma
2011-05-16 20:45 ` Michael S. Tsirkin
2011-05-16 20:56   ` Shirley Ma
2011-05-16 21:24     ` Michael S. Tsirkin
2011-05-16 21:30       ` Shirley Ma
2011-05-17  4:31       ` Shirley Ma
2011-05-17  5:55         ` Michael S. Tsirkin
2011-05-17 15:22           ` Shirley Ma
2011-05-17 15:28             ` Michael S. Tsirkin [this message]
2011-05-17 15:34               ` Shirley Ma
2011-05-17 20:46                 ` [TEST PATCH net-next] vhost: accumulate multiple used and sigal in vhost TX test Shirley Ma
2011-05-17 20:52                   ` Michael S. Tsirkin
2011-05-17 20:50                 ` [PATCH V5 4/6 net-next] vhost: vhost TX zero-copy support Shirley Ma
2011-05-17 20:58                   ` Michael S. Tsirkin
2011-05-17 21:01                     ` Shirley Ma
2011-05-17 21:28                   ` Michael S. Tsirkin
2011-05-17 22:21                     ` Shirley Ma
2011-05-18  5:14                     ` Shirley Ma
2011-05-18  6:16                       ` [PATCH V6 " Shirley Ma
2011-05-18  8:43                         ` Michael S. Tsirkin
2011-05-18  8:32                       ` [PATCH V5 " Michael S. Tsirkin
2011-05-18  8:45                       ` Michael S. Tsirkin
2011-05-16 21:27     ` 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=20110517152840.GA2389@redhat.com \
    --to=mst@redhat.com \
    --cc=arnd@arndb.de \
    --cc=avi@redhat.com \
    --cc=davem@davemloft.net \
    --cc=eric.dumazet@gmail.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mashirle@us.ibm.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).