Skip to content

Commit

Permalink
vhost: add reconnection support to VDUSE
Browse files Browse the repository at this point in the history
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
mcoquelin committed Sep 24, 2024
1 parent 65e07ad commit 2823a08
Showing 1 changed file with 268 additions and 40 deletions.
Loading

0 comments on commit 2823a08

Please sign in to comment.