-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
fix(net): Apply only supported TAP offloading features #4680
Merged
bchalios
merged 4 commits into
firecracker-microvm:main
from
bchalios:fix_setting_tap_features
Jul 17, 2024
Merged
fix(net): Apply only supported TAP offloading features #4680
bchalios
merged 4 commits into
firecracker-microvm:main
from
bchalios:fix_setting_tap_features
Jul 17, 2024
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
4292b58
to
10273ef
Compare
5 tasks
Currently, we assume that the guest virtio-net driver acknowledges all the offload features we offer to it and then subsequently set the corresponding TAP features. This might be the case for the Linux guest kernel drivers we are currently using, but it is not necessarily the case. FreeBSD for example, might try to NACK some of them in some cases: firecracker-microvm#3905. This commit, changes the Firecracker implementation of VirtIO device to only setup the TAP offload features that correspond to the ones that the guest driver acknowledged. Signed-off-by: Nikita Zakirov <[email protected]> Signed-off-by: Babis Chalios <[email protected]>
10273ef
to
49ed5ea
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #4680 +/- ##
==========================================
+ Coverage 82.12% 82.14% +0.02%
==========================================
Files 255 255
Lines 31281 31321 +40
==========================================
+ Hits 25689 25729 +40
Misses 5592 5592
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
In the past, we were enabling IPv6 TSO in the TAP device but we were not negotiating the flag with the guest driver. The previous commit cleaned this up, by not setting gen::TUN_F_TSO6 when calling the TUNSETOFFLOAD ioctl. This commit properly negotiates the feature and, if the guest supports it, it enables it in the TAP device. Signed-off-by: Babis Chalios <[email protected]>
Before, we were calling this ioctl() from the VMM thread when creating the virtio network device. Moreover, this ioctl() was called before setting up seccomp filters. Now, we call it during device activation, which is handled by the vCPU threads. Change the seccomp filters to allow these ioctl()s. Signed-off-by: Babis Chalios <[email protected]>
ShadowCurse
approved these changes
Jul 16, 2024
roypat
approved these changes
Jul 16, 2024
3 tasks
bchalios
added a commit
to bchalios/firecracker
that referenced
this pull request
Sep 2, 2024
Adds an entry in CHANGELOG.md about the fix firecracker-microvm#4680. The fix ensures that we set to the TAP device only features that were successfully negotiated with the guest driver. Signed-off-by: Babis Chalios <[email protected]>
9 tasks
bchalios
added a commit
to bchalios/firecracker
that referenced
this pull request
Sep 2, 2024
Adds an entry in CHANGELOG.md about the fix firecracker-microvm#4680. The fix ensures that we set to the TAP device only features that were successfully negotiated with the guest driver. Signed-off-by: Babis Chalios <[email protected]>
bchalios
added a commit
that referenced
this pull request
Sep 2, 2024
Adds an entry in CHANGELOG.md about the fix #4680. The fix ensures that we set to the TAP device only features that were successfully negotiated with the guest driver. Signed-off-by: Babis Chalios <[email protected]>
bchalios
added a commit
to bchalios/firecracker
that referenced
this pull request
Sep 2, 2024
Adds an entry in CHANGELOG.md about the fix firecracker-microvm#4680. The fix ensures that we set to the TAP device only features that were successfully negotiated with the guest driver. (cherry picked from commit 730e645) Signed-off-by: Babis Chalios <[email protected]>
9 tasks
roypat
pushed a commit
that referenced
this pull request
Sep 2, 2024
Adds an entry in CHANGELOG.md about the fix #4680. The fix ensures that we set to the TAP device only features that were successfully negotiated with the guest driver. (cherry picked from commit 730e645) Signed-off-by: Babis Chalios <[email protected]>
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
Changes the Firecracker implementation of VirtIO device to only setup the TAP offload features that correspond to the ones that the guest driver acknowledged.
This is a clean-up and re-spin of #4386.
Closes: #4659
Reason
Currently, we assume that the guest virtio-net driver acknowledges all the offload features we offer to it and then subsequently set the corresponding TAP features.
This might be the case for the Linux guest kernel drivers we are currently using, but it is not necessarily the case. FreeBSD for example, might try to NACK some of them in some cases: #3905.
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
PR.
CHANGELOG.md
.TODO
s link to an issue.contribution quality standards.
rust-vmm
.