qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH v2 19/24] vhost-net: vhost-user: update vhost_net_virtqueue_resta


From: Kangjie Xu
Subject: [PATCH v2 19/24] vhost-net: vhost-user: update vhost_net_virtqueue_restart()
Date: Tue, 16 Aug 2022 09:06:31 +0800

Update vhost_net_virtqueue_restart() for vhost-user scenario.

Signed-off-by: Kangjie Xu <kangjie.xu@linux.alibaba.com>
Signed-off-by: Xuan Zhuo <xuanzhuo@linux.alibaba.com>
---
 hw/net/vhost_net.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/hw/net/vhost_net.c b/hw/net/vhost_net.c
index c0d408f3b4..778081e54a 100644
--- a/hw/net/vhost_net.c
+++ b/hw/net/vhost_net.c
@@ -556,6 +556,10 @@ int vhost_net_virtqueue_restart(VirtIODevice *vdev, 
NetClientState *nc,
 
     idx =  vhost_ops->vhost_get_vq_index(&net->dev, vq_index);
 
+    if (net->nc->info->type == NET_CLIENT_DRIVER_VHOST_USER) {
+        idx = idx - net->dev.vq_index;
+    }
+
     r = vhost_dev_virtqueue_restart(&net->dev, vdev, idx);
     if (r < 0) {
         goto err_start;
-- 
2.32.0




reply via email to

[Prev in Thread] Current Thread [Next in Thread]