]> git.ipfire.org Git - thirdparty/qemu.git/commit
vhost-net: vhost-kernel: introduce vhost_net_virtqueue_reset()
authorKangjie Xu <kangjie.xu@linux.alibaba.com>
Mon, 17 Oct 2022 09:25:52 +0000 (17:25 +0800)
committerMichael S. Tsirkin <mst@redhat.com>
Mon, 7 Nov 2022 18:12:20 +0000 (13:12 -0500)
commitc2daa08e1713c4799487bae6daf5d41e024ff736
treeb5a6e864f941c6575a1baaffea60ef9d73ec0b85
parente1f101d9f60c81b5186098b6dfd196b2730f2070
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>
hw/net/vhost_net-stub.c
hw/net/vhost_net.c
include/net/vhost_net.h