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 /include/net/vhost_net.h | |
| parent | e1f101d9f60c81b5186098b6dfd196b2730f2070 (diff) | |
| download | focaccia-qemu-c2daa08e1713c4799487bae6daf5d41e024ff736.tar.gz focaccia-qemu-c2daa08e1713c4799487bae6daf5d41e024ff736.zip | |
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 'include/net/vhost_net.h')
| -rw-r--r-- | include/net/vhost_net.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/include/net/vhost_net.h b/include/net/vhost_net.h index 387e913e4e..85d85a4957 100644 --- a/include/net/vhost_net.h +++ b/include/net/vhost_net.h @@ -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 |