Bewerken

Delen via


OID_SRIOV_READ_VF_CONFIG_SPACE

An overlying driver issues an object identifier (OID) method request of OID_SRIOV_READ_VF_CONFIG_SPACE to read data from the PCI Express (PCIe) configuration space for a specified PCIe Virtual Function (VF) on the network adapter.

After a successful return from this OID method request, the InformationBuffer member of the NDIS_OID_REQUEST structure contains a pointer to a caller-allocated buffer. This buffer is formatted to contain the following:

  • An NDIS_SRIOV_READ_VF_CONFIG_SPACE_PARAMETERS structure that contains the parameters for a read operation of the PCI configuration space of a VF.

  • Additional buffer space for the data to be read from the PCI configuration space.

Remarks

The VF miniport driver runs in the guest operating system of a Hyper-V child partition. Because of this, the VF miniport driver cannot directly access hardware resources, such as the VF's PCI configuration space. Only the miniport driver for the PCIe Physical Function (PF) can access the PCI configuration space for a VF. The PF miniport driver runs in the management operating system of a Hyper-V parent partition and has privileged access to the VF resources.

In order to read the VF PCI configuration space, overlying drivers that run in the management operating system issue the OID method request of OID_SRIOV_READ_VF_CONFIG_SPACE to the PF miniport driver. This OID method request is required for PF miniport drivers that support the single root I/O virtualization (SR-IOV) interface.

For example, the virtualization stack that runs in the management operating system issues the OID method request of OID_SRIOV_READ_VF_CONFIG_SPACE when the VF miniport driver calls NdisMGetBusData to read from its VF PCI configuration space.

When it handles the OID method request of OID_SRIOV_READ_VF_CONFIG_SPACE, the PF miniport driver must follow these guidelines:

  • The miniport driver must verify that the VF, specified by the VFId member of the NDIS_SRIOV_READ_VF_CONFIG_SPACE_PARAMETERS structure, has resources that have been previously allocated. The miniport driver allocates resources for a VF through an OID method request of OID_NIC_SWITCH_ALLOCATE_VF. If resources for the specified VF have not been allocated, the driver must fail the OID request.

  • The miniport driver must verify that the buffer (referenced by the InformationBuffer member of the NDIS_OID_REQUEST structure) is large enough to return the requested PCIe configuration space data. If this is not true, the driver must fail the OID request.

  • The miniport driver typically calls NdisMGetVirtualFunctionBusData to query the requested PCIe configuration space. However, the miniport driver can also return PCIe configuration space data for the VF that the driver has cached from previous read or write operations of the PCIe configuration space.

    Note  If an independent hardware vendor (IHV) provides a virtual bus driver (VBD) as part of its SR-IOV driver package, its miniport driver must not call NdisMGetVirtualFunctionBusData. Instead, the driver must interface with the VBD through a private communication channel, and request that the VBD call ReadVfConfigBlock. This function is exposed from the GUID_VPCI_INTERFACE_STANDARD interface that is supported by the underlying virtual PCI (VPCI) bus driver.

If the PF miniport driver can successfully complete the OID request, the driver must copy the requested PCI configuration space data to the buffer referenced by the InformationBuffer member of the NDIS_OID_REQUEST structure. The driver copies the data to the buffer at the offset specified by BufferOffset member of NDIS_SRIOV_READ_VF_CONFIG_SPACE_PARAMETERS structure.

For more information, see Querying the PCI Configuration Data of a Virtual Function.

Return Status Codes

The PF miniport driver returns one of the following status codes for the OID method request of OID_SRIOV_READ_VF_CONFIG_SPACE.

Status Code Description

NDIS_STATUS_SUCCESS

The OID request completed successfully.

NDIS_STATUS_NOT_SUPPORTED

The miniport driver either does not support the single root I/O virtualization (SR-IOV) interface or is not enabled to use the interface.

NDIS_STATUS_INVALID_PARAMETER

One or more of the members of the NDIS_SRIOV_READ_VF_CONFIG_SPACE_PARAMETERS structure have invalid values.

NDIS_STATUS_INVALID_LENGTH

The information buffer was too short. The miniport driver must set the DATA.METHOD_INFORMATION.BytesNeeded member in the NDIS_OID_REQUEST structure to the minimum buffer size that is required.

NDIS_STATUS_FAILURE

The request failed for other reasons.

Requirements

Version

Supported in NDIS 6.30 and later.

Header

Ntddndis.h (include Ndis.h)

See also


GUID_VPCI_INTERFACE_STANDARD

NDIS_OID_REQUEST

NDIS_SRIOV_READ_VF_CONFIG_SPACE_PARAMETERS

NdisMGetBusData

NdisMGetVirtualFunctionBusData

OID_NIC_SWITCH_ALLOCATE_VF

ReadVfConfigBlock