All of lore.kernel.org
 help / color / mirror / Atom feed
From: Maxime Coquelin <maxime.coquelin@redhat.com>
To: Greg Kurz <groug@kaod.org>, qemu-devel@nongnu.org
Cc: Stefan Hajnoczi <stefanha@redhat.com>,
	"Dr. David Alan Gilbert" <dgilbert@redhat.com>,
	Laurent Vivier <lvivier@redhat.com>,
	"Michael S. Tsirkin" <mst@redhat.com>,
	Yajun Wu <yajunw@nvidia.com>,
	Peter Maydell <peter.maydell@linaro.org>,
	Parav Pandit <parav@nvidia.com>,
	qemu-stable@nongnu.org, Yanghang Liu <yanghliu@redhat.com>
Subject: Re: [PATCH 1/2] Revert "vhost-user: Monitor slave channel in vhost_user_read()"
Date: Fri, 20 Jan 2023 16:03:22 +0100	[thread overview]
Message-ID: <e0724813-3402-69fe-25b0-6d3b0b6ca63c@redhat.com> (raw)
In-Reply-To: <20230119172424.478268-2-groug@kaod.org>



On 1/19/23 18:24, Greg Kurz wrote:
> This reverts commit db8a3772e300c1a656331a92da0785d81667dc81.
> 
> Motivation : this is breaking vhost-user with DPDK as reported in [0].
> 
> Received unexpected msg type. Expected 22 received 40
> Fail to update device iotlb
> Received unexpected msg type. Expected 40 received 22
> Received unexpected msg type. Expected 22 received 11
> Fail to update device iotlb
> Received unexpected msg type. Expected 11 received 22
> vhost VQ 1 ring restore failed: -71: Protocol error (71)
> Received unexpected msg type. Expected 22 received 11
> Fail to update device iotlb
> Received unexpected msg type. Expected 11 received 22
> vhost VQ 0 ring restore failed: -71: Protocol error (71)
> unable to start vhost net: 71: falling back on userspace virtio
> 
> The failing sequence that leads to the first error is :
> - QEMU sends a VHOST_USER_GET_STATUS (40) request to DPDK on the master
>    socket
> - QEMU starts a nested event loop in order to wait for the
>    VHOST_USER_GET_STATUS response and to be able to process messages from
>    the slave channel
> - DPDK sends a couple of legitimate IOTLB miss messages on the slave
>    channel
> - QEMU processes each IOTLB request and sends VHOST_USER_IOTLB_MSG (22)
>    updates on the master socket
> - QEMU assumes to receive a response for the latest VHOST_USER_IOTLB_MSG
>    but it gets the response for the VHOST_USER_GET_STATUS instead
> 
> The subsequent errors have the same root cause : the nested event loop
> breaks the order by design. It lures QEMU to expect responses to the
> latest message sent on the master socket to arrive first.
> 
> Since this was only needed for DAX enablement which is still not merged
> upstream, just drop the code for now. A working solution will have to
> be merged later on. Likely protect the master socket with a mutex
> and service the slave channel with a separate thread, as discussed with
> Maxime in the mail thread below.
> 
> [0] https://lore.kernel.org/qemu-devel/43145ede-89dc-280e-b953-6a2b436de395@redhat.com/
> 
> Reported-by: Yanghang Liu <yanghliu@redhat.com>
> Buglink: https://bugzilla.redhat.com/show_bug.cgi?id=2155173
> Signed-off-by: Greg Kurz <groug@kaod.org>
> ---
>   hw/virtio/vhost-user.c | 35 +++--------------------------------
>   1 file changed, 3 insertions(+), 32 deletions(-)
> 

Acked-by: Maxime Coquelin <maxime.coquelin@redhat.com>

Thanks,
Maxime



  parent reply	other threads:[~2023-01-20 15:04 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-19 17:24 [PATCH 0/2] vhost-user: Remove the nested event loop to unbreak the DPDK use case Greg Kurz
2023-01-19 17:24 ` [PATCH 1/2] Revert "vhost-user: Monitor slave channel in vhost_user_read()" Greg Kurz
2023-01-19 18:39   ` Greg Kurz
2023-01-19 21:10   ` Stefan Hajnoczi
2023-01-20 15:03   ` Maxime Coquelin [this message]
2023-01-19 17:24 ` [PATCH 2/2] Revert "vhost-user: Introduce nested event loop " Greg Kurz
2023-01-20 15:13   ` Maxime Coquelin
2023-01-23  8:21 ` [PATCH 0/2] vhost-user: Remove the nested event loop to unbreak the DPDK use case Greg Kurz

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=e0724813-3402-69fe-25b0-6d3b0b6ca63c@redhat.com \
    --to=maxime.coquelin@redhat.com \
    --cc=dgilbert@redhat.com \
    --cc=groug@kaod.org \
    --cc=lvivier@redhat.com \
    --cc=mst@redhat.com \
    --cc=parav@nvidia.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-stable@nongnu.org \
    --cc=stefanha@redhat.com \
    --cc=yajunw@nvidia.com \
    --cc=yanghliu@redhat.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 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.