Skip to content

Set DSCP for host endpoints#10825

Merged
mazdakn merged 34 commits intoprojectcalico:masterfrom
mazdakn:dscp-dp-hep
Aug 21, 2025
Merged

Set DSCP for host endpoints#10825
mazdakn merged 34 commits intoprojectcalico:masterfrom
mazdakn:dscp-dp-hep

Conversation

@mazdakn
Copy link
Member

@mazdakn mazdakn commented Aug 15, 2025

Description

Setting DSCP for host endpoint. This is a follow up for the first PR: #10718

Related issues/PRs

Todos

  • Tests
  • Documentation
  • Release note

Release Note

TBD

Reminder for the reviewer

Make sure that this PR has the correct labels and milestone set.

Every PR needs one docs-* label.

  • docs-pr-required: This change requires a change to the documentation that has not been completed yet.
  • docs-completed: This change has all necessary documentation completed.
  • docs-not-required: This change has no user-facing impact and requires no docs.

Every PR needs one release-note-* label.

  • release-note-required: This PR has user-facing changes. Most PRs should have this label.
  • release-note-not-required: This PR has no user-facing changes.

Other optional labels:

  • cherry-pick-candidate: This PR should be cherry-picked to an earlier release. For bug fixes only.
  • needs-operator-pr: This PR is related to install and requires a corresponding change to the operator.

Copilot AI review requested due to automatic review settings August 15, 2025 01:17
@mazdakn mazdakn added release-note-required Change has user-facing impact (no matter how small) docs-pr-required Change is not yet documented labels Aug 15, 2025
@mazdakn mazdakn requested a review from a team as a code owner August 15, 2025 01:17
@marvin-tigera marvin-tigera added this to the Calico v3.31.0 milestone Aug 15, 2025
Copy link
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 implements DSCP (Differentiated Services Code Point) support for host endpoints, building upon the previous work for workload endpoints. It adds the ability to set DSCP values on traffic from host endpoints for quality of service (QoS) marking.

Key changes:

  • Add DSCP field to QoSControls model structures and protobuf definitions
  • Implement QoS policy chain rendering and management for iptables/nftables
  • Add support for DSCP annotations in Kubernetes backend conversion
  • Create comprehensive tests for QoS policy functionality

Reviewed Changes

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

Show a summary per file
File Description
libcalico-go/lib/backend/model/hostendpoint.go Adds QoSControls pointer field to HostEndpoint struct
libcalico-go/lib/backend/k8s/conversion/workload_endpoint_default.go Updates copyright and adds DSCP annotation handling logic
libcalico-go/lib/backend/k8s/conversion/constants.go Updates copyright and adds AnnotationQoSEgressDSCP constant
libcalico-go/lib/apis/v3/zz_generated.deepcopy.go Updates generated deepcopy methods for DSCP field
libcalico-go/lib/apis/v3/workloadendpoint.go Updates copyright and adds DSCP field to QoSControls struct
libcalico-go/lib/apis/v3/generated.openapi.go Adds DSCP field to OpenAPI schema
felix/rules/static_test.go Adds test expectations for QoS policy chain jump rules
felix/rules/static.go Implements QoS policy chain jump logic in mangle table
felix/rules/rule_defs.go Adds QoS policy chain constant and interface method
felix/rules/qos_test.go New comprehensive test file for QoS policy chain rendering
felix/rules/qos.go New implementation file for QoS policy chain rendering
felix/rules/nat.go Updates copyright and renames IPSet constant for consistency
felix/proto/felixbackend.proto Adds QoSPolicy message and fields to endpoint messages
felix/proto/felixbackend.pb.go Generated protobuf code with QoSPolicy support
felix/nftables/actions_test.go Adds test cases for DSCPAction in nftables
felix/nftables/actions.go Implements DSCPAction for nftables dataplane
felix/iptables/actions_test.go Adds test cases for DSCPAction in iptables
felix/iptables/actions.go Implements DSCPAction for iptables dataplane
felix/generictables/actions.go Adds DSCP method to ActionFactory interface
felix/fv/qos_policy_test.go New comprehensive functional test for QoS policies
felix/fv/infrastructure/infra_k8s.go Updates pod annotations for DSCP QoS controls
felix/dataplane/linux/qos_policy_mgr_test.go New unit tests for QoS policy manager
felix/dataplane/linux/qos_policy_mgr.go New QoS policy manager implementation
felix/dataplane/linux/masq_mgr.go Updates IPSet ID constant for consistency
felix/dataplane/linux/int_dataplane.go Registers QoS policy managers for IPv4/IPv6
felix/calc/event_sequencer_test.go Adds DSCP test data and copyright update
felix/calc/event_sequencer.go Converts DSCP from model to protobuf format
api/pkg/openapi/generated.openapi.go Adds DSCP type to OpenAPI definitions
api/pkg/lib/numorstring/numorstring_test.go Adds comprehensive DSCP validation tests
api/pkg/lib/numorstring/dscp.go New DSCP type implementation with validation

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@mazdakn mazdakn requested a review from caseydavenport August 21, 2025 21:04
@caseydavenport caseydavenport added docs-not-required Docs not required for this change release-note-not-required Change has no user-facing impact labels Aug 21, 2025
@marvin-tigera marvin-tigera removed release-note-required Change has user-facing impact (no matter how small) docs-pr-required Change is not yet documented labels Aug 21, 2025
@mazdakn mazdakn merged commit 955e478 into projectcalico:master Aug 21, 2025
4 of 7 checks passed
@mazdakn mazdakn deleted the dscp-dp-hep branch August 21, 2025 23:03
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-not-required Change has no user-facing impact

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants