Skip to content

Usernet poc#5859

Draft
aerosouund wants to merge 6 commits into
firecracker-microvm:mainfrom
aerosouund:usernet-poc
Draft

Usernet poc#5859
aerosouund wants to merge 6 commits into
firecracker-microvm:mainfrom
aerosouund:usernet-poc

Conversation

@aerosouund
Copy link
Copy Markdown
Contributor

Changes

...

Reason

Related issue: #5816

License Acceptance

By submitting this pull request, I confirm that my contribution is made under
the terms of the Apache 2.0 license. For more information on following Developer
Certificate of Origin and signing off your commits, please check
CONTRIBUTING.md.

PR Checklist

  • I have read and understand CONTRIBUTING.md.
  • I have run tools/devtool checkbuild --all to verify that the PR passes
    build checks on all supported architectures.
  • I have run tools/devtool checkstyle to verify that the PR passes the
    automated style checks.
  • I have described what is done in these changes, why they are needed, and
    how they are solving the problem in a clear and encompassing way.
  • I have updated any relevant documentation (both in code and in the docs)
    in the PR.
  • I have mentioned all user-facing changes in CHANGELOG.md.
  • If a specific issue led to this PR, this PR closes the issue.
  • When making API changes, I have followed the
    Runbook for Firecracker API changes.
  • I have tested all new and changed functionalities in unit tests and/or
    integration tests.
  • I have linked an issue to every new TODO.

  • This functionality cannot be added in rust-vmm.

@aerosouund aerosouund force-pushed the usernet-poc branch 2 times, most recently from 6d2cead to 27b725a Compare May 10, 2026 12:24
- A passt backend is just a stream socket identified by a path. Given a
  string that represents this path, use UnixStream::connect to connect
  to it.
- Implement read_iovec and write_iovec with handling all the necessary
  edge cases that passt introduces (vnet header, the 32 bit length
  before the ethernet header).
- Add an identifier function that returns the path of this socket.

Signed-off-by: aerosouund <aerosound161@gmail.com>
- this enum has two variants, Passt and Tap. which represents an OS
  backend that is one of those types
- the enum implements as_raw_fd, read_iovec, write_iovec, identifier
  and just forwards them to the inner backend
- add an identifier function for the Tap type that returns the interface
  name as string

Signed-off-by: aerosouund <aerosound161@gmail.com>
- The net device has a field called tap of type Tap, replace that with a
  generic field called backend of type NetdevBackend.
- Create the NetDevBackendType enum to hold the config for a tap or a
  passt backend. Both variants carry a string representing the socket
  path for passt, and the interface name for tap.
- Advertise different virtio features based on the backend type as passt
  doesn't support all the features a tap interface supports.

Signed-off-by: aerosouund <aerosound161@gmail.com>
- Rename the tap_if_name field to backend_identifier to make it more
  generic.
- Add the backend_type field of type NetDevBackendType to the NetState.
- Use those fields in restoration and snapshotting functions.
- Add a backend_type field on the NetworkInterfaceConfig type.

Signed-off-by: aerosouund <aerosound161@gmail.com>
- Make the TapTrafficSimulator take a NetDevBackend rather than a
  tap_index and make it call if_index internally if the device passed
  is a tap, panic otherwise.
- Make the enable function take the bytes representing the tap name
  since this is all it needs from the Tap struct.

Signed-off-by: aerosouund <aerosound161@gmail.com>
- Add the backend_type field where applicable.
- Pass the netdevice backend to TapTrafficSimulator::new rather than the
  interface index.

Signed-off-by: aerosouund <aerosound161@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