virtualization.lists.linux-foundation.org archive mirror
 help / color / mirror / Atom feed
From: "Michael S. Tsirkin" <mst@redhat.com>
To: Christian Ehrhardt <christian.ehrhardt@canonical.com>
Cc: Thomas Monjalon <thomas.monjalon@6wind.com>,
	virtualization@lists.linux-foundation.org
Subject: Re: Potential hang in virtnet_send_command
Date: Mon, 18 Apr 2016 20:24:56 +0300	[thread overview]
Message-ID: <20160418202315-mutt-send-email-mst@redhat.com> (raw)
In-Reply-To: <CAATJJ0JF7-ApjMO+XtsVgD8rU6WTCK28vTjmG-Aww-ASHw4cBQ@mail.gmail.com>

On Mon, Apr 18, 2016 at 07:07:32PM +0200, Christian Ehrhardt wrote:
> Hi,
> I was debugging an issue caused by a bad usage of dpdk.
> That is fixed in the meantime and I'll backport that into our code as well.
> 
> But along debugging that, I found a potential hang in virtnet_send_command that
> my case ran into.
> The following code can become an infinite loop:
> /* Spin for a response, the kick causes an ioport write, trapping
>  * into the hypervisor, so the request should be handled immediately.
>  */   
> while (!virtqueue_get_buf(vi->cvq, &tmp) &&   
>        !virtqueue_is_broken(vi->cvq))   
>         cpu_relax();
> 
> In my case dpdk broke something - not exactly clear what - and due to that
> following calls through virtnet_send_command ran into this hang.
> Effectively it seems that the buffers didn't get refreshed at all anymore.
> 
> That said the dpdk issue to touch devices that belong to a kernel owned driver
> is fixed, so one could leave the code as is for now.
> Yet I wanted to make you aware in case you would vote for a time or retry based
> upper limit on that loop to avoid hangs - who knows what else might bring it in
> this broken state in a different case.
> 
> Kind Regards,
> Christian Ehrhardt
> 
> P.S.
> Steps to reproduce, backtraces and more data can be found in:
> https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1570195
> A general setup howto for DPDK in KVM guests which is a prereq is at:
> https://help.ubuntu.com/16.04/serverguide/DPDK.html#dpdk-in-guest

True. It's not that clear how to handle this cleanly though.
Ideally we'd have to transmit the next command once the
previous one completes.

-- 
MST

      reply	other threads:[~2016-04-18 17:24 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-18 17:07 Potential hang in virtnet_send_command Christian Ehrhardt
2016-04-18 17:24 ` Michael S. Tsirkin [this message]

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=20160418202315-mutt-send-email-mst@redhat.com \
    --to=mst@redhat.com \
    --cc=christian.ehrhardt@canonical.com \
    --cc=thomas.monjalon@6wind.com \
    --cc=virtualization@lists.linux-foundation.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).