loader: Check if device has BPF prog before trying to detach it#13591
Merged
loader: Check if device has BPF prog before trying to detach it#13591
Conversation
This was referenced Oct 15, 2020
tklauser
reviewed
Oct 16, 2020
Member
tklauser
left a comment
There was a problem hiding this comment.
Two small nits, otherwise LGTM.
tklauser
reviewed
Oct 16, 2020
Member
tklauser
left a comment
There was a problem hiding this comment.
Two small nits, otherwise LGTM.
9f76a69 to
55607ba
Compare
tklauser
approved these changes
Oct 16, 2020
Member
|
retest-4.9 previous failure: #13528 https://jenkins.cilium.io/job/Cilium-PR-K8s-1.19-kernel-4.9/820/ |
kkourt
reviewed
Oct 16, 2020
kkourt
approved these changes
Oct 16, 2020
aanm
requested changes
Oct 16, 2020
When running Cilium with the devices set, but neither kube-proxy-free or
the host firewall enabled, cilium-agent will attempt to remove the
previous BPF program from the native devices' egress tc hook. If no
program is attached there (i.e., Cilium was running without host
firewall and kube-proxy replacement before restarting), the removal will
fail with the following error.
level=error msg="Command execution failed" cmd="[tc filter delete dev enp0s8 egress]" error="exit status 2" subsys=datapath-loader
level=warning msg="Error: Parent Qdisc doesn't exists." subsys=datapath-loader
level=warning msg="We have an error talking to the kernel, -1" subsys=datapath-loader
This commit fixes this error by first checking that the device has a BPF
program attached on egress.
I tested this in the dev. VM, by first starting Cilium with our
kube-proxy-replacement, then without but keeping the devices
configuration.
Fixes: a695f53 ("Endpoint for host")
Signed-off-by: Paul Chaignon <paul@cilium.io>
55607ba to
6a1c3de
Compare
Member
Author
|
test-me-please |
aanm
approved these changes
Oct 16, 2020
vadorovsky
approved these changes
Oct 16, 2020
brb
reviewed
Oct 19, 2020
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
When running Cilium with the devices set, but neither kube-proxy-free or the host firewall enabled, cilium-agent will attempt to remove the previous BPF program from the native devices' egress tc hook. If no program is attached there (i.e., Cilium was running without host firewall and kube-proxy replacement before restarting), the removal will fail with the following error.
This commit fixes this error by first checking that the device has a BPF program attached on egress.
I tested this in the dev. VM, by first starting Cilium with our kube-proxy-replacement, then without but keeping the devices configuration.
Fixes: #10994
Fixes: #13512
Updates: #11799