<html>
    <head>
      <base href="https://bugs.dpdk.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8" class="bz_new_table">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_UNCONFIRMED "
   title="UNCONFIRMED - [vhost]VDPA example is aborting when VM starts"
   href="https://bugs.dpdk.org/show_bug.cgi?id=1169">1169</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>[vhost]VDPA example is aborting when VM starts
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>DPDK
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>23.03
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>UNCONFIRMED
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>Normal
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>vhost/virtio
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>dev@dpdk.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>ssimma@nvidia.com
          </td>
        </tr>

        <tr>
          <th>Target Milestone</th>
          <td>---
          </td>
        </tr></table>
      <p>
        <div class="bz_comment_block">
          <pre class="bz_comment_text">We believe that issue was caused by the following change:
4b02c2673757 ("vhost: annotate async accesses") 

diff --git a/lib/vhost/vhost_user.c b/lib/vhost/vhost_user.c
index 70d221b9f6..8c1d60b76b 100644
--- a/lib/vhost/vhost_user.c
+++ b/lib/vhost/vhost_user.c
@@ -2168,6 +2168,7 @@ vhost_user_set_vring_enable(struct virtio_net **pdev,
                        int main_fd __rte_unused)
{
        struct virtio_net *dev = *pdev;
+       struct vhost_virtqueue *vq;
        bool enable = !!ctx->msg.payload.state.num;
        int index = (int)ctx->msg.payload.state.index;

@@ -2175,15 +2176,18 @@ vhost_user_set_vring_enable(struct virtio_net **pdev,
                "set queue enable: %d to qp idx: %d\n",
                enable, index);

-       if (enable && dev->virtqueue[index]->async) {
-               if (dev->virtqueue[index]->async->pkts_inflight_n) {
+       vq = dev->virtqueue[index];
+       /* vhost_user_lock_all_queue_pairs locked all qps */
+       vq_assert_lock(dev, vq);                                       # this
assert fired
+       if (enable && vq->async) {
+               if (vq->async->pkts_inflight_n) {
                        VHOST_LOG_CONFIG(dev->ifname, ERR,
                                "failed to enable vring. Inflight packets must
be completed first\n");
                        return RTE_VHOST_MSG_RESULT_ERR;
                }
        }

-       dev->virtqueue[index]->enabled = enable;
+       vq->enabled = enable;

        return RTE_VHOST_MSG_RESULT_OK;
}
          </pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
      <div itemscope itemtype="http://schema.org/EmailMessage">
        <div itemprop="action" itemscope itemtype="http://schema.org/ViewAction">
          
          <link itemprop="url" href="https://bugs.dpdk.org/show_bug.cgi?id=1169">
          <meta itemprop="name" content="View bug">
        </div>
        <meta itemprop="description" content="Bugzilla bug update notification">
      </div>
    </body>
</html>