Skip to content

[v3.30] fix(QoS): Use QdiscReplace() instead of QdiscAdd()#11984

Merged
coutinhop merged 2 commits into
projectcalico:release-v3.30from
coutinhop:auto-pick-of-#11899-upstream-release-v3.30
Mar 4, 2026
Merged

[v3.30] fix(QoS): Use QdiscReplace() instead of QdiscAdd()#11984
coutinhop merged 2 commits into
projectcalico:release-v3.30from
coutinhop:auto-pick-of-#11899-upstream-release-v3.30

Conversation

@coutinhop
Copy link
Copy Markdown
Member

Cherry-pick history

Use QdiscReplace() instead of QdiscAdd() so that adding the TBF qdiscs needed for QoS controls with tc does not error out when there is an existing non-default (handle != 0) qdisc on the interface for any reason.

Add a test case to the felix FVs to cover this.

Also, enable felix debug logging on the QoS felix FVs, and remove overzealous Skip() that was resulting in no test cases running on iptables/nftables modes.

Description

Related issues/PRs

Release Note

Fix failure to enable ingress bandwidth QoS controls when a non-default qdisc previously existed on the workload interface (handle != 0).

Use QdiscReplace() instead of QdiscAdd() so that adding the TBF
qdiscs needed for QoS controls with tc does not error out when
there is an existing non-default (handle != 0) qdisc on the
interface for any reason.

Add a test case to the felix FVs to cover this.

Also, enable felix debug logging on the QoS felix FVs, and
remove overzealous Skip() that was resulting in no test cases
running on iptables/nftables modes.
Copilot AI review requested due to automatic review settings March 3, 2026 23:52
@coutinhop coutinhop requested a review from a team as a code owner March 3, 2026 23:52
@coutinhop coutinhop added release-note-required Change has user-facing impact (no matter how small) docs-not-required Docs not required for this change labels Mar 3, 2026
@marvin-tigera marvin-tigera added this to the Calico v3.30.6 milestone Mar 3, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates Felix QoS bandwidth qdisc programming to use QdiscReplace() (instead of QdiscAdd()) so ingress/egress TBF configuration succeeds even when a workload interface already has a non-default root qdisc handle, and adds FV coverage for that scenario.

Changes:

  • Switch ingress bandwidth qdisc setup to a create-or-update flow using netlink.QdiscReplace().
  • Update egress qdisc paths to use replace semantics for TBF creation/update.
  • Extend Felix FV QoS tests with a case covering a pre-existing non-default root qdisc handle, and enable debug logging for these FVs.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
felix/fv/qos_controls_test.go Adds FV coverage for non-default existing root qdisc handles; enables Felix debug logging in these tests.
felix/dataplane/linux/qos_controls.go Routes ingress QoS qdisc add/update through a single create-or-update helper.
felix/dataplane/linux/qos/qos.go Replaces TBF qdisc add/update with QdiscReplace() and consolidates ingress helpers.

Comment on lines +331 to +336
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,
}
Copy link

Copilot AI Mar 3, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

internalapi.QoSControls is referenced here but internalapi is not imported anywhere in this file (and other test cases in this file use api.QoSControls). This will not compile as-is; switch this to api.QoSControls (consistent with the rest of the FV) or add the correct import/alias if a different type is intended.

Copilot uses AI. Check for mistakes.
@coutinhop coutinhop merged commit 95e64d7 into projectcalico:release-v3.30 Mar 4, 2026
2 of 3 checks passed
@coutinhop coutinhop deleted the auto-pick-of-#11899-upstream-release-v3.30 branch March 4, 2026 20:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs-not-required Docs not required for this change release-note-required Change has user-facing impact (no matter how small)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants