-
Notifications
You must be signed in to change notification settings - Fork 1.6k
[CORE-12378] fix(QoS): Use QdiscReplace() instead of QdiscAdd() #11899
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -205,10 +205,6 @@ var _ = infrastructure.DatastoreDescribe( | |
| infra = getInfra(infrastructure.WithBPFLogByteLimit(16 * 1024 * 1024)) | ||
| topt = infrastructure.DefaultTopologyOptions() | ||
|
|
||
| if bpfLogLevel != "Debug" && !BPFMode() { | ||
| Skip("Skipping QoS control tests with non-debug bpfLogLevel on iptables/nftables mode (for deduplication).") | ||
| } | ||
|
|
||
| switch encap { | ||
| case "none": | ||
| if !BPFMode() { | ||
|
|
@@ -230,6 +226,7 @@ var _ = infrastructure.DatastoreDescribe( | |
|
|
||
| topt.DelayFelixStart = true | ||
| topt.TriggerDelayedFelixStart = true | ||
| topt.FelixLogSeverity = "Debug" | ||
| if BPFMode() { | ||
| topt.ExtraEnvVars["FELIX_BPFLogLevel"] = bpfLogLevel | ||
| } | ||
|
|
@@ -320,7 +317,15 @@ var _ = infrastructure.DatastoreDescribe( | |
| if BPFMode() && BPFAttachType() == "tc" { | ||
| Skip("Skipping QoS control bandwidth tests on BPF TC attach mode.") | ||
| } | ||
|
|
||
| By("Removing all limits from workloads") | ||
| for i := range len(w) { | ||
| w[i].WorkloadEndpoint.Spec.QoSControls = nil | ||
| w[i].UpdateInInfra(infra) | ||
| Eventually(tc.Felixes[i].ExecOutputFn("ip", "r", "get", fmt.Sprintf("10.65.%d.2", i)), "10s").Should(ContainSubstring(w[i].InterfaceName)) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this check effective? I presume the route was already there even with the QoS in place?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I believe I arrived at this because the route churns when the workload endpoint is updated (if my memory doesn't fail me), so I added a wait until it shows up again...
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hmm, that sounds surprising. I would expect TC updates to be independent of route programming, and that a TC update would not require a route change. Might be a real problem hiding here if you really saw route churn.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think it's related to tc, but the FV test infra, or maybe I was too zealous when writing those into every workload update, I'll merge this PR and investigate separately |
||
| } | ||
| }) | ||
|
|
||
| getQdisc := func() string { | ||
| out, err := tc.Felixes[1].ExecOutput("tc", "qdisc") | ||
| logrus.Infof("tc qdisc output:\n%v", out) | ||
|
|
@@ -407,7 +412,29 @@ var _ = infrastructure.DatastoreDescribe( | |
| Expect(err).NotTo(HaveOccurred()) | ||
| err = serverCmd.Process.Release() | ||
| Expect(err).NotTo(HaveOccurred()) | ||
| }) | ||
|
|
||
| It("should correctly apply bandwidth limits when a non-default qdisc exists (handle != 0)", func() { | ||
| By("Replacing the default noqueue qdisc with a non-default qdisc (handle 8001)") | ||
| out, err := tc.Felixes[1].ExecOutput("tc", "qdisc", "replace", "dev", w[1].InterfaceName, "root", "handle", "8001:", "noqueue") | ||
| logrus.Infof("tc qdisc replace output:\n%v", out) | ||
| Expect(err).NotTo(HaveOccurred()) | ||
|
|
||
| By("Waiting for the config to appear in 'tc qdisc'") | ||
| Eventually(getQdisc, "10s", "1s").Should(MatchRegexp(`qdisc noqueue 8001: dev ` + regexp.QuoteMeta(w[1].InterfaceName) + ` root refcnt \d+`)) | ||
|
|
||
| By("Setting 10Mbps limit and 100Mbps peakrate for ingress on workload 1") | ||
| w[1].WorkloadEndpoint.Spec.QoSControls = &internalapi.QoSControls{ | ||
| IngressBandwidth: 10000000, | ||
| IngressBurst: 300000000, | ||
| IngressPeakrate: 100000000, | ||
| } | ||
| w[1].UpdateInInfra(infra) | ||
| Eventually(tc.Felixes[1].ExecOutputFn("ip", "r", "get", "10.65.1.2"), "10s").Should(ContainSubstring(w[1].InterfaceName)) | ||
|
|
||
| By("Waiting for the config to appear in 'tc qdisc'") | ||
| // ingress config should be present | ||
| Eventually(getQdisc, "10s", "1s").Should(MatchRegexp(`qdisc tbf \d+: dev ` + regexp.QuoteMeta(w[1].InterfaceName) + ` root refcnt \d+ rate ` + regexp.QuoteMeta("10Mbit") + `.* peakrate ` + regexp.QuoteMeta("100Mbit"))) | ||
| }) | ||
| }) | ||
|
|
||
|
|
||
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.
Do you mean to check this change in?
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.
yes, absolutely! the issue we're fixing only shows up in the debug logs, so I think it makes sense to have them in this test
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.
I guess it's OK to leave this in. But you only mean for debugging the problem, right? I.e. it is not the case that there was only an issue when log level was debug.