Querying the Parameters of a Virtual Function
An overlying driver or a user-mode application can obtain the current parameters for a PCI Express (PCIe) Virtual Function (VF) on a network adapter that supports single root I/O virtualization (SR-IOV). The driver or application issues an object identifier (OID) method request of OID_NIC_SWITCH_VF_PARAMETERS to obtain these parameters.
Before the overlying driver issues this OID method request, it must initialize an NDIS_NIC_SWITCH_VF_PARAMETERS structure. The driver or application must set the VFId member to the identifier of the VF for which parameters are to be returned. The VF identifier can be obtained in the following ways:
By issuing an OID method request of OID_NIC_SWITCH_ENUM_VFS.
If this OID request is completed successfully, the overlying driver or user-mode application receives a list of all VFs allocated on the network adapter. Each element within the list is an NDIS_NIC_SWITCH_VF_INFO structure, with the VF identifier specified by the VFId member.
By issuing an OID method request of OID_NIC_SWITCH_ALLOCATE_VF.
If this OID request is completed successfully, the overlying driver receives the identifier of the newly created VF in the VFId member of the returned NDIS_NIC_SWITCH_VF_PARAMETERS structure.
Note Only overlying drivers can obtain the VF identifier in this manner.
After a successful return from the OID method request, the InformationBuffer member of the NDIS_OID_REQUEST structure contains a pointer to an NDIS_NIC_SWITCH_VF_PARAMETERS structure. This structure contains the configuration parameters for the specified VF.
NDIS handles the OID_NIC_SWITCH_VF_PARAMETERS request for miniport drivers. NDIS returns the information from an internal cache of the data that it maintains from inspecting the following sources:
OID method requests of OID_NIC_SWITCH_ALLOCATE_VF.
OID set requests of OID_NIC_SWITCH_VF_PARAMETERS.