-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Fail early in case of too big a frame in the TX path #4526
Merged
bchalios
merged 2 commits into
firecracker-microvm:main
from
bchalios:limit_net_tx_packet_size
Mar 28, 2024
Merged
Fail early in case of too big a frame in the TX path #4526
bchalios
merged 2 commits into
firecracker-microvm:main
from
bchalios:limit_net_tx_packet_size
Mar 28, 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
bchalios
added
the
Status: Awaiting review
Indicates that a pull request is ready to be reviewed
label
Mar 27, 2024
bchalios
force-pushed
the
limit_net_tx_packet_size
branch
from
March 27, 2024 12:53
496fd24
to
3371083
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #4526 +/- ##
=======================================
Coverage 82.01% 82.02%
=======================================
Files 253 253
Lines 31026 31035 +9
=======================================
+ Hits 25447 25456 +9
Misses 5579 5579
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
bchalios
force-pushed
the
limit_net_tx_packet_size
branch
from
March 27, 2024 13:35
3371083
to
0792e54
Compare
bchalios
changed the title
Avoid vector allocation in MMDS code path
Fail early in case of too big a frame in the TX path
Mar 27, 2024
bchalios
force-pushed
the
limit_net_tx_packet_size
branch
4 times, most recently
from
March 27, 2024 16:31
e2d67d3
to
5728a51
Compare
bchalios
requested review from
xmarcalx,
kalyazin,
pb8o and
wearyzen
as code owners
March 27, 2024 16:31
bchalios
force-pushed
the
limit_net_tx_packet_size
branch
from
March 27, 2024 16:32
5728a51
to
9dac42e
Compare
kalyazin
reviewed
Mar 27, 2024
When we switched to using writev for copying a network packet from guest memory to the tap device we dropped an (implicit) check for the size of the TX frame. Reintroduce that check since we should be handling only frames of up to MAX_BUFFER_SIZE. This, also, controls the amount of memory we allocate in the Firecracker process for copying frames that are destined for MMDS from guest memory to Firecracker memory. Signed-off-by: Babis Chalios <bchalios@amazon.es>
bchalios
force-pushed
the
limit_net_tx_packet_size
branch
from
March 27, 2024 18:44
9dac42e
to
18e3035
Compare
kalyazin
approved these changes
Mar 27, 2024
zulinx86
approved these changes
Mar 28, 2024
pb8o
approved these changes
Mar 28, 2024
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
Introduce a check that the size of a frame in the TX queue is not bigger than the one the device can handle.
Reason
We do not handle malformed packets that the driver might send to us. Also, we avoid big allocations when copying from guest memory to Firecracker memory when handling MMDS frames.
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
.