[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 7/8] virtio-net: vhost-user: update queue_reset and queue_enable
From: |
Kangjie Xu |
Subject: |
[PATCH 7/8] virtio-net: vhost-user: update queue_reset and queue_enable |
Date: |
Fri, 26 Aug 2022 18:56:19 +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 0/8] Support VIRTIO_F_RING_RESET for vhost-user in virtio pci-modern, Kangjie Xu, 2022/08/26
- [PATCH 2/8] net: virtio: rename vhost_set_vring_enable to vhost_set_dev_enable, Kangjie Xu, 2022/08/26
- [PATCH 7/8] virtio-net: vhost-user: update queue_reset and queue_enable,
Kangjie Xu <=
- [PATCH 4/8] vhost-user: introduce vhost_reset_vring() interface, Kangjie Xu, 2022/08/26
- [PATCH 3/8] vhost-user: add op to enable or disable a single vring, Kangjie Xu, 2022/08/26
- [PATCH 1/8] docs: vhost-user: add VHOST_USER_RESET_VRING message, Kangjie Xu, 2022/08/26
- [PATCH 8/8] vhost: vhost-user: enable vq reset feature, Kangjie Xu, 2022/08/26
- [PATCH 5/8] vhost-net: vhost-user: update vhost_net_virtqueue_reset(), Kangjie Xu, 2022/08/26
- [PATCH 6/8] vhost-net: vhost-user: update vhost_net_virtqueue_restart(), Kangjie Xu, 2022/08/26