Skip to content
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

fix: optimize DropReason eBPF map lookups #730

Merged
merged 1 commit into from
Sep 13, 2024

Conversation

rectified95
Copy link
Contributor

@rectified95 rectified95 commented Sep 12, 2024

Description

For all eBPF program in the DropReason plugin (except inet_csk_accept which has issue we need to investigate #715):

  • only make ebpf map calls when necessary
  • omit setting some packet fields to 0 right after memset is called on the entire struct

Details:
Previously, we did a map lookup regardless of whether the input retVal indicated a drop. Now, only for drops.
We also skip a map delete when there wasn't a earlier kprobe that saved the corresponding PID.

Checklist

  • I have read the contributing documentation.
  • I signed and signed-off the commits (git commit -S -s ...). See this documentation on signing commits.
  • I have correctly attributed the author(s) of the code.
  • I have tested the changes locally.
  • I have followed the project's style guidelines.
  • I have updated the documentation, if necessary.
  • I have added tests, if applicable.

Signed-off-by: Igor Klemenski <igor.klemenski@microsoft.com>
@rectified95 rectified95 marked this pull request as ready for review September 12, 2024 00:52
@rectified95 rectified95 requested a review from a team as a code owner September 12, 2024 00:52
@nddq nddq added this pull request to the merge queue Sep 13, 2024
Merged via the queue into microsoft:main with commit 3d2c7a5 Sep 13, 2024
24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants