-
Notifications
You must be signed in to change notification settings - Fork 2.2k
fix: resolve TODO to preserve TokenBucket budget during updates #5594
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
base: main
Are you sure you want to change the base?
Conversation
3f2120e to
7c95a0d
Compare
|
|
||
| /// Allocate a host-side port to be assigned to a new host-initiated connection. | ||
| fn allocate_local_port(&mut self) -> u32 { | ||
| // TODO: this doesn't seem very space-efficient. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will not implement: #3273 (comment)
| // TODO: Refactor this to make more efficient but there are | ||
| // lifetime/ownership challenges. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
imo memcpy is already probably the most efficient way for this
| pub fn from_bytes_unchecked(src: &[u8]) -> MacAddr { | ||
| // TODO: using something like std::mem::uninitialized could avoid the extra initialization, | ||
| // if this ever becomes a performance bottleneck. | ||
| let mut bytes = [0u8; MAC_ADDR_LEN as usize]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
initialization overhead for 6-byte buffer should be small compared to rest of network processing
Also remove some stale TODOs and update docs. Signed-off-by: Aaron Ang <aaron.angyd@gmail.com>
7c95a0d to
b4c5d6f
Compare
Changes
update_buckets()preserves budget, one_time_burst, and last_update (capped at new bucket limits) instead of resetting to full capacity.Reason
Address a TODO regarding
TokenBucketupdates. See #3273.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.