Skip to content

feat(site-explorer): pair BF4 DPUs by chassis serial#2906

Merged
poroh merged 1 commit into
NVIDIA:mainfrom
poroh:bf4-dpu-chassis-serial-pairing
Jun 28, 2026
Merged

feat(site-explorer): pair BF4 DPUs by chassis serial#2906
poroh merged 1 commit into
NVIDIA:mainfrom
poroh:bf4-dpu-chassis-serial-pairing

Conversation

@poroh

@poroh poroh commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Classify BF4 devices by part number and use the Bluefield_BMC chassis
serial as the DPU pairing key when system serial and Redfish mode are
absent.

Related issues

Type of Change

  • Add - New feature or capability
  • Change - Changes in existing functionality
  • Fix - Bug fixes
  • Remove - Removed features or deprecated functionality
  • Internal - Internal changes (refactoring, tests, docs, etc.)

Breaking Changes

  • This PR contains breaking changes

Testing

  • Unit tests added/updated
  • Integration tests added/updated
  • Manual testing performed
  • No testing required (docs, internal refactor, etc.)

Additional Notes

@copy-pr-bot

copy-pr-bot Bot commented Jun 26, 2026

Copy link
Copy Markdown

Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually.

Contributors can view more details about this message here.

@coderabbitai

coderabbitai Bot commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 0977dd08-0662-4956-839f-b31f98afa7a0

📥 Commits

Reviewing files that changed from the base of the PR and between 5e41a0f and b8c3ac5.

⛔ Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (7)
  • crates/api-model/src/site_explorer/mod.rs
  • crates/bmc-explorer/src/error.rs
  • crates/bmc-mock/src/hw/bluefield4.rs
  • crates/bmc-mock/src/test_support/mod.rs
  • crates/site-explorer/Cargo.toml
  • crates/site-explorer/src/lib.rs
  • crates/site-explorer/tests/site_explorer.rs
🚧 Files skipped from review as they are similar to previous changes (7)
  • crates/site-explorer/Cargo.toml
  • crates/bmc-mock/src/test_support/mod.rs
  • crates/bmc-mock/src/hw/bluefield4.rs
  • crates/bmc-explorer/src/error.rs
  • crates/site-explorer/src/lib.rs
  • crates/api-model/src/site_explorer/mod.rs
  • crates/site-explorer/tests/site_explorer.rs

Summary by CodeRabbit

  • New Features

    • Added BlueField-4 (BF4) support to site exploration, including BF4 device projection and DPU/host managed host pairing.
    • Enhanced DPU endpoint correlation using a dedicated pairing serial selector.
  • Bug Fixes

    • Improved handling of missing DPU serial and NIC mode data to prevent join failures.
    • Updated BF4 device classification so BF4 PCIe devices are treated as BlueField and included in results.
  • Tests

    • Added an integration test validating BF4 host/DPU pairing via Bluefield BMC chassis serial, including cases where DPU system serial is absent.

Walkthrough

BF4 pairing now uses a dedicated serial helper with Bluefield_BMC fallback, site-explorer matching and ingestion use that key, BF4 mocks and tests cover the path, and Error<B> now reports its embedded Redfish source.

Changes

BF4 DPU pairing and site-explorer projection

Layer / File(s) Summary
BF4 serial contract
crates/api-model/src/site_explorer/mod.rs
BF4 part-number detection is extended, DPU pairing serial selection falls back to Bluefield_BMC chassis serials, DPU projection uses that serial, and explored MLX device joining reads the new pairing key.
Site-explorer pairing flow
crates/site-explorer/src/lib.rs
Managed-host pairing and DPU ingestion now use the pairing serial, and the BF4 default-branch comment is updated.
BF4 mock support
crates/bmc-mock/src/hw/bluefield4.rs, crates/bmc-mock/src/test_support/mod.rs, crates/site-explorer/Cargo.toml
BF4 mock discovery data is populated, the DPU event log seeds a warm-reset entry, and the mock machine helper plus dev dependency support BF4 test setup.
BF4 regression test
crates/site-explorer/tests/site_explorer.rs
The BF4 integration test builds mock host and DPU reports, clears DPU NIC mode, and asserts pairing through the Bluefield_BMC chassis serial.

