-
Notifications
You must be signed in to change notification settings - Fork 31
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
NETOBSERV-1545: Expose a counter for BPF hashmap update packets drop #304
NETOBSERV-1545: Expose a counter for BPF hashmap update packets drop #304
Conversation
@msherif1234: This pull request references NETOBSERV-1545 which is a valid jira issue. Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "4.16.0" version, but no target version was set. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
@msherif1234: This pull request references NETOBSERV-1545 which is a valid jira issue. Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "4.16.0" version, but no target version was set. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
c59108c
to
d43a69d
Compare
@msherif1234: This pull request references NETOBSERV-1545 which is a valid jira issue. Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "4.16.0" version, but no target version was set. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
ba261e4
to
c0b7a79
Compare
/ok-to-test |
New image: It will expire after two weeks. To deploy this build, run from the operator repo, assuming the operator is running: USER=netobserv VERSION=add77ab make set-agent-image |
c0b7a79
to
a2ba1b4
Compare
/ok-to-test |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #304 +/- ##
==========================================
- Coverage 34.04% 33.88% -0.16%
==========================================
Files 47 47
Lines 3836 3854 +18
==========================================
Hits 1306 1306
- Misses 2444 2462 +18
Partials 86 86
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
New image: It will expire after two weeks. To deploy this build, run from the operator repo, assuming the operator is running: USER=netobserv VERSION=8a1158f make set-agent-image |
/gh pr ready |
bpf_printk("error updating flow %d\n", ret); | ||
} | ||
// Update global counter for hashmap update errors | ||
error_counter_p = bpf_map_lookup_elem(&global_counters, &key); |
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.
to make sure if I understand that: you created global_counters
as a map for generic purpose, ie. today it contains drop counters at key 0 but potentially later we may add more counters at different indexes, is this correct?
Perhaps if so you could define a constant DROP_COUNTER_KEY = 0 or something like that?
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.
yes and I am already thinking of using this to count filtered flows :) at different index as well as ovs dbg I will add const here and the golang side Thanks
pkg/ebpf/tracer.go
Outdated
// ReadGlobalCounter reads the global counter and updates hashmap update error counter metrics | ||
func (m *FlowFetcher) ReadGlobalCounter(met *metrics.Metrics) { | ||
var allCPUValue []uint32 | ||
key := uint32(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.
here as well this key could be a constant like dropCounterKey = 0
It would make it more obvious that we can add more keys for more counters
pkg/ebpf/tracer.go
Outdated
} | ||
// aggregate all the counters | ||
for _, counter := range allCPUValue { | ||
met.Errors.WithErrorName("flow-fetcher", "CannotUpdateHashMapCounter").Add(float64(counter)) |
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.
There's already a metric for drops, could we use it instead?
met.Errors.WithErrorName("flow-fetcher", "CannotUpdateHashMapCounter").Add(float64(counter)) | |
met.DroppedFlowsCounter.WithSourceAndReason("flow-fetcher", "CannotUpdateHashMapCounter").Add(float64(counter)) |
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.
SG will use it then
a2ba1b4
to
fde93e1
Compare
Signed-off-by: Mohamed Mahmoud <mmahmoud@redhat.com>
fde93e1
to
b25759a
Compare
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.
thanks @msherif1234 !
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: msherif1234 The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Description
cilium doesn't seem to have a way to read globals from ebpf program I will keep this PR as draft till we have a way to read global from userspace
https://cilium.slack.com/archives/C027KBX679U/p1711370379468299
so perCPU array map will be used to hold the global counter and userspace will read, aggregate and update the metrics
Dependencies
n/a
Checklist
If you are not familiar with our processes or don't know what to answer in the list below, let us know in a comment: the maintainers will take care of that.