On Fri, Sep 20, 2024 at 11:09 AM Maxime Coquelin <maxime.coque...@redhat.com> wrote: > > 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 VUDSE device name
VDUSE* > 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 succeed, which succeeded* > 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.coque...@redhat.com> Reviewed-by: David Marchand <david.march...@redhat.com> -- David Marchand