diff options
author | Kangjie Xu <kangjie.xu@linux.alibaba.com> | 2022-10-17 17:25:52 +0800 |
---|---|---|
committer | Michael S. Tsirkin <mst@redhat.com> | 2022-11-07 13:12:20 -0500 |
commit | c2daa08e1713c4799487bae6daf5d41e024ff736 (patch) | |
tree | b5a6e864f941c6575a1baaffea60ef9d73ec0b85 /hw/net/vhost_net-stub.c | |
parent | e1f101d9f60c81b5186098b6dfd196b2730f2070 (diff) | |
download | qemu-c2daa08e1713c4799487bae6daf5d41e024ff736.zip qemu-c2daa08e1713c4799487bae6daf5d41e024ff736.tar.gz qemu-c2daa08e1713c4799487bae6daf5d41e024ff736.tar.bz2 |
vhost-net: vhost-kernel: introduce vhost_net_virtqueue_reset()
Introduce vhost_virtqueue_reset(), which can reset the specific
virtqueue in the device. Then it will unmap vrings and the desc
of the virtqueue.
Here we do not reuse the vhost_net_stop_one() or vhost_dev_stop(),
because they work at queue pair level. We do not use
vhost_virtqueue_stop() because it may stop the device in the
backend.
This patch only considers the case of vhost-kernel, when
NetClientDriver is NET_CLIENT_DRIVER_TAP.
Furthermore, we do not need net->nc->info->poll() because
it enables userspace datapath and we want to stop all
datapaths for this reset virtqueue here.
Signed-off-by: Kangjie Xu <kangjie.xu@linux.alibaba.com>
Signed-off-by: Xuan Zhuo <xuanzhuo@linux.alibaba.com>
Acked-by: Jason Wang <jasowang@redhat.com>
Message-Id: <20221017092558.111082-10-xuanzhuo@linux.alibaba.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'hw/net/vhost_net-stub.c')
-rw-r--r-- | hw/net/vhost_net-stub.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/hw/net/vhost_net-stub.c b/hw/net/vhost_net-stub.c index 89d71cf..2d745e3 100644 --- a/hw/net/vhost_net-stub.c +++ b/hw/net/vhost_net-stub.c @@ -101,3 +101,9 @@ int vhost_net_set_mtu(struct vhost_net *net, uint16_t mtu) { return 0; } + +void vhost_net_virtqueue_reset(VirtIODevice *vdev, NetClientState *nc, + int vq_index) +{ + +} |