Skip to content

[v3.31] fix(QoS): Use QdiscReplace() instead of QdiscAdd()#11972

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

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

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 01:15
@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
@coutinhop coutinhop requested a review from a team as a code owner March 3, 2026 01:15
@marvin-tigera marvin-tigera added this to the Calico v3.31.5 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

This PR fixes Felix’s Linux dataplane QoS qdisc programming so ingress/egress bandwidth limits can be applied even when the workload interface already has a non-default root qdisc handle, and extends FV coverage to exercise that scenario.

Changes:

  • Switch ingress TBF programming to a create-or-update path that uses netlink.QdiscReplace() (instead of add/update split paths).
  • Use netlink.QdiscReplace() when creating the ingress qdisc used for IFB redirection (egress shaping path).
  • Update QoS FV tests to (a) always run with Felix debug logging, (b) remove a skip that was preventing coverage in iptables/nft modes, and (c) add a new case covering “pre-existing non-default qdisc handle”.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
felix/fv/qos_controls_test.go Adjusts QoS FV setup/logging and adds an FV case for non-default existing qdisc handles.
felix/dataplane/linux/qos_controls.go Routes ingress shaping add/update to a new unified create-or-update API.
felix/dataplane/linux/qos/qos.go Implements create-or-update ingress qdisc and switches relevant qdisc operations to QdiscReplace().

Comment thread felix/fv/qos_controls_test.go
Comment thread felix/fv/qos_controls_test.go
@coutinhop coutinhop merged commit d62d53b into projectcalico:release-v3.31 Mar 4, 2026
2 of 3 checks passed
@coutinhop coutinhop deleted the auto-pick-of-#11899-upstream-release-v3.31 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.

4 participants