Skip to content

fix: separate SKU from operating mode in mlx-devices#3346

Merged
chet merged 1 commit into
NVIDIA:mainfrom
chet:gh-issue-3345
Jul 10, 2026
Merged

fix: separate SKU from operating mode in mlx-devices#3346
chet merged 1 commit into
NVIDIA:mainfrom
chet:gh-issue-3345

Conversation

@chet

@chet chet commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

NICo's mode detection was right and the operator surfaces were reporting incorrectly: mlx-devices presented its part-number classification as the card's operating mode, which can make a correctly-detected NIC-mode flip look like a mode-mismatch bug (kind: "BlueField-3 (DPU mode)" next to nic_mode: "NIC" on the same card). Part numbers are factory SKUs and never change with the mode -- nic_mode, read from the DPU BMC, is the operating mode.

Primary callouts are:

  • kind labels are now NVIDIA product names ("BlueField-3 DPU" / "BlueField-3 SuperNIC") -- the SKU, with the part-number column as the discriminator.
  • --nic-mode-only filters on the authoritative nic_mode, falling back to the SuperNIC SKUs only when the mode is unknown -- a flipped 900-9D3B6 running as a NIC is now included, a 900-9D3B4 running as a DPU no longer is.
  • Dead MlxDeviceKind::is_nic_mode() dropped; MlxDeviceKind doc comments corrected in api-model + proto (REST snapshots regenerated).
  • The nic_mode NICo reads is the documented query surface -- the OEM extension (Systems/Bluefield/Oem/Nvidia Mode), the same OEM-for-BF3 / BIOS-for-BF2 precedence bmc-explorer already codifies. (An operator-doc note on verifying the mode was dropped from this PR; it can land separately after tech-writer review.)

Tests added!

This supports #3345

@chet chet requested review from a team and polarweasel as code owners July 10, 2026 00:09
@chet

chet commented Jul 10, 2026

Copy link
Copy Markdown
Contributor Author

@coderabbitai full_review, thanks!

@coderabbitai

coderabbitai Bot commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Walkthrough

The PR separates factory-SKU device classification from current reported NIC/DPU operating mode. CLI filtering now prioritizes nic_mode, falls back to SKU classification when unknown, and updates BlueField-3 labels, help text, and tests.

Changes

MLX device mode semantics

Layer / File(s) Summary
Device kind and mode contracts
crates/api-model/src/site_explorer/mod.rs, crates/rpc/proto/site_explorer.proto, rest-api/proto/core/src/v1/site_explorer_nico.proto
Documentation distinguishes factory part-number classification from authoritative runtime nic_mode; BlueField-3 display labels now use BlueField-3 SuperNIC or BlueField-3 DPU.
NIC filtering and labeling
crates/admin-cli/src/site_explorer/mlx_devices/args.rs, crates/admin-cli/src/site_explorer/mlx_devices/cmd.rs
--nic-mode-only uses reported NIC mode when available and SKU fallback otherwise; help text, labels, and precedence tests reflect the updated behavior.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant MlxDevicesCommand
  participant ExploredMlxDevice
  participant MlxDeviceKind
  MlxDevicesCommand->>ExploredMlxDevice: evaluate operating_as_nic
  ExploredMlxDevice->>ExploredMlxDevice: use reported nic_mode when present
  ExploredMlxDevice->>MlxDeviceKind: use device_kind when nic_mode is unknown
  MlxDeviceKind-->>MlxDevicesCommand: return NIC classification
Loading

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title accurately captures the main change: separating SKU-based classification from runtime operating mode in mlx-devices.
Description check ✅ Passed The description is directly about the same mlx-devices/SKU vs operating-mode change and matches the implemented updates.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands.

@coderabbitai

coderabbitai Bot commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

@chet, you're welcome! I'll redo the full review of this PR now.

(=^・ω・^=)

✅ Action performed

Full review finished.

@github-actions

Copy link
Copy Markdown

🔐 TruffleHog Secret Scan

No secrets or credentials found!

Your code has been scanned for 700+ types of secrets and credentials. All clear! 🎉

🔗 View scan details

🕐 Last updated: 2026-07-10 00:14:45 UTC | Commit: 6ceba92

@github-actions

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (1)
crates/admin-cli/src/site_explorer/mlx_devices/cmd.rs (1)

195-255: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Prefer the repository’s shared table-test helpers.

