-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Integration with krunkit #24
Merged
Conversation
This file contains 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
45cad1b
to
dcfd375
Compare
6ae77b7
to
2c88d5b
Compare
7ad9692
to
588946b
Compare
Trying to stabilize the qemu integration job, failing randomly.
The vment framework supports partly documented options to enable TCP segmentation offload (TSO) and checksum offload. Enabling the offload options typically decreases performance but we must enable them to integrate with krunkit, which does not have a way to disable the offloading. /* * @constant vmnet_enable_tso_key * Enable TCP segmentation offload. Note, when this is enabled, the * interface may generate large (64K) TCP frames. It must also * be prepared to accept large TCP frames as well. */ /* * @constant vmnet_enable_checksum_offload_key * Enable checksum offload for this interface. The checksums that are * offloaded are: IPv4 header checksum, UDP checksum (IPv4 and IPv6), * and TCP checksum (IPv4 and IPv6). * * In order to perform the offload function, all packets flowing in and * out of the vmnet_interface instance are verified to pass basic * IPv4, IPv6, UDP, and TCP sanity checks. A packet that fails any * of these checks is simply dropped. * * On output, checksums are automatically computed as necessary * on each packet sent using vmnet_write(). * * On input, checksums are verified as necessary. If any checksum verification * fails, the packet is dropped and not delivered to vmnet_read(). * * Note that the checksum offload function for UDP and TCP checksums is unable * to deal with fragmented IPv4/IPv6 packets. The VM client networking stack * must handle UDP and TCP checksums on fragmented packets itself. */
When enabling TSO maximum packet size is 65550 bytes and sendmsg_x() fails sporadically with "message too long". Increase the buffer size to avoid this issue. Increase receive buffer to make clients that do not handle ENOBUFS less likely to fail. One example is libkrun. Issues: - When enabling TSO and checksum offload, memory usage is doubled.
Since krunkit does not support fd connection, add new "auto" mode selecting the best connection for the driver. This makes it easy to try krunkit, and make it possible to try socket connection for vfkit. Since krunkit always serve the restful-uri, add --krunkit-port option. This is required to start multiple krunkit vms. Without the option the second vm will fail to start. Using local build of krunkit since current brew version is not compatible with current libkrun version. Example run: % ./example server --driver krunkit --krunkit-port 8081 Starting vmnet-helper for 'server' with interface id 'bdc7b3e0-8594-4814-aa25-05187ad2a36e' Creating cloud-init iso '/Users/nir/.vmnet-helper/vms/server/cidata.iso' Starting 'krunkit' virtual machine 'server' with mac address '92:c9:52:b7:6c:08' Virtual machine IP address: 192.168.105.2
Using upstream krunkit and libkrun, since current krunkit brew version is not compatible with current brew libkrun version. Tested with: - krunkit built with libkrun upstream - krunkit built with libkrun patched to disable offloading
796736b
to
fae51b0
Compare
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.
Add krunkit example tested with upstream krunkit.
Example run:
Upstream libkrun enables offloading features, showing very inconsistent performance. When disabling offloading, it shows similar performance as vfkit.
[1] krunkit built with libkrun upstream
[2] krunkit built with libkrun patched to disable offloading
Based on #22
Fixes #18