Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
vhost: add reconnection support to VDUSE
This patch enables VDUSE reconnection support making use of the newly introduced reconnection mechanism in Vhost library. At DPDK VDUSE device creation time, there are two possibilities: 1. The Kernel VDUSE device does not exist: a. A reconnection file named after the VDUSE device name is created in VDUSE tmpfs. b. The file is truncated to 'struct vhost_reconnect_data' size, and mmapped. c. Negotiated features, Virtio status... are saved for sanity checks at reconnect time. 2. The Kernel VDUSE device already exists: a. Exit with failure if no reconnect file exists for this device. b. Open and mmap the reconnect file. c. Perform sanity check to ensure features are compatible. d. Restore virtqueues' available indexes at startup time. Then at runtime, the virtqueues' available index are logged by the Vhost reconnection mechanism. At DPDK VDUSE device destruction time, there are two possibilities: 1. The Kernel VDUSE device destruction succeeded, which means it is no more attached to the vDPA bus. The reconnection file is unmapped and then removed. 2. The Kernel VDUSE device destruction failed, meaning it is no more attached to the vDPA bus. The reconnection file is unmapped but not removed to make possible later reconnection. Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com> Reviewed-by: Chenbo Xia <chenbox@nvidia.com> Reviewed-by: David Marchand <david.marchand@redhat.com>
- Loading branch information