Skip to content

patch(v2.1): discover host NICs through nv-redfish adapter ports - #4832

Merged
nv-dmendoza merged 2 commits into
NVIDIA:release/v2.1from
chet:cherry-pick-4534-v2.1
Aug 11, 2026
Merged

patch(v2.1): discover host NICs through nv-redfish adapter ports#4832
nv-dmendoza merged 2 commits into
NVIDIA:release/v2.1from
chet:cherry-pick-4534-v2.1

Conversation

@chet

@chet chet commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Important

This PR cherry-picks two commits into release/v2.1:

Site Explorer's default nv-redfish path can now find an ordinary host NIC when the System EthernetInterfaces collection has no usable MACs but the chassis NetworkAdapter Ports do. The fallback keeps System interfaces authoritative, prefers standard Port MACs before Lenovo OEM data, and fetches Port links independently so one failed member does not hide valid siblings.

#4788 rides along because it fixes the secret-scan failure this branch hits. copy-pr-bot can rewrite its synthetic PR branch, so github.event.before is unusable and TruffleHog falls back to scanning the whole repository -- on this branch that surfaced 117 unrelated findings and failed REST Secret Scan with TruffleHog (and with it the rest-ci-pass rollup) on every recent release/v2.1 PR, merged ones included. The resolver computes the current PR's merge-base and head for both Core and REST synthetic scans, so the scan is scoped to this PR's own commits.

Related issues

This supports #4469 and #4786

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

cargo test -p bmc-explorer (30 passed, including the new network_adapter_port_explore suite) and cargo test -p carbide-site-explorer 'redfish::tests::' --lib (6 passed) pass on the branch. bash .github/ci/test-resolve-pr-scan-range.sh passes, and both workflow files still parse.

Additional Notes

#4534 -- three conflicts, all visibility drift. release/v2.1 does not have #4662 (refactor(bmc/console): adopt style guide rules for pub/module visibility), so bmc-explorer here still uses pub where main uses pub(crate). chassis.rs and network_adapter.rs keep this branch's pub and take only the new fetch_network_adapter_ports method and ports field; #4662 is style-only and is intentionally not pulled in. bluefield3_explore.rs conflicted because #4534's new test anchors directly after explore_bluefield3_ignores_invalid_system_interface_mac, which belongs to a different commit that is not on this branch -- only #4534's own explore_bluefield3_preserves_oem_mode_and_base_mac is added here.

#4788 -- one conflict in .github/workflows/ci.yaml, because this branch already carries #4715's earlier Core-only workaround. Resolved to keep release-specific workflow behavior: #4788's resolver now backs synthetic PR scans in both Core (ci.yaml) and REST (rest-ci.yml), the existing Core tag-scan branch is preserved, and the resolver plus its focused test come along. The surrounding CI steps in that hunk (check-ci-permissions.sh, check-core-ci-permissions.sh, check-stale-ci-permissions.sh, check-ci-concurrency.sh, test_check_ci_gate.py, check_ci_gate.py) are from other commits and reference scripts that do not exist on this branch, so they are deliberately left out -- every script referenced by ci.yaml here resolves.

Migration is additive and safe. 20260810143726_index_explored_endpoint_port_macs.sql sorts after this branch's latest migration (20260731143022), so it appends without disturbing existing checksums. It drops and recreates explored_endpoints_mac_addresses_idx, and that index's pre-state is byte-identical on release/v2.1 and main (both from 20260708172302_squash_snapshot.sql), so the rebuild behaves the same here.

