diff options
author | Kangjie Xu | 2022-10-17 11:25:53 +0200 |
---|---|---|
committer | Michael S. Tsirkin | 2022-11-07 19:12:20 +0100 |
commit | 10f8a115a862045a836932c5d519a848dda5d461 (patch) | |
tree | 82632dc9d16738f6e0f9beed0a932d59025532cc /include | |
parent | vhost-net: vhost-kernel: introduce vhost_net_virtqueue_reset() (diff) | |
download | qemu-10f8a115a862045a836932c5d519a848dda5d461.tar.gz qemu-10f8a115a862045a836932c5d519a848dda5d461.tar.xz qemu-10f8a115a862045a836932c5d519a848dda5d461.zip |
vhost-net: vhost-kernel: introduce vhost_net_virtqueue_restart()
Introduce vhost_net_virtqueue_restart(), which can restart the
specific virtqueue when the vhost net started running before.
If it fails to restart the virtqueue, the device will be stopped.
Here we do not reuse vhost_net_start_one() or vhost_dev_start()
because they work at queue pair level. The mem table and features
do not change, so we can call the vhost_virtqueue_start() to
restart a specific queue.
This patch only considers the case of vhost-kernel, when
NetClientDriver is NET_CLIENT_DRIVER_TAP.
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-11-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')
-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 85d85a4957..40b9a40074 100644 --- a/include/net/vhost_net.h +++ b/include/net/vhost_net.h @@ -50,4 +50,6 @@ int vhost_net_set_mtu(struct vhost_net *net, uint16_t mtu); void vhost_net_virtqueue_reset(VirtIODevice *vdev, NetClientState *nc, int vq_index); +int vhost_net_virtqueue_restart(VirtIODevice *vdev, NetClientState *nc, + int vq_index); #endif |