Skip to content

Draft: feat(uffd): update backend protocol - #2001

Draft
joy-allen wants to merge 1 commit into
dragonflyoss:v3from
joy-allen:feat/uffd
Draft

Draft: feat(uffd): update backend protocol#2001
joy-allen wants to merge 1 commit into
dragonflyoss:v3from
joy-allen:feat/uffd

Conversation

@joy-allen

Copy link
Copy Markdown
Contributor

Update the UFFD backend protocol to align with protocol discussed at cloud-hypervisor/cloud-hypervisor#8554

Overview

This PR updates the UFFD socket protocol framing and handshake format. It adds
support for the new handshake flags, UFFD modes, region metadata, managed fault
handling, and optional handshake acknowledgements.

Related Issues

N/A

Change Details

  • Align request and response headers with the client protocol.
  • Add the MANAGED, PREFAULT, ACK_REQUIRED, and BACKING_FDS handshake
    flags.
  • Preserve handshake flags in the protocol layer and interpret them in the
    service layer.
  • Add UFFD mode definitions.
  • Extend region metadata with backing_offset.
  • Handle managed faults through UFFDIO_COPY and UFFDIO_ZEROPAGE.
  • Return FD ranges for customized client-side zero-copy processing.
  • Send an empty Legacy response when ACK_REQUIRED is set.
  • Accept optional backing FDs and close them when they are unused by Nydus.
  • Ignore extensible fields that Nydus does not currently use.
  • Keep FETCH_LEGACY, ADD_REGION, and REMOVE_REGION unsupported.
  • Update the UFFD protocol documentation.
  • Add and update protocol encoding and decoding tests.

Test Results

  • cargo fmt --all: passed.
  • cargo fmt --all -- --check: passed.

Change Type

  • Bug Fix
  • Feature Addition
  • Documentation Update
  • Code Refactoring
  • Performance Improvement
  • Other (please describe)

Self-Checklist

  • I have run a code style check and addressed any warnings/errors.
    • Formatting passed; Clippy is blocked by unrelated existing platform
      warnings.
  • I have added appropriate comments to my code (if applicable).
  • I have updated the documentation (if applicable).
  • I have written appropriate unit tests.

Update handshake flags, UFFD modes, and region metadata. Handle
managed faults and acknowledgements. Accept and close unused
backing FDs.

Signed-off-by: Zhiheng Tao <persisttao@gmail.com>
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.

1 participant