diff options
| author | Raghavendra Rao Ananta <rananta@google.com> | 2026-05-05 21:28:36 +0000 |
|---|---|---|
| committer | Alex Williamson <alex@shazbot.org> | 2026-05-20 11:54:10 -0600 |
| commit | 20face8c75ffb3dd7e8d6743498b47403e57ebda (patch) | |
| tree | 1b2b89cfcce7e859002f8d30d3aedc32c23f9307 /tools/testing/selftests/vfio/lib/include | |
| parent | 60ab36e5d02a8e50e1edce24bff58507b514b94e (diff) | |
| download | linux-20face8c75ffb3dd7e8d6743498b47403e57ebda.tar.gz linux-20face8c75ffb3dd7e8d6743498b47403e57ebda.zip | |
vfio: selftests: Add helper to set/override a vf_token
Add a helper function, vfio_device_set_vf_token(), to set or override a
vf_token. Not only at init, but a vf_token can also be set via the
VFIO_DEVICE_FEATURE ioctl, by setting the
VFIO_DEVICE_FEATURE_PCI_VF_TOKEN flag. Hence, add an API to utilize this
functionality from the test code. The subsequent commit will use this to
test the functionality of this method to set the vf_token.
Signed-off-by: Raghavendra Rao Ananta <rananta@google.com>
Reviewed-by: David Matlack <dmatlack@google.com>
Reviewed-by: Vipin Sharma <vipinsh@google.com>
Tested-by: David Matlack <dmatlack@google.com>
Link: https://lore.kernel.org/r/20260505212838.1698034-7-rananta@google.com
Signed-off-by: Alex Williamson <alex@shazbot.org>
Diffstat (limited to 'tools/testing/selftests/vfio/lib/include')
| -rw-r--r-- | tools/testing/selftests/vfio/lib/include/libvfio/vfio_pci_device.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/tools/testing/selftests/vfio/lib/include/libvfio/vfio_pci_device.h b/tools/testing/selftests/vfio/lib/include/libvfio/vfio_pci_device.h index 898de032fed5..4ebdc00e20fc 100644 --- a/tools/testing/selftests/vfio/lib/include/libvfio/vfio_pci_device.h +++ b/tools/testing/selftests/vfio/lib/include/libvfio/vfio_pci_device.h @@ -129,4 +129,6 @@ void vfio_container_set_iommu(struct vfio_pci_device *device); void vfio_pci_cdev_open(struct vfio_pci_device *device, const char *bdf); int __vfio_device_bind_iommufd(int device_fd, int iommufd, const char *vf_token); +void vfio_device_set_vf_token(int fd, const char *vf_token); + #endif /* SELFTESTS_VFIO_LIB_INCLUDE_LIBVFIO_VFIO_PCI_DEVICE_H */ |
