Conversation
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.
This PR supersedes #709.
Review
In older versions of penguin we worked with network devices by listing them in interfaces and handling their interactions at the syscall layer when possible (e.g. ioctl).
Further, we used /proc/penguin_net and a series of shell scripts to set up dummy devices and run them.
New system
In our new system by default we want to express the same behavior. If you list interfaces and handle ioctl interactions it will all work just fine. The default code acts very similar to the original dummy interface we have for the older devices.
However, you now have a new path for defining much more complex network devices in Python outside the guest.
You may asynchronously register network devices with a backing class using the net interface:
There is no requirement that the interface be listed in the network interfaces in the config, but listing it doesn't hurt anything.
There is a
Netdevclass defined in net.py which you should use for your backing class.Backing classes can modify the core
net_devicestructure and set up operations in thesetupmethod of the class. https://elixir.bootlin.com/linux/v6.19.10/source/include/linux/netdevice.h#L1788We also have functionality to look through the
net_devicestructure and automatically determine possible names/functions mapping from these devices. However, I think a simpler path here might be to provide the names of functions that will be auto-added to the structure if the correct name is added, but I'm open to suggestions.