fix(userspace): compute the drop ratio
in the right way
#2128
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.
Signed-off-by: Andrea Terzolo andrea.terzolo@polito.it
Co-authored-by: Shane Lawrence shane@lawrence.dev
What type of PR is this?
/kind bug
/kind cleanup
Any specific area of the project related to this PR?
/area engine
What this PR does / why we need it:
First of all, I would to thank @shane-lawrence for spotting this issue in #2111! Great catch!
As I said here the
n_evts
fields, both inkmod
and inbpf
should be intended as "events seen by the drivers" so they should contain also the number of drops. This is for example what we do in our bpf probe after this variable increment we will increment also the drops number in case the event cannot be pushed into the buffer for example.According to it, we need to change the way in which we compute the
drop ratio
Which issue(s) this PR fixes:
Special notes for your reviewer:
Does this PR introduce a user-facing change?: