ENABLE_VIRTUALIZATION callback function (wdm.h)
The EnableVirtualization routine enables or disables virtualization for a PCI Express (PCIe) device that supports the single root I/O virtualization (SR-IOV) interface.
Syntax
ENABLE_VIRTUALIZATION EnableVirtualization;
NTSTATUS EnableVirtualization(
[in, out] PVOID Context,
[in] UINT16 NumVFs,
[in] BOOLEAN EnableVfMigration,
[in] BOOLEAN EnableMigrationInterrupt,
[in] BOOLEAN EnableVirtualization
)
{...}
Parameters
[in, out] Context
A pointer to interface-specific context information. The caller passes the value that is passed as the Context member of the PCI_VIRTUALIZATION_INTERFACE structure for the interface.
[in] NumVFs
The number of PCIe virtual functions (VFs) that are to be enabled for the device. The EnableVirtualization routine sets the NumVFs member of the PCIe SR-IOV Extended Capability structure to the value of the NumVFs parameter.
If the EnableVirtualization parameter is FALSE, the NumVFs parameter must be set to zero.
[in] EnableVfMigration
A BOOLEAN value that indicates whether the multi-root I/O virtualization (MR-IOV) base function (BF) can dynamically reprovision the PCIe physical function (PF) of the device as a VF at run time.
This parameter is only applicable to devices that support both the SR-IOV and MR-IOV interfaces. The driver must set this parameter to FALSE if the device supports only the SR-IOV interface and not the MR-IOV interface.
[in] EnableMigrationInterrupt
A BOOLEAN value that indicates whether the interrupt associated with the PF should be masked or unmasked during VF migration.
If the EnableVfMigration parameters is FALSE, the driver must also set this parameter to FALSE.
[in] EnableVirtualization
A BOOLEAN value that indicates whether virtualization is enabled on the PCIe configuration space of the device. If the EnableVirtualization parameter is TRUE, the EnableVirtualization routine sets the VF Enable bit of the PCIe SR-IOV Control field. The EnableVirtualization routine clears this bit if the EnableVirtualization parameter is FALSE.
Return value
The EnableVirtualization routine returns one of the following NTSTATUS values:
Return code | Description |
---|---|
STATUS_SUCCESS | The operation completed successfully. |
STATUS_INVALID_PARAMETER | The NumVFs parameter is either zero or is larger than the value of the TotalVFs member of the SR-IOV Extended Capability structure for the device. |
STATUS_INVALID_DEVICE_STATE | Virtualization is already enabled on the device and the EnableVirtualization parameter is TRUE, or virtualization is already disabled on the device and the EnableVirtualization parameter is FALSE. |
Remarks
Drivers call the EnableVirtualization routine to configure the SR-IOV Extended Capability fields in the PCIe configuration space. This call enables or disables virtualization in the configuration space, and specifies the number of VFs that should be exposed to the PCIe fabric by the device.
The EnableVirtualization routine is provided by the GUID_PCI_VIRTUALIZATION_INTERFACE interface.
Requirements
Requirement | Value |
---|---|
Minimum supported client | Supported in Windows Server 2012 and later versions of Windows. |
Target Platform | Desktop |
Header | wdm.h (include Wdm.h) |
IRQL | IRQL <= DISPATCH_LEVEL |