← Back to Pull requests

feat(inventory): inherit hardware attributes for ipvlan and macvlan d… #417

Open
unknown opened this pull request with 261 lines diff across 3 files
View on GitHub
unknown unknown commented on Nov 12, 2026 09:53 UTC
Author

What type of PR is this?

/kind feature

What this PR does / why we need it:

Virtual interfaces such as ipvlan and macvlan currently lack the hardware attributes of their underlying physical NIC, limiting topology-aware device selection.

This PR resolves physical parents through netlink parent indices and copies PCI vendor, product, subsystem, NUMA node, and PCIe root attributes to ipvlan/macvlan devices. Each virtual interface retains its independent DRA device identity and interface attributes.

Parent resolution supports nested ipvlan/macvlan/VLAN chains and stops safely when parents are missing or cycles are detected. Attribute inheritance uses an explicit allowlist and deep copies attribute values.

Which issue(s) this PR is related to:

Fixes #261

Special notes for your reviewer:

Testing completed:

  • Passed all 10 subtests in TestInheritParentAttributes, covering ipvlan/macvlan, nested parent chains, VLAN parents, missing parents, cycles, and veth exclusion. The tests also verify shared-parent handling and attribute isolation.

  • Passed the pkg/inventory test suite, including race detection.

  • Reproduced the missing hardware attributes with DRANET v1.5.0 on a Kubernetes node with a Mellanox ConnectX-6 NIC.

  • Built and deployed the updated image, then verified both macvlan and ipvlan through the published ResourceSlices. Both devices correctly exposed the parent's PCI vendor, product, subsystem, NUMA node (1), and PCIe root (pci0000:bf).

  • Verified independent device identity and interface attributes, with the parent's PCI address and IPv4 address absent from the child devices.

  • Observed identical RDMA attributes before and after the change. RDMA attributes continue to be populated by the existing discovery logic.

  • Removed the test interfaces after validation.
  • Does this PR introduce a user-facing change?

    ``release-note
    DRANET now publishes the underlying physical NIC's PCI vendor, product, subsystem, NUMA node, and PCIe root attributes for ipvlan and macvlan devices, enabling topology-aware device selection.
    ``

    Diff: 261 lines (+195 / -66) across 3 files Reviewer: aojea Review duration: 7516m
    All Vouch review confidence checks passed
    Residual risk 0.21 = Change Risk (0.39) × (1 − Review Confidence (0.47)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.39 · 261 lines diff across 3 files
    0.39
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.02 · 1 substantive comment(s)
    0.02
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    46%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Shallow Review Depth shallow_review_depth
    0.344
    Diff Size diff_size
    0.333
    Real PR Conversation Timeline
    1 comments
    "Review active on #417"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 46.7% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 39.2% (MEDIUM) · Higher = larger blast radius
    39.2%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 46.7% · Lower = rushed or shallow review
    46.7%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 20.9% · Safe to merge
    20.9%