summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephen Wong <stephen.kf.wong@gmail.com>2019-01-28 23:28:38 +0000
committerGerrit Code Review <gerrit@opnfv.org>2019-01-28 23:28:38 +0000
commit3f86a3d611f4d2a4f21d9be2a2284ccf120db36e (patch)
tree288e4f40871338e1b78d68162eec5e15150b4143
parent43e82fbbf2e62d0aa63a06b8ba5d72f78854cc34 (diff)
parenta0a9f9e8bc71615899a76caa2eda85aef9930a4f (diff)
Merge "Prevent clovisor from unable to create qdisc / filter from previous instance dying abnormally (qdisc deletion is part of exit callback for pod under monitoring, but if clovisor exits abnormally, qdisc would not be deleted, which cause the restarted new clovisor pod unable to load BPF code to the pods under monitoring)"
-rwxr-xr-xclover/clovisor/bin/clovisorbin39227600 -> 39227920 bytes
-rwxr-xr-xclover/clovisor/build-docker8
-rw-r--r--clover/clovisor/libclovisor/clovisor_bcc.go16
3 files changed, 20 insertions, 4 deletions
diff --git a/clover/clovisor/bin/clovisor b/clover/clovisor/bin/clovisor
index d35f90e..240e0bc 100755
--- a/clover/clovisor/bin/clovisor
+++ b/clover/clovisor/bin/clovisor
Binary files differ
diff --git a/clover/clovisor/build-docker b/clover/clovisor/build-docker
index 4f776ec..99668d7 100755
--- a/clover/clovisor/build-docker
+++ b/clover/clovisor/build-docker
@@ -14,7 +14,7 @@ if [ -z "$1" ]
fi
cp bin/clovisor .
docker build --build-arg TARGET_KERNEL_VER=$kernel_ver -t clovisor .
-docker tag clovisor localhost:5000/clovisor
-docker push localhost:5000/clovisor
-#docker tag clovisor s3wong/clovisor
-#docker push s3wong/clovisor
+#docker tag clovisor localhost:5000/clovisor
+#docker push localhost:5000/clovisor
+docker tag clovisor s3wong/clovisor
+docker push s3wong/clovisor
diff --git a/clover/clovisor/libclovisor/clovisor_bcc.go b/clover/clovisor/libclovisor/clovisor_bcc.go
index e2d9cd8..ab5bc33 100644
--- a/clover/clovisor/libclovisor/clovisor_bcc.go
+++ b/clover/clovisor/libclovisor/clovisor_bcc.go
@@ -509,6 +509,22 @@ func ClovisorNewPodInit(k8s_client *ClovisorK8s,
session_table := bcc.NewTable(bpf_mod.TableId("sessions"), bpf_mod)
+ // check if qdisc clsact filter for this interface already exists
+ link, err := netlink.LinkByIndex(ifindex)
+ if err != nil {
+ fmt.Println(err)
+ } else {
+ qdiscs, err := netlink.QdiscList(link)
+ if err == nil {
+ for _, qdisc := range qdiscs {
+ if qdisc.Type() == "clsact" {
+ netlink.QdiscDel(qdisc)
+ break
+ }
+ }
+ }
+ }
+
attrs := netlink.QdiscAttrs {
LinkIndex: ifindex,
Handle: netlink.MakeHandle(0xffff, 0),