-
Notifications
You must be signed in to change notification settings - Fork 34
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
Use global map, spinlock, split maps #469
base: main
Are you sure you want to change the base?
Conversation
Skipping CI for Draft Pull Request. |
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Perf tests (https://docs.google.com/spreadsheets/d/1qakBaK1dk_rERO30k1cSR4W-Nn0SXW4A3lqQ1sZC4rE/edit?gid=48358889#gid=48358889) show ~ -25% CPU usage with the global map |
} else { | ||
// Key does not exist in the map, and will need to create a new entry. | ||
u64 rtt = 0; |
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.
@msherif1234 I don't understand the rationale for this code. We're setting default RTT for TCP flows, how could that be accurate? I don't see how this wouldn't produce fake data.
Split BPF maps to avoid having one huge map for flows. This should move us farther from the "stack size limit" that potentially shows up when adding new features. This is also a pre-req for later being able to move away from per-cpu maps, which is wasting memory by duplicating flows across CPUs Also: - remove MAC and eth_protocol from map key (they're moved to flow metrics ie. map values) - in every hook, we don't try anymore to create the flow it it didn't exist. We assume it should exist. Note that, previously, we were adding bytes/packet counters from hooks, which doesn't seem correct as counting bytes/packets is the role of the TC hook only - else it can lead to overcounts - remove code that sets MIN_RTT on TCP flows (not sure why we had that) - small refactoring of the "Accumulate" functions to adapt to new model
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #469 +/- ##
==========================================
+ Coverage 29.52% 29.65% +0.12%
==========================================
Files 50 51 +1
Lines 4863 4913 +50
==========================================
+ Hits 1436 1457 +21
- Misses 3321 3348 +27
- Partials 106 108 +2
Flags with carried forward coverage won't be shown. Click here to find out more.
|
Also:
metrics ie. map values)
adding bytes/packet counters from hooks, which doesn't seem correct as
counting bytes/packets is the role of the TC hook only - else it can
lead to overcounts I guess