Skip to content

SuppressARP per VNI - #554

Draft
adamtrizuljak-sap wants to merge 2 commits into
mainfrom
feat/nve-suppress-arp-per-vni
Draft

SuppressARP per VNI#554
adamtrizuljak-sap wants to merge 2 commits into
mainfrom
feat/nve-suppress-arp-per-vni

Conversation

@adamtrizuljak-sap

Copy link
Copy Markdown
Contributor

Summary

Adds per-VNI ARP suppression to EVPNInstance, complementing the existing NVE-level SuppressARP. The new field supports three states:

  • Unset (nil): the NVE-level SuppressARP setting takes precedence on the device
  • true: ARP suppression is explicitly enabled for this VNI
  • false: ARP suppression is explicitly disabled for this VNI, overriding the NVE-level setting

Changes

API (api/core/v1alpha1/evpninstance_types.go)

Added SuppressARP *bool to EVPNInstanceSpec. A pointer is used to distinguish nil (inherit) from an explicit false, consistent with other optional bool fields in this package (Passive, LogAdjacencyChanges, PrependLocalAS). No kubebuilder default is applied — that would collapse the nil state.

Provider struct (internal/provider/cisco/nxos/nve.go)

Changed VNI.SuppressARP from bool to Option[bool]. The Option[T] type marshals to "DME_UNSET_PROPERTY_MARKER" when its value is nil, which instructs the NX-OS DME to clear the per-VNI leaf and fall back to the NVE-global value. A plain bool would always send false, silently overriding the global setting on every reconcile.

Provider mapping (internal/provider/cisco/nxos/provider.go)

Wires the new API field into EnsureEVPNInstance. NewOption is intentionally bypassed here because NewOption(false) returns a zero Option (unset), making explicit false indistinguishable from nil. The struct is initialized directly instead:

if req.EVPNInstance.Spec.SuppressARP != nil {
    v := *req.EVPNInstance.Spec.SuppressARP
    vni.SuppressARP = Option[bool]{Value: &v}
}

Tests

Updated testdata/vni.json to include "suppressARP": "DME_UNSET_PROPERTY_MARKER" (reflecting the new zero-value serialization of Option[bool])
Added golden files and fixtures for explicit true and false cases (vni_suppress_arp_true, vni_suppress_arp_false)

YANG path

System/eps-items/epId-items/Ep-list[epId=1]/nws-items/vni-items/Nw-list[vni={vni}]/suppressARP

@github-actions github-actions Bot added the size/M label Sep 9, 2026
This enables us to set the SuppressARP field individually per VNI.
VNI.SuppressARP is of type Option[bool]. When nil (zero), the Option marshals to "DME_UNSET_PROPERTY_MARKER", which instructs the device to clear the per-VNI setting and let the global NVE.SuppressARP take precedence.

Signed-off-by: Adam Trizuljak <adam.trizuljak@sap.com>
@adamtrizuljak-sap
adamtrizuljak-sap force-pushed the feat/nve-suppress-arp-per-vni branch from b553bbf to c72cb2d Compare September 9, 2026 11:13
@adamtrizuljak-sap
adamtrizuljak-sap marked this pull request as draft September 9, 2026 11:19
Signed-off-by: Adam Trizuljak <adam.trizuljak@sap.com>
@github-actions

github-actions Bot commented Sep 9, 2026

Copy link
Copy Markdown

Merging this branch will decrease overall coverage

Impacted Packages Coverage Δ 🤖
github.com/ironcore-dev/network-operator/api/core/v1alpha1 2.51% (-0.00%) 👎
github.com/ironcore-dev/network-operator/internal/provider/cisco/nxos 9.45% (-0.01%) 👎

Coverage by file

Changed files (no unit tests)

Changed File Coverage Δ Total Covered Missed 🤖
github.com/ironcore-dev/network-operator/api/core/v1alpha1/evpninstance_types.go 12.50% (ø) 8 1 7
github.com/ironcore-dev/network-operator/api/core/v1alpha1/zz_generated.deepcopy.go 0.00% (ø) 2697 (+4) 0 2697 (+4)
github.com/ironcore-dev/network-operator/internal/provider/cisco/nxos/nve.go 72.73% (ø) 11 8 3
github.com/ironcore-dev/network-operator/internal/provider/cisco/nxos/option.go 46.67% (ø) 15 7 8
github.com/ironcore-dev/network-operator/internal/provider/cisco/nxos/provider.go 0.35% (-0.00%) 2289 (+3) 8 2281 (+3) 👎

Please note that the "Total", "Covered", and "Missed" counts above refer to code statements instead of lines of code. The value in brackets refers to the test coverage of that file in the old version of the code.

Changed unit test files

  • github.com/ironcore-dev/network-operator/internal/provider/cisco/nxos/nve_test.go

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant