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

Ensure TC programs play nice with 3rdparty programs #1462

Merged
merged 4 commits into from
Dec 14, 2024
Merged

Conversation

rafaelroquetto
Copy link
Contributor

@rafaelroquetto rafaelroquetto commented Dec 13, 2024

We need to ensure we play nice with third-parties also using tc, by not accidentally removing their programs. That is achieved by:

  • if a qdisc already exists, don't try to delete it - reuse it instead
  • during tear down, do not delete any qdiscs that are not empty after removing our own programs from it
  • ensure our filters return TC_ACT_UNSPEC so that they don't consume any packets
  • "namespaced" our ebpf programs with the beyla_ prefix - not entirely necessary here, but perhaps a good idea anyway to avoid any potential collisions

Copy link

codecov bot commented Dec 13, 2024

Codecov Report

Attention: Patch coverage is 90.47619% with 16 lines in your changes missing coverage. Please review.

Project coverage is 81.12%. Comparing base (cc8de1b) to head (f422f93).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
pkg/internal/ebpf/common/tc_linux.go 64.86% 7 Missing and 6 partials ⚠️
pkg/internal/netolly/ebpf/tracer.go 50.00% 0 Missing and 2 partials ⚠️
pkg/internal/netolly/ebpf/sock_tracer.go 50.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1462      +/-   ##
==========================================
- Coverage   81.16%   81.12%   -0.05%     
==========================================
  Files         149      149              
  Lines       15321    15339      +18     
==========================================
+ Hits        12436    12444       +8     
- Misses       2271     2279       +8     
- Partials      614      616       +2     
Flag Coverage Δ
integration-test 59.66% <90.47%> (-0.05%) ⬇️
k8s-integration-test 60.63% <90.47%> (+0.02%) ⬆️
oats-test 33.81% <69.04%> (-0.05%) ⬇️
unittests 51.80% <0.00%> (-0.07%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@grcevski grcevski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! I'd merge this in if tests pass. We can follow-up with k8s test with Cilium, docs on how to run with Cilium etc.

@rafaelroquetto rafaelroquetto changed the title WIP: ensure TC programs play nice with 3rdparty programs Ensure TC programs play nice with 3rdparty programs Dec 13, 2024
@rafaelroquetto rafaelroquetto marked this pull request as ready for review December 13, 2024 19:49
@rafaelroquetto rafaelroquetto merged commit 0d8cdc3 into main Dec 14, 2024
15 checks passed
@rafaelroquetto rafaelroquetto deleted the tc_chain branch December 14, 2024 15:53
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