ENABLE_VIRTUALIZATION callback function

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(
  PVOID Context,
  UINT16 NumVFs,
  BOOLEAN EnableVfMigration,
  BOOLEAN EnableMigrationInterrupt,
  BOOLEAN EnableVirtualization
)
{...}

Parameters

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.

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.

Note  If the EnableVirtualization parameter is FALSE, the NumVFs parameter must be set to zero.
 

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.

Note  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.
 

EnableMigrationInterrupt

A BOOLEAN value that indicates whether the interrupt associated with the PF should be masked or unmasked during VF migration.

Note  If the EnableVfMigration parameters is FALSE, the driver must also set this parameter to FALSE.
 

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

   
Minimum supported client Supported in Windows Server 2012 and later versions of Windows.
Target Platform Desktop
Header wdm.h (include Wdm.h)
IRQL <= DISPATCH_LEVEL

See Also

PCI_VIRTUALIZATION_INTERFACE

GUID_PCI_VIRTUALIZATION_INTERFACE