Skip to content

Support mlxreg Spectrum-X runtime parameters - #409

Merged
almaslennikov merged 1 commit into
Mellanox:mainfrom
almaslennikov:add-spectrumx-mlxreg-runtime
Jul 13, 2026
Merged

Support mlxreg Spectrum-X runtime parameters#409
almaslennikov merged 1 commit into
Mellanox:mainfrom
almaslennikov:add-spectrumx-mlxreg-runtime

Conversation

@almaslennikov

Copy link
Copy Markdown
Collaborator

Summary

  • add optional mlxreg runtime parameters to Spectrum-X profile config
  • execute runtime params in profile order, splitting DMS batches around mlxreg barriers
  • remove the hardcoded cc_probe_mp_mode adaptive-routing special case

Validation

  • go test ./pkg/types/... -v
  • go test ./pkg/spectrumx/... -v
  • go build ./...

@greptile-apps

greptile-apps Bot commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR adds profile-driven mlxreg support for Spectrum-X runtime configuration. The main changes are:

  • Optional mlxreg fields in Spectrum-X profile parameters.
  • Profile-ordered runtime application with DMS batches split around mlxreg entries.
  • Validation for mixed DMS/mlxreg entries and missing mlxreg set values.
  • Numeric mlxreg readback comparison for equivalent hex formats.
  • Removal of the hardcoded hwplb cc_probe_mp_mode write/check path.

Confidence Score: 5/5

This looks safe to merge.

  • No blocking issues found in the changed code.
  • The updated validation rejects the malformed mlxreg cases covered by the earlier review.
  • The mlxreg readback comparison now handles equivalent numeric formats.

Important Files Changed

Filename Overview
pkg/spectrumx/spectrumx.go Adds generic mlxreg runtime parameter handling and profile-ordered DMS batching.
pkg/types/spectrumx.go Adds mlxreg config types and validation for runtime profile parameters.
pkg/spectrumx/spectrumx_test.go Updates runtime configuration tests for mlxreg validation, ordering, and readback matching.
pkg/types/spectrumx_test.go Adds parsing tests for mlxreg profile fields and invalid runtime parameters.

Reviews (4): Last reviewed commit: "Support mlxreg Spectrum-X runtime parame..." | Re-trigger Greptile

Comment thread pkg/spectrumx/spectrumx.go
Comment thread pkg/spectrumx/spectrumx.go
Comment thread pkg/spectrumx/spectrumx.go
Comment thread pkg/spectrumx/spectrumx.go Outdated
@almaslennikov
almaslennikov force-pushed the add-spectrumx-mlxreg-runtime branch from 7d1cac3 to b42efe5 Compare July 13, 2026 09:25
Comment thread pkg/spectrumx/spectrumx.go
Comment thread pkg/spectrumx/spectrumx.go Outdated
Comment thread pkg/spectrumx/spectrumx.go
Comment thread pkg/spectrumx/spectrumx.go
@almaslennikov
almaslennikov force-pushed the add-spectrumx-mlxreg-runtime branch from b42efe5 to ae7f23e Compare July 13, 2026 09:32
@almaslennikov

Copy link
Copy Markdown
Collaborator Author

Addressed the actionable Greptile findings and force-pushed amended commit ae7f23e:

  1. Mixed DMS + mlxreg entries: rejected at profile parse time in pkg/types.ParseSpectrumXConfig, and also rejected in the runtime path before flushing any pending DMS batch. A malformed profile can no longer write an earlier DMS batch and then fail on mlxreg validation.
  2. Empty mlxreg set values: rejected at profile parse time and in runtime validation. mlxreg --set name= is no longer built for omitted YAML values.
  3. Hex-width comparison: mlxreg readback comparison now treats equivalent numeric values as equal, so 0x1 and 0x00000001 converge correctly.
  4. HWPLB register optionality: this part is intentional for this PR. The previous hardcoded cc_probe_mp_mode workaround is removed by design; the Spectrum-X profile now owns whether the mlxreg parameter is present and where it appears relative to DMS batches.

Validation run:

  • go test ./pkg/types/... -v
  • go test ./pkg/spectrumx/... -v
  • go test ./internal/controller/... -run SpectrumXProfile -v
  • go build ./...
  • git diff --check

I also tried go test ./...; it is blocked in this local worktree by missing envtest binaries (../../bin/k8s/1.31.0-darwin-arm64/etcd) and no active Kubernetes cluster for e2e tests, while the package suites above passed.

Comment thread pkg/spectrumx/spectrumx.go
Signed-off-by: Alexander Maslennikov <amaslennikov@nvidia.com>
@almaslennikov
almaslennikov force-pushed the add-spectrumx-mlxreg-runtime branch from ae7f23e to 370692f Compare July 13, 2026 09:41
@wpeng102

Copy link
Copy Markdown

/lgtm

@almaslennikov
almaslennikov merged commit 77a6139 into Mellanox:main Jul 13, 2026
13 of 15 checks passed
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