Skip to content

[RFE] Network mode equivalent to libvirt's hostdev. #25511

@useranon350

Description

@useranon350

Feature request description

Hardware features such as SR-IOV allow passing through separate PCIe devices to VMs for hardware accelerated network virtualization. The same could potentially be done inside a privileged container using --network none and --device . It would be more desirable for podman to support this directly in --network to simplify configuration and avoid the need for elevated privileges within the container.

See #8919 and https://docs.redhat.com/en/documentation/red_hat_enterprise_linux/9/html/configuring_and_managing_virtualization/managing-virtual-devices_configuring-and-managing-virtualization#attaching-sr-iov-networking-devices-to-virtual-machines_managing-sr-iov-devices. Macvlan is not a replacement for SR-IOV pass-through because it adds additional overhead and is not equivalent to a simple hostdev passthrough.

Suggest potential solution

Support --network hostdev:name=<adapter name, e.g. enpXXsY>,pf=,vf=. Potentially start by simply allowing adapter pass-through without any "intelligence" regarding physical or virtual functions. e.g. --network hostdev:name=enp12s0f3v4 to manually pass-through a specific virtual function without podman needing to give it special treatment vs. a physical network adapter.

As a "nice to have", allow automatic allocation of physical and virtual functions if the pf and vf flags are unset. This would effectively allow dynamic allocation of virtual functions to pods. Even some decade-old NICs like the Intel X550-T2 support 126 total virtual functions (128 if none are reserved for the host), which is sufficient for many deployments to offload pod networking entirely. This also allows offloading the pod DHCP to the local router, which is desirable in some deployments.

Have you considered any alternatives?

A clear and concise description of any alternative solutions or features you've considered.

Additional context

Add any other context or screenshots about the feature request here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/featureCategorizes issue or PR as related to a new feature.networkNetworking related issue or featurestale-issue

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions