-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
bpf: make setting fifo policy non-fatal when probing hz #11454
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
borkmann
added
pending-review
sig/datapath
Impacts bpf/ or low-level forwarding details, including map management and monitor messages.
release-note/misc
This PR makes changes that have no direct user impact.
labels
May 11, 2020
test-me-please |
test-me-please |
tgraf
approved these changes
May 11, 2020
pchaigno
approved these changes
May 11, 2020
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.
@borkmann Could you also add the executable to bpf/.gitignore
?
In case of an error in dump_kern_jiffies(), we need to propagate it so that we exit with a non-success error code. Also move the macro output behind a -m switch and add a non-macro output by default for cilium-probe-kernel-hz. Also add cilium-probe-kernel-hz to gitignore. Signed-off-by: Daniel Borkmann <[email protected]>
For cases where we don't care about a combined output, add a helper to Cilium's exec library to only query stdout. Signed-off-by: Daniel Borkmann <[email protected]>
This work removes probing of kernel hz from init.sh and and moves it into the agent. I'll upstream a small bpftool change which reads CONFIG_HZ from the underlying kernel config which Cilium agent can then pick up via probe manager automatically: diff --git a/tools/bpf/bpftool/feature.c b/tools/bpf/bpftool/feature.c index 88718ee6a438..946e9b89467d 100644 --- a/tools/bpf/bpftool/feature.c +++ b/tools/bpf/bpftool/feature.c @@ -378,6 +378,9 @@ static void probe_kernel_image_config(void) /* test_bpf module for BPF tests */ "CONFIG_TEST_BPF", + + /* Miscellaneous, e.g. for jiffies conversion */ + "CONFIG_HZ", }; char *values[ARRAY_SIZE(options)] = { }; struct utsname utsn; If it is not present on the system, we then fall-back to run the probe (cilium-probe-kernel-hz) and hold the result in the agent config. Either way, we then emit the KERNEL_HZ when generating the node_config.h from the agent. If kernel config or probing failed, we disable checking for jiffie helper since there is no point due to missing KERNEL_HZ value. Fixes: 8d5654f ("bpf: probe and emit kernel hz to node_config") Reported-by: Zang Li <[email protected]> Reported-by: Benjamin Pineau <[email protected]> Signed-off-by: Daniel Borkmann <[email protected]>
test-me-please |
pchaigno
approved these changes
May 11, 2020
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.
LGTM!
test-with-kernel |
retest-4.19 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
release-note/misc
This PR makes changes that have no direct user impact.
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.
See commit msg.