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
datapath: Use bpftool for generating BPF feature macros #10019
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
vadorovsky
added
wip
sig/datapath
Impacts bpf/ or low-level forwarding details, including map management and monitor messages.
labels
Feb 2, 2020
Release note label not set, please set the appropriate release note. |
1 similar comment
Release note label not set, please set the appropriate release note. |
test-me-please |
test-me-please |
aanm
added
dont-merge/waiting-for-upstream
Only merge once upstream library or kernel features have landed
dont-merge/wait-until-release
Freeze window for current release is blocking non-bugfix PRs
and removed
dont-merge/waiting-for-upstream
Only merge once upstream library or kernel features have landed
labels
Feb 3, 2020
aanm
added
dont-merge/needs-rebase
This PR needs to be rebased because it has merge conflicts.
and removed
dont-merge/wait-until-release
Freeze window for current release is blocking non-bugfix PRs
labels
Feb 18, 2020
vadorovsky
force-pushed
the
bpftool-feature-headers
branch
from
February 28, 2020 12:10
bc60e72
to
4f3de9c
Compare
vadorovsky
added
release-note/minor
This PR changes functionality that users may find relevant to operating Cilium.
and removed
dont-merge/needs-release-note
dont-merge/needs-rebase
This PR needs to be rebased because it has merge conflicts.
labels
Feb 28, 2020
vadorovsky
changed the title
[WIP] datapath: Use bpftool for generating BPF feature macros
datapath: Use bpftool for generating BPF feature macros
Feb 28, 2020
test-me-please |
1 similar comment
test-me-please |
Signed-off-by: Michal Rostecki <mrostecki@opensuse.org>
Previous changes remove Cilium BPF feature probes in favor of bpftool probes, which are executed by daemon in Go code and errors are included in the cilium-agent log. Additional .log file is not created anymore. Signed-off-by: Michal Rostecki <mrostecki@opensuse.org>
vadorovsky
force-pushed
the
bpftool-feature-headers
branch
from
March 16, 2020 21:15
4878523
to
c3a7a5d
Compare
Again lots of failures on EKS: https://jenkins.cilium.io/job/Cilium-PR-K8s-EKS/104/consoleFull And the flake #10565 |
test-me-please |
test-eks was triggered here by mistake, this PR is good to merge as far as CI goes |
aanm
approved these changes
Mar 17, 2020
borkmann
added a commit
that referenced
this pull request
Mar 19, 2020
Do not rely on clang-7/llvm-7 shipped by Ubuntu base image and instead upgrade to clang-11/llvm-11 with a BPF-only backend. This would help overcoming the blockade of [0] where we're hitting the 1 mio instruction complexity limit which was bisected by Paul to the kernel commit f7cf25b20 ("bpf: track spill/fill of constants"). As it is stated there: Newer clang generates better code by spilling less to the stack. Instead it keeps more constants in the registers which hurts state pruning since the verifier already tracks constants in the registers [...]. Tracking constants in the registers hurts state pruning already. Adding tracking of constants through stack hurts pruning even more. The later patch address this general constant tracking issue with coarse/precise logic. Side-effect of going with a custom clang-11/llvm-11 build with a BPF-only backend is that i) we can also shrink the image since x86 is not needed anymore, and ii) avoid shipping a generic compiler in our image that can generate x86 executable code. This depends on [1] where we first need to get rid of our custom runtime probes in Cilium and instead rely on bpftool to take over that job. Size shrinkage around 36.6M: clang-7 (90,777,392) -> clang-11/stripped (75,617,520) llc-7 (51,453,072) -> llc-11/bpf/stripped (29,997,384) [0] #10517 [1] #10019 Complexity comparison: https://user-images.githubusercontent.com/677393/76440789-aae08b80-63be-11ea-863f-37ab12106ad9.png Signed-off-by: Daniel Borkmann <daniel@iogearbox.net> Cc: Paul Chaignon <paul@cilium.io>
borkmann
added a commit
to borkmann/cilium
that referenced
this pull request
Mar 20, 2020
Do not rely on clang-7/llvm-7 shipped by Ubuntu base image and instead upgrade to clang-11/llvm-11 with a BPF-only backend. This would help overcoming the blockade of [0] where we're hitting the 1 mio instruction complexity limit which was bisected by Paul to the kernel commit f7cf25b20 ("bpf: track spill/fill of constants"). As it is stated there: Newer clang generates better code by spilling less to the stack. Instead it keeps more constants in the registers which hurts state pruning since the verifier already tracks constants in the registers [...]. Tracking constants in the registers hurts state pruning already. Adding tracking of constants through stack hurts pruning even more. The later patch address this general constant tracking issue with coarse/precise logic. Side-effect of going with a custom clang-11/llvm-11 build with a BPF-only backend is that i) we can also shrink the image since x86 is not needed anymore, and ii) avoid shipping a generic compiler in our image that can generate x86 executable code. This depends on [1] where we first need to get rid of our custom runtime probes in Cilium and instead rely on bpftool to take over that job. Size shrinkage around 36.6M: clang-7 (90,777,392) -> clang-11/stripped (75,617,520) llc-7 (51,453,072) -> llc-11/bpf/stripped (29,997,384) [0] cilium#10517 [1] cilium#10019 Complexity comparison: https://user-images.githubusercontent.com/677393/76440789-aae08b80-63be-11ea-863f-37ab12106ad9.png Signed-off-by: Daniel Borkmann <daniel@iogearbox.net> Cc: Paul Chaignon <paul@cilium.io>
borkmann
added a commit
that referenced
this pull request
Mar 23, 2020
Do not rely on clang-7/llvm-7 shipped by Ubuntu base image and instead upgrade to clang-11/llvm-11 with a BPF-only backend. This would help overcoming the blockade of [0] where we're hitting the 1 mio instruction complexity limit which was bisected by Paul to the kernel commit f7cf25b20 ("bpf: track spill/fill of constants"). As it is stated there: Newer clang generates better code by spilling less to the stack. Instead it keeps more constants in the registers which hurts state pruning since the verifier already tracks constants in the registers [...]. Tracking constants in the registers hurts state pruning already. Adding tracking of constants through stack hurts pruning even more. The later patch address this general constant tracking issue with coarse/precise logic. Side-effect of going with a custom clang-11/llvm-11 build with a BPF-only backend is that i) we can also shrink the image since x86 is not needed anymore, and ii) avoid shipping a generic compiler in our image that can generate x86 executable code. This depends on [1] where we first need to get rid of our custom runtime probes in Cilium and instead rely on bpftool to take over that job. Size shrinkage around 36.6M: clang-7 (90,777,392) -> clang-11/stripped (75,617,520) llc-7 (51,453,072) -> llc-11/bpf/stripped (29,997,384) [0] #10517 [1] #10019 Complexity comparison: https://user-images.githubusercontent.com/677393/76440789-aae08b80-63be-11ea-863f-37ab12106ad9.png Signed-off-by: Daniel Borkmann <daniel@iogearbox.net> Cc: Paul Chaignon <paul@cilium.io>
borkmann
added a commit
that referenced
this pull request
Mar 24, 2020
Do not rely on clang-7/llvm-7 shipped by Ubuntu base image and instead upgrade to clang-11/llvm-11 with a BPF-only backend. This would help overcoming the blockade of [0] where we're hitting the 1 mio instruction complexity limit which was bisected by Paul to the kernel commit f7cf25b20 ("bpf: track spill/fill of constants"). As it is stated there: Newer clang generates better code by spilling less to the stack. Instead it keeps more constants in the registers which hurts state pruning since the verifier already tracks constants in the registers [...]. Tracking constants in the registers hurts state pruning already. Adding tracking of constants through stack hurts pruning even more. The later patch address this general constant tracking issue with coarse/precise logic. Side-effect of going with a custom clang-11/llvm-11 build with a BPF-only backend is that i) we can also shrink the image since x86 is not needed anymore, and ii) avoid shipping a generic compiler in our image that can generate x86 executable code. This depends on [1] where we first need to get rid of our custom runtime probes in Cilium and instead rely on bpftool to take over that job. Size shrinkage around 36.6M: clang-7 (90,777,392) -> clang-11/stripped (75,617,520) llc-7 (51,453,072) -> llc-11/bpf/stripped (29,997,384) [0] #10517 [1] #10019 Complexity comparison: https://user-images.githubusercontent.com/677393/76440789-aae08b80-63be-11ea-863f-37ab12106ad9.png Signed-off-by: Daniel Borkmann <daniel@iogearbox.net> Cc: Paul Chaignon <paul@cilium.io>
borkmann
added a commit
that referenced
this pull request
Mar 25, 2020
Do not rely on clang-7/llvm-7 shipped by Ubuntu base image and instead upgrade to clang-11/llvm-11 with a BPF-only backend. This would help overcoming the blockade of [0] where we're hitting the 1 mio instruction complexity limit which was bisected by Paul to the kernel commit f7cf25b20 ("bpf: track spill/fill of constants"). As it is stated there: Newer clang generates better code by spilling less to the stack. Instead it keeps more constants in the registers which hurts state pruning since the verifier already tracks constants in the registers [...]. Tracking constants in the registers hurts state pruning already. Adding tracking of constants through stack hurts pruning even more. The later patch address this general constant tracking issue with coarse/precise logic. Side-effect of going with a custom clang-11/llvm-11 build with a BPF-only backend is that i) we can also shrink the image since x86 is not needed anymore, and ii) avoid shipping a generic compiler in our image that can generate x86 executable code. This depends on [1] where we first need to get rid of our custom runtime probes in Cilium and instead rely on bpftool to take over that job. Size shrinkage around 36.6M: clang-7 (90,777,392) -> clang-11/stripped (75,617,520) llc-7 (51,453,072) -> llc-11/bpf/stripped (29,997,384) [0] #10517 [1] #10019 Complexity comparison: https://user-images.githubusercontent.com/677393/76440789-aae08b80-63be-11ea-863f-37ab12106ad9.png Signed-off-by: Daniel Borkmann <daniel@iogearbox.net> Cc: Paul Chaignon <paul@cilium.io>
borkmann
added a commit
that referenced
this pull request
Mar 25, 2020
Do not rely on clang-7/llvm-7 shipped by Ubuntu base image and instead upgrade to clang-11/llvm-11 with a BPF-only backend. This would help overcoming the blockade of [0] where we're hitting the 1 mio instruction complexity limit which was bisected by Paul to the kernel commit f7cf25b20 ("bpf: track spill/fill of constants"). As it is stated there: Newer clang generates better code by spilling less to the stack. Instead it keeps more constants in the registers which hurts state pruning since the verifier already tracks constants in the registers [...]. Tracking constants in the registers hurts state pruning already. Adding tracking of constants through stack hurts pruning even more. The later patch address this general constant tracking issue with coarse/precise logic. Side-effect of going with a custom clang-11/llvm-11 build with a BPF-only backend is that i) we can also shrink the image since x86 is not needed anymore, and ii) avoid shipping a generic compiler in our image that can generate x86 executable code. This depends on [1] where we first need to get rid of our custom runtime probes in Cilium and instead rely on bpftool to take over that job. Size shrinkage around 36.6M: clang-7 (90,777,392) -> clang-11/stripped (75,617,520) llc-7 (51,453,072) -> llc-11/bpf/stripped (29,997,384) [0] #10517 [1] #10019 Complexity comparison: https://user-images.githubusercontent.com/677393/76440789-aae08b80-63be-11ea-863f-37ab12106ad9.png Signed-off-by: Daniel Borkmann <daniel@iogearbox.net> Cc: Paul Chaignon <paul@cilium.io>
pchaigno
added a commit
that referenced
this pull request
Apr 6, 2020
When copying the output of bpftool into the bpf_features.h file, although we wait for the bpftool command to finish, we don't wait for the consumer goroutine. This issue can lead to corrupted bpf_features.h files. We however do not need a goroutine to copy bpftool's output. Fixes: #10857 Fixes: #10019 Signed-off-by: Paul Chaignon <paul@cilium.io>
pchaigno
added a commit
that referenced
this pull request
Apr 9, 2020
When copying the output of bpftool into the bpf_features.h file, although we wait for the bpftool command to finish, we don't wait for the consumer goroutine. This issue can lead to corrupted bpf_features.h files. We however do not need a goroutine to copy bpftool's output. Fixes: #10857 Fixes: #10019 Signed-off-by: Paul Chaignon <paul@cilium.io>
joestringer
pushed a commit
that referenced
this pull request
Apr 9, 2020
When copying the output of bpftool into the bpf_features.h file, although we wait for the bpftool command to finish, we don't wait for the consumer goroutine. This issue can lead to corrupted bpf_features.h files. We however do not need a goroutine to copy bpftool's output. Fixes: #10857 Fixes: #10019 Signed-off-by: Paul Chaignon <paul@cilium.io>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
priority/high
This is considered vital to an upcoming release.
release-note/minor
This PR changes functionality that users may find relevant to operating Cilium.
sig/datapath
Impacts bpf/ or low-level forwarding details, including map management and monitor messages.
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.
To adjust BPF programs to different kernels containing different BPF features, bpftool provides macros like i.e.:
Cilium implemented similar macros on its own, but this pull request removes them in favor of macros generated by bpftool.
This change is