BMC error source

Layer / File(s) Summary
StdError source impl
crates/bmc-explorer/src/error.rs
Error<B> implements StdError and returns the embedded NvRedfishError<B> from source() for the NvRedfish variant.

Sequence Diagram(s)

sequenceDiagram
  participant identify_managed_hosts
  participant can_ingest_dpu_endpoint
  participant EndpointExplorationReport
  identify_managed_hosts->>EndpointExplorationReport: dpu_pairing_serial_number()
  identify_managed_hosts->>can_ingest_dpu_endpoint: evaluate DPU endpoint
  can_ingest_dpu_endpoint->>EndpointExplorationReport: nic_mode()
  can_ingest_dpu_endpoint->>EndpointExplorationReport: dpu_pairing_serial_number()
  can_ingest_dpu_endpoint-->>identify_managed_hosts: continue when nic_mode is missing and pairing serial exists
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title is concise and accurately describes the main change: BF4 DPU pairing by chassis serial.
Description check ✅ Passed The description matches the changeset by mentioning BF4 classification and Bluefield_BMC chassis serial pairing.
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.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 OpenGrep (1.23.0)
crates/api-model/src/site_explorer/mod.rs

┌──────────────┐
│ Opengrep CLI │
└──────────────┘

�[32m✔�[39m �[1mOpengrep OSS�[0m
�[32m✔�[39m Basic security coverage for first-party code vulnerabilities.

[00.28][ERROR]: unable to find a config; path .coderabbit-opengrep-fallback.yml does not exist

crates/bmc-explorer/src/error.rs

┌──────────────┐
│ Opengrep CLI │
└──────────────┘

�[32m✔�[39m �[1mOpengrep OSS�[0m
�[32m✔�[39m Basic security coverage for first-party code vulnerabilities.

[00.19][ERROR]: unable to find a config; path .coderabbit-opengrep-fallback.yml does not exist

crates/bmc-mock/src/hw/bluefield4.rs

┌──────────────┐
│ Opengrep CLI │
└──────────────┘

�[32m✔�[39m �[1mOpengrep OSS�[0m
�[32m✔�[39m Basic security coverage for first-party code vulnerabilities.

[00.22][ERROR]: unable to find a config; path .coderabbit-opengrep-fallback.yml does not exist

  • 3 others

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

@poroh
poroh force-pushed the bf4-dpu-chassis-serial-pairing branch 5 times, most recently from 895767b to 79dcc0c Compare June 26, 2026 23:38
@poroh
poroh marked this pull request as ready for review June 26, 2026 23:40
@poroh
poroh requested a review from a team as a code owner June 26, 2026 23:40
@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-06-26 23:43:37 UTC | Commit: 79dcc0c

@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.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
crates/rpc/proto/site_explorer.proto (1)

191-199: 🗄️ Data Integrity & Integration | 🟠 Major | 🏗️ Heavy lift

Add a BF4 wire enum instead of documenting it as UNKNOWN.

Line 193 still leaves BF4 without a dedicated MlxDeviceKind, so the new BF4 path is forced to serialize as MLX_DEVICE_KIND_UNKNOWN downstream. That loses the device-kind signal for RPC/CLI consumers and hard-codes the gap into the new BF4 regression coverage.

Suggested proto change
 enum MlxDeviceKind {
   MLX_DEVICE_KIND_UNKNOWN = 0;
   MLX_DEVICE_KIND_BF3_NIC_MODE = 1;
   MLX_DEVICE_KIND_BF3_DPU_MODE = 2;
   MLX_DEVICE_KIND_BF3_SUPER_NIC = 3;
   MLX_DEVICE_KIND_BF2_DPU = 4;
+  MLX_DEVICE_KIND_BF4_DPU = 5;
 }

Append the new value to preserve wire compatibility, then update the Rust part-number mapping and tests to emit it. As per path instructions, crates/rpc/proto/**: review core gRPC protobuf definitions for generated-client impact and wire compatibility.

🤖 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/rpc/proto/site_explorer.proto` around lines 191 - 199, Add a dedicated
BF4 entry to MlxDeviceKind in site_explorer.proto instead of routing BF4 through
MLX_DEVICE_KIND_UNKNOWN. Preserve wire compatibility by appending the new enum
value, then update the Rust part-number mapping logic that derives MlxDeviceKind
from the device part number so BF4 serializes to the new value. Finally, adjust
the existing BF4 regression tests and any RPC/CLI assertions that currently
expect UNKNOWN so they validate the new BF4 wire enum.

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.

Outside diff comments:
In `@crates/rpc/proto/site_explorer.proto`:
- Around line 191-199: Add a dedicated BF4 entry to MlxDeviceKind in
site_explorer.proto instead of routing BF4 through MLX_DEVICE_KIND_UNKNOWN.
Preserve wire compatibility by appending the new enum value, then update the
Rust part-number mapping logic that derives MlxDeviceKind from the device part
number so BF4 serializes to the new value. Finally, adjust the existing BF4
regression tests and any RPC/CLI assertions that currently expect UNKNOWN so
they validate the new BF4 wire enum.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 29ba25b4-8269-4242-adbf-f60d7dcdac18

📥 Commits

Reviewing files that changed from the base of the PR and between 45cb7a1 and 79dcc0c.

⛔ Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (7)
  • crates/api-model/src/site_explorer/mod.rs
  • crates/bmc-explorer/src/error.rs
  • crates/bmc-mock/src/test_support/mod.rs
  • crates/rpc/proto/site_explorer.proto
  • crates/site-explorer/Cargo.toml
  • crates/site-explorer/src/lib.rs
  • crates/site-explorer/tests/site_explorer.rs

@poroh
poroh force-pushed the bf4-dpu-chassis-serial-pairing branch from 79dcc0c to 55f7617 Compare June 27, 2026 01:01
@github-actions

github-actions Bot commented Jun 27, 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 285 6 25 103 7 144
machine-validation-runner 748 30 189 272 36 221
machine_validation 748 30 189 272 36 221
machine_validation-aarch64 748 30 189 272 36 221
nvmetal-carbide 748 30 189 272 36 221
TOTAL 3283 126 781 1197 151 1028

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

@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

🤖 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/bmc-mock/src/hw/bluefield4.rs`:
- Around line 176-197: Add direct test coverage for Bluefield4::discovery_info()
instead of relying only on the Redfish pairing flow. Create a focused
table-driven test around discovery_info() that asserts the machine_arch,
dmi_data, and dpu_info values for BF4 stay correct, or point to an existing test
that already validates those fields. Use the Bluefield4 type and
discovery_info() method as the main anchors so the coverage is easy to find and
maintain.
🪄 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: ae65403f-17e3-402d-a848-4111bbea714f

📥 Commits

Reviewing files that changed from the base of the PR and between 79dcc0c and 55f7617.

⛔ Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (8)
  • crates/api-model/src/site_explorer/mod.rs
  • crates/bmc-explorer/src/error.rs
  • crates/bmc-mock/src/hw/bluefield4.rs
  • crates/bmc-mock/src/test_support/mod.rs
  • crates/rpc/proto/site_explorer.proto
  • crates/site-explorer/Cargo.toml
  • crates/site-explorer/src/lib.rs
  • crates/site-explorer/tests/site_explorer.rs
✅ Files skipped from review due to trivial changes (1)
  • crates/rpc/proto/site_explorer.proto
🚧 Files skipped from review as they are similar to previous changes (6)
  • crates/site-explorer/Cargo.toml
  • crates/bmc-mock/src/test_support/mod.rs
  • crates/bmc-explorer/src/error.rs
  • crates/api-model/src/site_explorer/mod.rs
  • crates/site-explorer/tests/site_explorer.rs
  • crates/site-explorer/src/lib.rs

Comment on lines +176 to +197
DiscoveryInfo {
machine_type: CpuArchitecture::Aarch64.to_string(),
machine_arch: Some(rpc::utils::cpu_architecture_to_rpc(
CpuArchitecture::Aarch64,
)),
dmi_data: Some(DmiData {
board_name: "BlueField-4 DPU".into(),
product_serial: self.product_serial_number.to_string(),
board_serial: carbide_utils::DEFAULT_DPU_DMI_BOARD_SERIAL_NUMBER.into(),
chassis_serial: carbide_utils::DEFAULT_DPU_DMI_CHASSIS_SERIAL_NUMBER.into(),
product_name: "BlueField-4 DPU".into(),
sys_vendor: "Nvidia".into(),
..Default::default()
}),
dpu_info: Some(DpuData {
part_number: self.part_number().into(),
part_description: format!("NVIDIA BlueField-4 {}", self.part_number()),
factory_mac_address: self.host_mac_address.to_string(),
..Default::default()
}),
..Default::default()
}

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.

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
fd -e rs . crates | xargs rg -n "Bluefield4::discovery_info|discovery_info\(|DmiData|DpuData|900-9D4B4|BlueField-4 DPU"

Repository: NVIDIA/infra-controller

Length of output: 13149


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== outline: crates/bmc-mock/src/hw/bluefield4.rs =="
ast-grep outline crates/bmc-mock/src/hw/bluefield4.rs --view expanded || true

echo
echo "== outline: crates/bmc-mock/src/machine_info.rs =="
ast-grep outline crates/bmc-mock/src/machine_info.rs --view expanded | sed -n '1,220p' || true

echo
echo "== search for Bluefield4 discovery tests =="
rg -n "bluefield4\\(|Bluefield4|discovery_info\\(" crates/bmc-mock/src crates/bmc-mock/tests crates/site-explorer/tests crates/host-support/src | sed -n '1,240p'

Repository: NVIDIA/infra-controller

Length of output: 11305


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== bluefield4.rs relevant slice =="
sed -n '160,225p' crates/bmc-mock/src/hw/bluefield4.rs | cat -n

echo
echo "== machine_info.rs around Bluefield4 and tests =="
sed -n '130,230p' crates/bmc-mock/src/machine_info.rs | cat -n

echo
echo "== machine_info.rs test slice around BF4 usage =="
sed -n '460,540p' crates/bmc-mock/src/machine_info.rs | cat -n

echo
echo "== search for discovery_info assertions in bmc-mock tests/modules =="
rg -n "discovery_info\\(\\)|machine_arch|part_description|factory_mac_address|board_name|BlueField-4 DPU" crates/bmc-mock/src crates/bmc-mock/tests crates/site-explorer/tests | sed -n '1,220p'

Repository: NVIDIA/infra-controller

Length of output: 15257


Add direct coverage for Bluefield4::discovery_info()
The BF4 regression currently exercises only the Redfish pairing path; add a focused table-driven test for this method, or point to existing coverage, so the machine_arch, dmi_data, and dpu_info fields do not drift silently.

🤖 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/bmc-mock/src/hw/bluefield4.rs` around lines 176 - 197, Add direct test
coverage for Bluefield4::discovery_info() instead of relying only on the Redfish
pairing flow. Create a focused table-driven test around discovery_info() that
asserts the machine_arch, dmi_data, and dpu_info values for BF4 stay correct, or
point to an existing test that already validates those fields. Use the
Bluefield4 type and discovery_info() method as the main anchors so the coverage
is easy to find and maintain.

Sources: Coding guidelines, Path instructions

@poroh
poroh force-pushed the bf4-dpu-chassis-serial-pairing branch from 55f7617 to 5e41a0f Compare June 27, 2026 03:15

pub fn is_bf4_dpu_part_number(part_number: &str) -> bool {
let normalized_part_number = part_number.to_lowercase();
normalized_part_number.starts_with("900-9d4b4")

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.

Should be a const, no?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

It should but it follows pattern of surroundings. All other part numbers prefixes are defined in corresponding functions. So this refactoring waits its hero.

Classify BF4 devices by part number and use the Bluefield_BMC chassis
serial as the DPU pairing key when system serial and Redfish mode are
absent.

Signed-off-by: Dmitry Porokh <dporokh@nvidia.com>
@poroh
poroh force-pushed the bf4-dpu-chassis-serial-pairing branch from 5e41a0f to b8c3ac5 Compare June 28, 2026 17:35
@poroh
poroh enabled auto-merge (squash) June 28, 2026 17:43
@poroh
poroh merged commit 0082abd into NVIDIA:main Jun 28, 2026
57 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.

3 participants