← Back to Pull requests

pcie: configuration space and the switch ports between peers #45

Closed
unknown closed this pull request without merging on Nov 10, 2026 10:29 UTC
View on GitHub
unknown unknown commented on Nov 04, 2026 01:55 UTC
Author

pcie, a module for the PCI Express configuration space and for the switch ports between a function and its peers.

The kernel sets the ACS bits that isolate IOMMU groups on its own when an IOMMU is on. What it leaves alone is Direct Translated P2P, the bit that lets a request a NIC has translated through ATS cross a switch to a GPU without a round trip through the root complex. NVIDIA's HGX Shared NVSwitch guide (19.0, sections 2.6 and 2.7) asks a host to turn that on for GPUDirect RDMA, and to turn ATS on in the ConnectX firmware. Whether a NIC exposes ATS at all, and the ACS bits of a port, live in extended configuration space.

  • pcie::Config reads and writes a function's config file and walks its extended capability list. acs() and ats() read the two capabilities, set_acs_ctrl writes the control register. Reads past the first 64 bytes and every write need root, and the error says so rather than reporting a missing capability.

  • pcie::switch_ports walks the bus the way the kernel nests it to the ACS-capable downstream ports of every switch between a function and the root. pcie::endpoints names what hangs below a port; parent, children and is_bridge are the pieces.

  • The test fake learns to nest a function under a bridge (add_pci_device_under) and to carry a 4 KiB configuration space with a given capability list (set_ext_capabilities).
  • Nothing here survives a reboot; whatever a caller adds on top of the kernel's bits is its own to persist.

    Verified on a DGX Rubin NVL8 through the consumer's status --probe: the walk from each GPU finds the three ConnectX-9 switch ports around it and the data-path NIC under the sibling port, and a NIC whose firmware has ATS off reads as having no capability.

    Consumer: the kata-device-provisioner branch topic/p2p-rdma (apply --p2p-rdma).

    Diff: 229 lines (+171 / -58) across 2 files Reviewer: zvonkok Review duration: 9154m
    All Vouch review confidence checks passed
    Residual risk 0.26 = Change Risk (0.60) × (1 − Review Confidence (0.57)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.60 · 229 lines diff across 2 files
    0.60
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    56%
    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
    Diff Size diff_size
    0.325
    Shallow Review Depth shallow_review_depth
    0.289
    Sensitive Paths sensitive_paths
    0.060
    Real PR Conversation Timeline
    1 comments
    "Review active on #45"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 56.8% reviewed sensitive_module
    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: 60.2% (MEDIUM) · Higher = larger blast radius
    60.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: 56.8% · Lower = rushed or shallow review
    56.8%
    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: 26% · Safe to merge
    26%