Skip to content

Conversation

@SvenGroot
Copy link
Member

This change makes some improvements to how revoke (particularly while terminating) and restore are handled for proxy driver channels. These are mainly aimed at situations where the proxy driver may maintain state for some open channels in between save/restore, though they should improve the general reliability as well.

  • When the proxy task is being cancelled, only "next action" ioctls are aborted/prevented from issuing. All other ioctls are still allowed, so that state changes are fully propagated to the driver until the server terminates. It's now also possible to wait for proxy task completion.
  • When the proxy driver revokes a channel, that is now handled inline using ChannelServerRequest::Revoke, so we can wait for its completion and immediately release the channel to the driver.
  • Restoring a channel and its associated gpadls is now done in a single ioctl, to make it easier for the driver to distinguish restored gpadls from new ones, in case it had preserved the gpadl state for a channel.

When making these changes, I fixed a few other omissions in the restore path:

  • All states that the driver should consider as a channel being open on restore are now properly handled.
  • The proxy task will no longer mark a channel as restored if the device specified the "force new channel" flag.
  • When saved in the disconnected state, properly restore any saved reserved channels.
  • I also refactored how SavedState is used (within the confines of not being able to change its layout for compatibility), so Rust's type system can hopefully guide us into considering both connected and disconnected states in the future.

@SvenGroot SvenGroot requested review from a team as code owners June 5, 2025 01:22
@SvenGroot SvenGroot changed the title vmbus_server: improve revoke and restore flows for proxy server. vmbus_server: improve revoke and restore flows for proxy driver channels. Jun 5, 2025
@github-actions
Copy link

github-actions bot commented Jun 5, 2025

@SvenGroot SvenGroot force-pushed the vmbus/proxy_vmphu branch from 046d43a to 4dfffb0 Compare June 9, 2025 17:40
@SvenGroot SvenGroot force-pushed the vmbus/proxy_vmphu branch from 4dfffb0 to 1d2efac Compare June 9, 2025 18:37
Copy link
Contributor

@will-j-wright will-j-wright left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, I like the SavedStateData idea. A lot nicer than just randomly pub-ing fields :)

Copy link
Member

@benhillis benhillis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@SvenGroot SvenGroot merged commit d038b56 into microsoft:main Jun 10, 2025
28 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants