VGPU management
Overview
These APIs are for VGPU management More…
// global functions XPUM_API xpum_result_t xpumDoVgpuPrecheck(xpum_vgpu_precheck_result_t* result); XPUM_API xpum_result_t xpumCreateVf( xpum_device_id_t deviceId, xpum_vgpu_config_t* conf ); XPUM_API xpum_result_t xpumGetDeviceFunctionList( xpum_device_id_t deviceId, xpum_vgpu_function_info_t list[], int* count ); XPUM_API xpum_result_t xpumRemoveAllVf(xpum_device_id_t deviceId); XPUM_API xpum_result_t xpumGetVfMetrics( xpum_device_id_t deviceId, xpum_vf_metric_t dataList[], uint32_t* count );
Detailed Documentation
These APIs are for VGPU management
Global Functions
XPUM_API xpum_result_t xpumDoVgpuPrecheck(xpum_vgpu_precheck_result_t* result)
Do SR-IOV prerequisite check and get result, including VMX flag check, IOMMU status check and SR-IOV status check.
Support Platform: Linux
Parameters:
result |
OUT: The result of vgpu precheck |
Returns:
xpum_result_t
XPUM_API xpum_result_t xpumCreateVf( xpum_device_id_t deviceId, xpum_vgpu_config_t* conf )
Create VF.
Support Platform: Linux
Parameters:
deviceId |
IN: Device Id |
conf |
IN: Configurations for creating VFs |
Returns:
xpum_result_t
XPUM_API xpum_result_t xpumGetDeviceFunctionList( xpum_device_id_t deviceId, xpum_vgpu_function_info_t list[], int* count )
Get a list containing both PF and VFs.
Support Platform: Linux
Parameters:
deviceId |
IN: Device Id |
list |
OUT: The buffer to store PF/VF list |
count |
IN/OUT: When list is NULL, count will be filled with the array size needed, and return. When list is not NULL, count denotes the length of list, count should be equal to or larger than needed size. When return, the count will store real size of array returned by list. |
Returns:
xpum_result_t
XPUM_API xpum_result_t xpumRemoveAllVf(xpum_device_id_t deviceId)
Remove VFs on a specified physical device.
Support Platform: Linux
Parameters:
deviceId |
IN: Device Id |
Returns:
xpum_result_t
XPUM_API xpum_result_t xpumGetVfMetrics( xpum_device_id_t deviceId, xpum_vf_metric_t dataList[], uint32_t* count )
Get VF (Virtual Function) metrics from Host OS.
Support Platform: Linux
Parameters:
deviceId |
IN: Device Id |
dataList |
OUT: The array to store all VF metrics for device deviceId. First pass NULL to query VF metrics count. Then pass array with desired length to store VF metrics. |
count |
IN/OUT: When dataList is NULL, count will be filled with the number of available entries, and return. When dataList is not NULL, count denotes the length of dataList, count should be equal to or larger than the number of available entries, when return, the count will store real number of entries returned by dataList |
Returns:
xpum_result_t
XPUM_OK if query successfully
XPUM_BUFFER_TOO_SMALL if count is smaller than needed
XPUM_API_UNSUPPORTED if required level zero API is not available