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

Support SR-IOV #21

Merged
merged 4 commits into from
Sep 23, 2024
Merged

Support SR-IOV #21

merged 4 commits into from
Sep 23, 2024

Conversation

birkelund
Copy link
Collaborator

Add support for SR-IOV within vfio (vf_token and so on). Also add a set of helpers in vfn/nvme/ctrl.h to assist with configuring secondary controllers (that may or may not be SR-IOV VFs).

This builds on the patches from PR #20.

@birkelund birkelund added the approved Approved for device testing label Aug 29, 2024
include/vfn/pci/util.h Outdated Show resolved Hide resolved
src/pci/util.c Show resolved Hide resolved
include/vfn/iommu/dmabuf.h Outdated Show resolved Hide resolved
examples/sriov.c Show resolved Hide resolved
@birkelund
Copy link
Collaborator Author

checkpatch reports a false positive here. Ignore.

Copy link
Collaborator

@minwooim minwooim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One nitpick, otherwise looks good to me.

@@ -436,6 +438,16 @@ static int vfio_get_device_fd(struct iommu_ctx *ctx, const char *bdf)
if (gfd < 0)
return -1;

vf_token = getenv("VFTOKEN");
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I missed in the last review, but can we have this VFTOKEN environment variable guide documentation to somewhere like vfio_pci_open API? This API does not totally represent the vfio itself due to it might be about iommufd, it should be documented somewhere for users to give their own VFTOKEN.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, fixed!

Add a set of utility functions operating on sysfs to deal with various
aspects of SR-IOV Virtual Functions and their Physical Functions.

Signed-off-by: Klaus Jensen <[email protected]>
If the physical function is bound to vfio-pci, it (and its VFs) must be
opened using a VF "token". Allow this to be passed in a VFTOKEN
environment variable.

Signed-off-by: Klaus Jensen <[email protected]>
Add support for Virtualization Management through a set of helpers.

Signed-off-by: Klaus Jensen <[email protected]>
Update CHANGELOG.md with new functionality.

Signed-off-by: Klaus Jensen <[email protected]>
@birkelund birkelund merged commit 4ecee45 into next Sep 23, 2024
26 checks passed
@birkelund birkelund deleted the sriov branch September 23, 2024 06:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Approved for device testing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants