Usernet poc#5859
Draft
aerosouund wants to merge 6 commits into
Draft
Conversation
6d2cead to
27b725a
Compare
- 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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
tools/devtool checkbuild --allto verify that the PR passesbuild checks on all supported architectures.
tools/devtool checkstyleto verify that the PR passes theautomated style checks.
how they are solving the problem in a clear and encompassing way.
in the PR.
CHANGELOG.md.Runbook for Firecracker API changes.
integration tests.
TODO.rust-vmm.