No dependency bump needed. The adapter-port support this relies on is already on the branch -- nv-redfish is pinned at 0.14.2, matching main (via #4785).

Site Explorer's default nv-redfish path can now find an ordinary host NIC when the System EthernetInterfaces collection has no usable MACs but the chassis NetworkAdapter Ports do.

The fallback keeps System interfaces authoritative, prefers standard Port MACs before Lenovo OEM data, and fetches Port links independently so one failed member does not hide valid siblings.

This supports NVIDIA#4469

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

(cherry picked from commit c79d042)
@chet
chet requested a review from a team August 11, 2026 19:02
@coderabbitai

coderabbitai Bot commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 05ea7ee6-3cb5-403d-b152-929babc51e26

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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

@github-actions

github-actions Bot commented Aug 11, 2026

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-08-11 19:24:41 UTC | Commit: d738d66

`github.event.before` works for ordinary branch pushes, but `copy-pr-bot` can replace that commit when it rewrites a synthetic PR branch. Resolve the current pull request merge-base and head for every Core and REST synthetic scan instead.

- Expected green-run effect: First REST pushes stop scanning repository history; steady-state timing should be effectively unchanged.

- What it really buys us: A green secret check proves the current pull request range was resolved and passed to the scanner, even after a rebase or force-push.

Tests added!

This supports NVIDIA#4786

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

(cherry picked from commit e9c13b3)
@chet
chet requested a review from a team as a code owner August 11, 2026 19:21

@nv-dmendoza nv-dmendoza left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM, also fixes the truffle scans

@nv-dmendoza
nv-dmendoza merged commit 7c1110b into NVIDIA:release/v2.1 Aug 11, 2026
123 checks passed
@chet
chet deleted the cherry-pick-4534-v2.1 branch August 12, 2026 00:20
nv-dmendoza pushed a commit that referenced this pull request Aug 14, 2026
> [!IMPORTANT]
> This PR cherry-picks commit 1badba5
(#4968) into `release/v2.1`.

Lenovo XCC can report usable onboard `ComputerSystem.EthernetInterfaces`
while exposing an installed ConnectX NIC only through a linked chassis
`NetworkAdapter.Port`. The adapter-Port fetch treated any System MAC as
proof that inventory was complete, so the declared NoDpu boot NIC never
reached `predicted_machine_interfaces`.

So, this keeps the verified Lenovo + `ComputerSystem.Links.Chassis`
boundary, but collects adapter Ports as supplemental inventory even when
System interfaces exist. Site Explorer still uses System interfaces as
Host candidates; it adds a Port MAC alongside them only when that MAC
was actually reported by hardware and `ExpectedMachine` declares it as a
Host interface. It does not synthesize `EthernetInterfaces`, treat the
declaration as an override, or use a Port ID as a boot-interface ID.

A refreshed report can now add that MAC to an existing predicted host,
keep its boot target MAC-only, and leave already-managed hosts alone.
Retained boot metadata is consulted only when a predicted host has no
primary, so an unrelated stale record cannot replace a settled primary.

## Related issues

This supports #4952

## Type of Change

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

## Breaking Changes

- [ ] **This PR contains breaking changes**

## Testing

- [x] Unit tests added/updated
- [x] Integration tests added/updated
- [ ] Manual testing performed
- [ ] No testing required (docs, internal refactor, etc.)

`cargo test -p bmc-explorer -p carbide-site-explorer --lib` and the
`zero_dpu` integration tests pass on the branch.

## Additional Notes

**One conflict, in `crates/bmc-explorer/src/lib.rs`.** It was the test
module's `use super::{...}` list: the incoming side also imports
`should_fetch_bf4_chassis_except_irot_nic`, which #4968 does not add and
this branch does not have -- it comes from the BlueField-4 IRoT chassis
work on `main`. Resolved to this branch's existing names plus #4968's
new `should_fetch_supplemental_network_adapter_ports`; nothing else
references the BF4 helper here. The rest of the pick applied cleanly.

**Prerequisite is already on this branch.** #4968 builds on the
adapter-Port fetch from #4534, which landed here in #4832, so
`fetch_network_adapter_ports` is present and this is a true follow-on
rather than a partial backport.

`crates/site-explorer` picks up an `axum` dev dependency; it resolves
against this branch's existing workspace pin (`0.8.4`), so no
`Cargo.toml` workspace change was needed.
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