This test is table-driven, but total boolean mappings should use value_scenarios! or check_values to keep scenario labeling and test structure consistent.

As per coding guidelines, prefer value_scenarios! for total operations.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@crates/admin-cli/src/site_explorer/mlx_devices/cmd.rs` around lines 195 -
255, Refactor the table-driven test
operating_as_nic_prefers_reported_mode_over_sku to use the repository’s shared
value_scenarios! or check_values helper for this total boolean mapping. Preserve
all existing device_kind, nic_mode, expected-result combinations and scenario
labels while removing the custom Case struct and manual loop.

Source: Coding guidelines

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@crates/admin-cli/src/site_explorer/mlx_devices/cmd.rs`:
- Around line 112-119: Update operating_as_nic to convert nic_mode with
NicMode::try_from(mode).ok(), treating invalid or unknown values like None;
return true for NicMode::Nic, otherwise apply the existing BF3 SKU fallback for
absent or unrecognized modes.

---

Nitpick comments:
In `@crates/admin-cli/src/site_explorer/mlx_devices/cmd.rs`:
- Around line 195-255: Refactor the table-driven test
operating_as_nic_prefers_reported_mode_over_sku to use the repository’s shared
value_scenarios! or check_values helper for this total boolean mapping. Preserve
all existing device_kind, nic_mode, expected-result combinations and scenario
labels while removing the custom Case struct and manual loop.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: ed6b2d73-9219-4eef-92ad-2a8824736535

📥 Commits

Reviewing files that changed from the base of the PR and between ef614d2 and 6ceba92.

⛔ Files ignored due to path filters (1)
  • rest-api/proto/core/gen/v1/site_explorer_nico.pb.go is excluded by !**/*.pb.go, !**/gen/**, !rest-api/**/*.pb.go
📒 Files selected for processing (6)
  • crates/admin-cli/src/site_explorer/mlx_devices/args.rs
  • crates/admin-cli/src/site_explorer/mlx_devices/cmd.rs
  • crates/api-model/src/site_explorer/mod.rs
  • crates/rpc/proto/site_explorer.proto
  • docs/provisioning/boot-interfaces-and-dpu-modes.md
  • rest-api/proto/core/src/v1/site_explorer_nico.proto

Comment thread crates/admin-cli/src/site_explorer/mlx_devices/cmd.rs
@github-actions

github-actions Bot commented Jul 10, 2026

Copy link
Copy Markdown

🔍 Container Scan Summary

Service Total Critical High Medium Low Other
boot-artifacts-aarch64 3 0 0 3 0 0
boot-artifacts-x86_64 3 0 0 3 0 0
forge-admin-cli-x86_64 271 13 34 91 7 126
machine-validation-runner 804 40 237 296 36 195
machine_validation 804 40 237 296 36 195
machine_validation-aarch64 804 40 237 296 36 195
nvmetal-carbide 804 40 237 296 36 195
TOTAL 3493 173 982 1281 151 906

Per-CVE detail lives in the per-service grype-* artifacts (JSON + SARIF). Severity counts only — no CVE IDs published here.

@chet chet changed the title fix: separate BlueField SKU from operating mode in mlx-devices fix: separate SKU from operating mode in mlx-devices Jul 10, 2026
`site-explorer mlx-devices` now reports what its part-number classification actually is -- the card's factory SKU -- and leaves the operating mode to `nic_mode`, the value read from the DPU's own BMC. The old labels presented the SKU as the mode ("BlueField-3 (DPU mode)" / "(NIC mode)"), built on a false premise: part numbers never change when a card flips between DPU and NIC mode. QA2 has the live counterexample -- a `900-9D3B6` DPU flipped into NIC mode (OEM `Mode = NicMode`, Arm complex `Paused`, host booted through its PF) that the CLI printed as `kind: "BlueField-3 (DPU mode)"` next to `nic_mode: "NIC"`, which read as NICo contradicting itself and got filed as a mode-mismatch bug.

