Skip to content

Forward-port DisableSegmentation Offload#221

Open
chdxD1 wants to merge 3 commits intomainfrom
feature/disable-segmentation
Open

Forward-port DisableSegmentation Offload#221
chdxD1 wants to merge 3 commits intomainfrom
feature/disable-segmentation

Conversation

@chdxD1
Copy link
Copy Markdown
Member

@chdxD1 chdxD1 commented Feb 11, 2026

With nwop 0.2.x we introduced a flag in Layer2 networks to limit GRO of the packets for specific VLANs. This is needed by apps that use AF_PACKET with a fixed buffer size (#174).

This adds the flag and adds it to the reference implementation

@github-actions
Copy link
Copy Markdown

github-actions bot commented Feb 11, 2026

⚠️ Deprecation Warning: The deny-licenses option is deprecated for possible removal in the next major release. For more information, see issue 997.

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

OpenSSF Scorecard

PackageVersionScoreDetails
gomod/github.com/safchain/ethtool 0.7.0 🟢 4.4
Details
CheckScoreReason
Code-Review🟢 6Found 7/11 approved changesets -- score normalized to 6
Maintained🟢 34 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 3
Dangerous-Workflow🟢 10no dangerous workflow patterns detected
Packaging⚠️ -1packaging workflow not detected
Binary-Artifacts🟢 10no binaries found in the repo
Token-Permissions⚠️ 0detected GitHub workflow tokens with excessive permissions
Pinned-Dependencies🟢 10all dependencies are pinned
CII-Best-Practices⚠️ 0no effort to earn an OpenSSF best practices badge detected
Security-Policy⚠️ 0security policy file not detected
License🟢 10license file detected
Fuzzing⚠️ 0project is not fuzzed
Signed-Releases⚠️ -1no releases found
Branch-Protection⚠️ 0branch protection not enabled on development/release branches
SAST⚠️ 0SAST tool is not run on all commits -- score normalized to 0

Scanned Files

  • go.mod

With nwop 0.2.x we introduced a flag in Layer2 networks to limit GRO
of the packets for specific VLANs. This is needed by apps that use
AF_PACKET with a fixed buffer size (#174).

This adds the flag and adds it to the reference implementation
@chdxD1 chdxD1 force-pushed the feature/disable-segmentation branch from bff3e8d to f4f7915 Compare February 11, 2026 11:09
@chdxD1 chdxD1 requested a review from Copilot March 2, 2026 14:49
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

Adds a new Layer2 configuration flag to disable segmentation offload (GRO/GSO/TSO) on VLAN interfaces, intended to keep packet sizes bounded by MTU for AF_PACKET consumers.

Changes:

  • Introduces disableSegmentation to the Layer2-related APIs/CRDs and wires it into the CRA-FRR netlink configuration payload.
  • Implements VLAN offload toggling via github.com/safchain/ethtool in the pkg/nl reconciliation path, with accompanying unit tests and test hooks.
  • Adjusts several Layer2 iteration loops to take stable element addresses (index-based loop).

Reviewed changes

Copilot reviewed 17 out of 18 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
pkg/reconciler/operator/layer2.go Iteration change for Layer2 revisions when building NodeNetworkConfig and netplan VLANs
pkg/reconciler/operator/bgp.go Iteration change when scanning Layer2 revisions for BGP peering VLAN lookup
pkg/reconciler/agent-cra-frr/nodenetworkconfig_reconciler.go Adds DisableSegmentation to the netlink Layer2Information payload
pkg/nl/layer2.go Adds DisableSegmentation to Layer2Information and applies it during L2 reconciliation via ethtool
pkg/nl/ethtool_interface.go Introduces an ethtool interface + factory for production and test injection
pkg/nl/mock_ethtool.go Adds a mock ethtool implementation used by unit tests
pkg/nl/nl_test.go Mocks ethtool for existing ReconcileL2 success test; adds new unit tests for reconcileSegmentation()
api/v1alpha1/nodenetworkconfig_types.go Adds DisableSegmentation to the per-node Layer2 API type
api/v1alpha1/layer2networkconfiguration_types.go Adds DisableSegmentation to Layer2NetworkConfigurationSpec
config/crd/bases/network.t-caas.telekom.com_layer2networkconfigurations.yaml CRD schema + controller-gen annotation update
config/crd/bases/network.t-caas.telekom.com_networkconfigrevisions.yaml CRD schema + controller-gen annotation update
config/crd/bases/network.t-caas.telekom.com_nodenetworkconfigs.yaml CRD schema + controller-gen annotation update
config/crd/bases/network.t-caas.telekom.com_nodenetplanconfigs.yaml controller-gen annotation update
config/crd/bases/network.t-caas.telekom.com_vrfrouteconfigurations.yaml controller-gen annotation update
config/crd/bases/network.t-caas.telekom.com_bgppeerings.yaml controller-gen annotation update
go.mod Adds github.com/safchain/ethtool dependency
go.sum Adds checksums for github.com/safchain/ethtool
Makefile Bumps controller-gen version used to generate manifests

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

- Move MockEthtool to test file to exclude from production binaries
- Propagate DisableSegmentation field into NodeNetworkConfig
- Guard reconcileSegmentation to only run when flag is set
- Apply segmentation settings in CreateL2 for initial VLAN creation
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

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


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

- Reconcile segmentation unconditionally in ReconcileL2 so toggling
  DisableSegmentation back to false re-enables GRO/GSO/TSO
- Include VLAN interface name in reconcileSegmentation error messages
- Reuse createVLAN return value in setupVXLAN, assign to
  info.vlanInterface for CleanupL2, remove redundant LinkByName
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

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


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants