mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-07-28 21:03:54 -06:00
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>
This commit is contained in:
parent
e1f101d9f6
commit
c2daa08e17
3 changed files with 33 additions and 0 deletions
|
@ -48,4 +48,6 @@ uint64_t vhost_net_get_acked_features(VHostNetState *net);
|
|||
|
||||
int vhost_net_set_mtu(struct vhost_net *net, uint16_t mtu);
|
||||
|
||||
void vhost_net_virtqueue_reset(VirtIODevice *vdev, NetClientState *nc,
|
||||
int vq_index);
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue