Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use VFs from the same PF for different modes (netlink, vfio, ...) #80

Closed
booxter opened this issue Feb 7, 2019 · 3 comments
Closed

Comments

@booxter
Copy link
Contributor

booxter commented Feb 7, 2019

When there is a single PF on a host, or one would like to reuse the same PF for multiple types of workloads, right now it's impossible because device plugin is configured on per-PF basis. We should have a way to split out particular VFs to use for one type and the rest for another type; or to not use part of available VFs at all. (The latter is useful when some VFs are utilized for hypervisor network connectivity.)

This can be achieved by either allowing to specify VF and not just PF IDs in config.json.

@moshe010
Copy link
Contributor

moshe010 commented Feb 7, 2019

@booxter, I totally agree with this feature I raise this before on K8s Network & Resource management projects weekly scrum updates. I suggested before to be able to exclude VFs as this will resolve also #58.

@ahalimx86
Copy link
Collaborator

@booxter Actually, you can achieve this with current implementation without any changes.

Let me give you an example. Say you have a PF with 4 VFs: 00:01.0, 00:01.1 with vfio-pci and 00:01.2, 00:01.3 with netdev driver. You can have two resource pool endpoints as follows:

{
    "resourceList":
    [
        {
            "resourceName": "sriov_vfio",
            "rootDevices": ["00:01.0", "00:01.1"],
            "sriovMode": false,
            "deviceType": "vfio"
        },
        {
            "resourceName": "sriov_vfio",
            "rootDevices": ["00:01.2", "00:01.3"],
            "sriovMode": false,
            "deviceType": "netdevice"
        }
    ]
}

The "rootDevice" contains the pci address of the VFs regardless of what PFs they belong to. In this case you cannot mix this with PF's pci address and "sriovMode": should be false. Only penalty is you're gonna have to provide each VF's pci address by hand in the config file. Where in, with PF's pci address and "sriovMode": true will let you discover these VFs pci address dynamically.

@zshi-redhat
Copy link
Collaborator

I think this can be accomplished with above configuration. And with new selector based config, this can also be achieved by using driver selector to distinguish VFs of different mode.
I'm going to close this issue for now and feel free to re-open if any remaining questions.

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

No branches or pull requests

4 participants