[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 4/6] vhost-net: vhost-user: update vhost_net_virtqueue_restart
From: |
Kangjie Xu |
Subject: |
[PATCH v2 4/6] vhost-net: vhost-user: update vhost_net_virtqueue_restart() |
Date: |
Mon, 12 Sep 2022 11:10:47 +0800 |
Update vhost_net_virtqueue_restart() for vhost-user scenario.
In order to reuse some functions, we process the idx for
vhost-user case. It is because vhost_get_vq_index behave
differently in vhost-user.
Signed-off-by: Kangjie Xu <kangjie.xu@linux.alibaba.com>
Signed-off-by: Xuan Zhuo <xuanzhuo@linux.alibaba.com>
---
hw/net/vhost_net.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/hw/net/vhost_net.c b/hw/net/vhost_net.c
index 25e5665489..8b80942e7c 100644
--- a/hw/net/vhost_net.c
+++ b/hw/net/vhost_net.c
@@ -577,6 +577,9 @@ int vhost_net_virtqueue_restart(VirtIODevice *vdev,
NetClientState *nc,
assert(vhost_ops);
idx = vhost_ops->vhost_get_vq_index(&net->dev, vq_index);
+ if (net->nc->info->type == NET_CLIENT_DRIVER_VHOST_USER) {
+ idx -= net->dev.vq_index;
+ }
r = vhost_virtqueue_start(&net->dev,
vdev,
--
2.32.0
- [PATCH v2 0/6] Support VIRTIO_F_RING_RESET for vhost-user in virtio pci-modern, Kangjie Xu, 2022/09/11
- [PATCH v2 6/6] vhost: vhost-user: enable vq reset feature, Kangjie Xu, 2022/09/11
- [PATCH v2 1/6] net: virtio: rename vhost_set_vring_enable to vhost_set_dev_enable, Kangjie Xu, 2022/09/11
- [PATCH v2 2/6] vhost-user: add op to enable or disable a single vring, Kangjie Xu, 2022/09/11
- [PATCH v2 5/6] virtio-net: vhost-user: update queue_reset and queue_enable, Kangjie Xu, 2022/09/11
- [PATCH v2 4/6] vhost-net: vhost-user: update vhost_net_virtqueue_restart(),
Kangjie Xu <=
- [PATCH v2 3/6] vhost-net: vhost-user: update vhost_net_virtqueue_reset(), Kangjie Xu, 2022/09/11