-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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: Use "fallthrough;", compile with -Wimplicit-fallthrough #26211
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
qmonnet
added
sig/loader
Impacts the loading of BPF programs into the kernel.
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
Jun 14, 2023
/test |
/test |
lmb
approved these changes
Jun 14, 2023
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.
Nice!
qmonnet
added
the
needs-backport/1.13
This PR / issue needs backporting to the v1.13 branch
label
Jun 14, 2023
/test |
/test-runtime |
julianwiedmann
approved these changes
Jun 14, 2023
Rebased to have the Conformance Ginkgo test run |
Prevent falling through from IPv6 to IPIP when creating SRV6 state entries based on the encapsulated header protocol. Caught by compiling with -Wimplicit-fallthrough. Fixes: bfba740 ("bpf: Handle reply SRv6 traffic") Signed-off-by: Quentin Monnet <quentin@isovalent.com>
We can label intentional fall-throughs and tell clang to report unannotated ones, to catch bugs that would be caused by involuntarily falling through between switch labels. The bug fixed in commit 9a64111 ("bpf: test: fix pktgen for IPv6 NEXTHDR_DEST option") was found this way. I wasn't able to pin down the exact version that got support for the relevant attribute, but clang 10 has it for sure and it seems to be much older than that, so we don't have to worry and test for its availability. Signed-off-by: Quentin Monnet <quentin@isovalent.com>
/test |
borkmann
approved these changes
Jun 16, 2023
maintainer-s-little-helper
bot
added
the
ready-to-merge
This PR has passed all tests and received consensus from code owners to merge.
label
Jun 16, 2023
Repeating here the warning for backporters that only the first commit should be backported to 1.13. |
19 tasks
nbusseneau
added
backport-pending/1.13
The backport for Cilium 1.13.x for this PR is in progress.
and removed
needs-backport/1.13
This PR / issue needs backporting to the v1.13 branch
labels
Jun 22, 2023
maintainer-s-little-helper
bot
moved this from Needs backport from main
to Backport pending to v1.13
in 1.13.5
Jun 22, 2023
Thanks for the warning @qmonnet! |
tklauser
added
backport-done/1.13
The backport for Cilium 1.13.x for this PR is done.
and removed
backport-pending/1.13
The backport for Cilium 1.13.x for this PR is in progress.
labels
Jun 29, 2023
gentoo-root
moved this from Backport pending to v1.13
to Backport done to v1.13
in 1.13.5
Jul 26, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
backport-done/1.13
The backport for Cilium 1.13.x for this PR is done.
ready-to-merge
This PR has passed all tests and received consensus from code owners to merge.
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.
sig/loader
Impacts the loading of BPF programs into the kernel.
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.
We can label intentional fall-throughs and tell clang to report unannotated ones, to catch bugs that would be caused by involuntarily falling through between switch labels.
The result is not super aesthetic in builtins.h or jhash.h, but at the same time it's just one keyword so not too much boilerplate either. And it catches bugs. The one fixed in commit 9a64111 (
"bpf: test: fix pktgen for IPv6 NEXTHDR_DEST option"
), or the first commit in this PR, were found this way.I wasn't able to pin down the exact version that got support for the relevant attribute, but clang 10 has it for sure and it seems to be much older than that, so we don't have to worry and test for its availability.
Inspired by checkpatch complaining about the
/* fall through */
comments.