From patchwork Tue Feb 28 13:26:20 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: bugzilla@dpdk.org X-Patchwork-Id: 124571 X-Patchwork-Delegate: maxime.coquelin@redhat.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 16C3941D9D; Tue, 28 Feb 2023 14:26:21 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 09629410D4; Tue, 28 Feb 2023 14:26:21 +0100 (CET) Received: from inbox.dpdk.org (inbox.dpdk.org [95.142.172.178]) by mails.dpdk.org (Postfix) with ESMTP id 0E88E4021F for ; Tue, 28 Feb 2023 14:26:20 +0100 (CET) Received: by inbox.dpdk.org (Postfix, from userid 33) id 0787541D9E; Tue, 28 Feb 2023 14:26:20 +0100 (CET) From: bugzilla@dpdk.org To: dev@dpdk.org Subject: [Bug 1169] [vhost]VDPA example is aborting when VM starts Date: Tue, 28 Feb 2023 13:26:20 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: DPDK X-Bugzilla-Component: vhost/virtio X-Bugzilla-Version: 23.03 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: ssimma@nvidia.com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: Normal X-Bugzilla-Assigned-To: dev@dpdk.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: X-Bugzilla-URL: http://bugs.dpdk.org/ Auto-Submitted: auto-generated X-Auto-Response-Suppress: All MIME-Version: 1.0 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org https://bugs.dpdk.org/show_bug.cgi?id=1169 Bug ID: 1169 Summary: [vhost]VDPA example is aborting when VM starts Product: DPDK Version: 23.03 Hardware: All OS: All Status: UNCONFIRMED Severity: normal Priority: Normal Component: vhost/virtio Assignee: dev@dpdk.org Reporter: ssimma@nvidia.com Target Milestone: --- We believe that issue was caused by the following change: 4b02c2673757 ("vhost: annotate async accesses") return RTE_VHOST_MSG_RESULT_OK; } 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;