[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 5/6] virtio-net: vhost-user: update queue_reset and queue_enab
From: |
Kangjie Xu |
Subject: |
[PATCH v2 5/6] virtio-net: vhost-user: update queue_reset and queue_enable |
Date: |
Mon, 12 Sep 2022 11:10:48 +0800 |
Update virtio_net_queue_reset() and virtio_net_queue_enable()
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/virtio-net.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c
index 6ab796b399..19a2132180 100644
--- a/hw/net/virtio-net.c
+++ b/hw/net/virtio-net.c
@@ -550,7 +550,8 @@ static void virtio_net_queue_reset(VirtIODevice *vdev,
uint32_t queue_index)
}
if (get_vhost_net(nc->peer) &&
- nc->peer->info->type == NET_CLIENT_DRIVER_TAP) {
+ (nc->peer->info->type == NET_CLIENT_DRIVER_TAP ||
+ nc->peer->info->type == NET_CLIENT_DRIVER_VHOST_USER)) {
vhost_net_virtqueue_reset(vdev, nc, queue_index);
}
@@ -568,7 +569,8 @@ static void virtio_net_queue_enable(VirtIODevice *vdev,
uint32_t queue_index)
}
if (get_vhost_net(nc->peer) &&
- nc->peer->info->type == NET_CLIENT_DRIVER_TAP) {
+ (nc->peer->info->type == NET_CLIENT_DRIVER_TAP ||
+ nc->peer->info->type == NET_CLIENT_DRIVER_VHOST_USER)) {
r = vhost_net_virtqueue_restart(vdev, nc, queue_index);
if (r < 0) {
error_report("unable to restart vhost net virtqueue: %d, "
--
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 <=
- [PATCH v2 4/6] vhost-net: vhost-user: update vhost_net_virtqueue_restart(), Kangjie Xu, 2022/09/11
- [PATCH v2 3/6] vhost-net: vhost-user: update vhost_net_virtqueue_reset(), Kangjie Xu, 2022/09/11