`--nic-mode-only` now follows the authoritative signal too: a flipped `900-9D3B6` running as a NIC (exactly the card whose firmware scout can't see) is included, a `900-9D3B4` running as a DPU is not, and the SuperNIC SKUs still match when the mode is unknown. The new `kind` labels are just NVIDIA's product names ("BlueField-3 DPU" / "BlueField-3 SuperNIC"), with the part-number column as the discriminator. The `MlxDeviceKind` doc comments (api-model + proto, with the regenerated REST snapshots) explain the SKU-vs-mode split, and the dead `MlxDeviceKind::is_nic_mode()` is dropped. The `nic_mode` NICo reads is the OEM extension (`Systems/Bluefield/Oem/Nvidia` `Mode`) -- the surface the BlueField BMC manual documents for querying the mode, and the same OEM-for-BF3 / BIOS-for-BF2 precedence `bmc-explorer` already codifies.

Tests added!

This supports NVIDIA#3345

Signed-off-by: Chet Nichols III <chetn@nvidia.com>
@chet

chet commented Jul 10, 2026

Copy link
Copy Markdown
Contributor Author

@coderabbitai full_review, thanks!

@coderabbitai

coderabbitai Bot commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

@chet, you're welcome! I'll redo the full review of this PR now.

✅ Action performed

Full review finished.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (2)
crates/admin-cli/src/site_explorer/mlx_devices/cmd.rs (2)

195-256: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Use the repository’s standard table-driven test helper.

This total boolean operation uses a bespoke local case table and loop. Prefer value_scenarios!, or check_values if the multi-field setup would obscure the table, to keep test diagnostics and conventions consistent.

As per coding guidelines, total operations should prefer value_scenarios! and table-driven helpers from carbide-test-support.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@crates/admin-cli/src/site_explorer/mlx_devices/cmd.rs` around lines 195 -
256, Replace the bespoke Case array and manual loop in
operating_as_nic_prefers_reported_mode_over_sku with the repository-standard
value_scenarios! helper, using each scenario name, device_kind, nic_mode, and
expected boolean as table inputs and preserving the assertion diagnostics. Use
check_values only if value_scenarios! cannot express the multi-field setup
cleanly.

Source: Coding guidelines


122-127: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

Add regression coverage for the new labels.

kind_label now changes user-visible output, but the added tests only cover filtering and firmware comparison. Assert that both SuperNIC variants render as BlueField-3 SuperNIC and Bf3DpuMode renders as BlueField-3 DPU.

As per path instructions, changed Rust behavior should have focused test coverage.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@crates/admin-cli/src/site_explorer/mlx_devices/cmd.rs` around lines 122 -
127, Add focused regression tests for the user-visible labels returned by
kind_label: assert Bf3NicMode and Bf3SuperNic both produce "BlueField-3
SuperNIC", and Bf3DpuMode produces "BlueField-3 DPU". Place the assertions with
the existing mlx_devices tests, covering the enum-to-i32 conversion expected by
kind_label.

Source: Path instructions

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@crates/admin-cli/src/site_explorer/mlx_devices/cmd.rs`:
- Around line 195-256: Replace the bespoke Case array and manual loop in
operating_as_nic_prefers_reported_mode_over_sku with the repository-standard
value_scenarios! helper, using each scenario name, device_kind, nic_mode, and
expected boolean as table inputs and preserving the assertion diagnostics. Use
check_values only if value_scenarios! cannot express the multi-field setup
cleanly.
- Around line 122-127: Add focused regression tests for the user-visible labels
returned by kind_label: assert Bf3NicMode and Bf3SuperNic both produce
"BlueField-3 SuperNIC", and Bf3DpuMode produces "BlueField-3 DPU". Place the
assertions with the existing mlx_devices tests, covering the enum-to-i32
conversion expected by kind_label.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 81eac3d4-d179-4dbf-be2f-ff82deb70d84

📥 Commits

Reviewing files that changed from the base of the PR and between 6ac0588 and 6af3060.

⛔ Files ignored due to path filters (1)
  • rest-api/proto/core/gen/v1/site_explorer_nico.pb.go is excluded by !**/*.pb.go, !**/gen/**, !rest-api/**/*.pb.go
📒 Files selected for processing (5)
  • crates/admin-cli/src/site_explorer/mlx_devices/args.rs
  • crates/admin-cli/src/site_explorer/mlx_devices/cmd.rs
  • crates/api-model/src/site_explorer/mod.rs
  • crates/rpc/proto/site_explorer.proto
  • rest-api/proto/core/src/v1/site_explorer_nico.proto

@chet chet enabled auto-merge (squash) July 10, 2026 17:12
@chet chet merged commit 1350f68 into NVIDIA:main Jul 10, 2026
116 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