msft-preview: runtime and runtime-rs: Add support for non-VF physical network devices to both runtime and runtime-rs#441
Conversation
There was a problem hiding this comment.
Pull request overview
This PR extends Kata’s Go runtime (virtcontainers) and Rust runtime (runtime-rs) to support physical network interfaces that are not SR-IOV VFs (e.g., VMBus-backed NICs) by using tap/bridge networking instead of assuming VFIO passthrough.
Changes:
- Go: Physical endpoint now branches VF vs non-VF behavior (VFIO passthrough vs tap/bridge connect/disconnect) and persists additional physical endpoint networking state.
- Go: Physical interface detection switches to using netlink
ParentDevBus(PCI/VMBus). - Rust: Adds bus-type detection (PCI/VMBus), VF detection, and physical endpoint creation that supports non-VF physical NICs.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| src/runtime/virtcontainers/physical_endpoint.go | Adds VF/non-VF branching, sysfs path handling for PCI/VMBus, persists NetPair/BusType. |
| src/runtime/virtcontainers/physical_endpoint_test.go | Expands unit tests for VF vs non-VF behavior, sysfs-path helpers, save/load behavior. |
| src/runtime/virtcontainers/persist/api/network.go | Extends persisted PhysicalEndpoint schema with NetPair and BusType. |
| src/runtime/virtcontainers/network_linux.go | Updates physical detection callsite and link typing for PhysicalEndpoint. |
| src/runtime-rs/crates/resource/src/network/utils/link/mod.rs | Adds bus-type detection, iface sysfs path resolution, and VF detection helpers. |
| src/runtime-rs/crates/resource/src/network/network_with_netns.rs | Updates physical endpoint creation to pass required params for non-VF setup. |
| src/runtime-rs/crates/resource/src/network/network_pair.rs | Adds NetworkPair::new_for_physical() and tests for VF vs non-VF behavior. |
| src/runtime-rs/crates/resource/src/network/endpoint/physical_endpoint.rs | Implements VF vs non-VF attach/detach logic (VFIO vs network device) and persists added state. |
| src/runtime-rs/crates/resource/src/network/endpoint/endpoint_persist.rs | Extends persisted physical endpoint state with VF/bus metadata. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
… fetch link from kernel Agent-Logs-Url: https://github.com/microsoft/kata-containers/sessions/37741095-6baf-41d0-be28-31710b28dbb4 Co-authored-by: sharath-srikanth-chellappa <115591284+sharath-srikanth-chellappa@users.noreply.github.com>
…/37741095-6baf-41d0-be28-31710b28dbb4 Co-authored-by: sharath-srikanth-chellappa <115591284+sharath-srikanth-chellappa@users.noreply.github.com>
…) fix, comment update Agent-Logs-Url: https://github.com/microsoft/kata-containers/sessions/3a97fe22-9884-4104-a6c0-60981cc1f63f Co-authored-by: sharath-srikanth-chellappa <115591284+sharath-srikanth-chellappa@users.noreply.github.com>
Use sysIfaceDevicePath when probing physfn Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
… between integer types' Correcting the strconv function Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 10 out of 11 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…hers Agent-Logs-Url: https://github.com/microsoft/kata-containers/sessions/f9ce4ef3-9e58-4054-aac8-03c4e016b091 Co-authored-by: sharath-srikanth-chellappa <115591284+sharath-srikanth-chellappa@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 10 out of 11 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…VF path Agent-Logs-Url: https://github.com/microsoft/kata-containers/sessions/3019da9e-d213-4361-9226-4e28fe0114be Co-authored-by: sharath-srikanth-chellappa <115591284+sharath-srikanth-chellappa@users.noreply.github.com>
TestIsPhysicalIface: remove spuriousParentDevBusfrom Bridge and fetch link from kernelnetInfo.Linkpanic inaddSingleEndpoint(): resolve link vianetlink.LinkByNamewhen nil*PhysicalEndpointto rate-limiter switches to prevent hard failure: VF → no-op, non-VF → tap interface namePhysicalEndpoint.load()to uses.Physical.NetPair, persist/restoreIsVFviapersistapi.PhysicalEndpointisPhysicalIface()to reflectParentDevBus-based detectionremoveTxRateLimitererror message ("adding" → "removing")get_bus_type(): only mapErrorKind::NotFoundtoOk(None); propagate all other I/O errors (comment 3033974934)RxRateLimiter/TxRateLimiterbool fields toPhysicalEndpoint;SetRxRateLimiter()/SetTxRateLimiter()set the flag and return nil for non-VF (comment 3034009975)