OID_SRIOV_WRITE_VF_CONFIG_SPACE

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

Overlying drivers issue this OID set request to the miniport driver for the network adapter's PCIe Physical Function (PF). This OID method request is required for PF miniport drivers that support the single root I/O virtualization (SR-IOV) interface.

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_WRITE_VF_CONFIG_SPACE_PARAMETERS structure that contains the parameters for a write operation of the PCI configuration space of a VF.

  • Additional buffer space that contains the data to be written to 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 PF miniport driver, which runs in the management operating system of a Hyper-V parent partition, can access the PCI configuration space for a VF.

The overlying driver, such as the virtualization stack, issues the OID set request of OID_SRIOV_WRITE_VF_CONFIG_SPACE when the VF miniport driver calls NdisMSetBusData to write to its PCI configuration space.

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

  • The PF miniport driver must verify that the VF, specified by the VFId member of the NDIS_SRIOV_WRITE_VF_CONFIG_SPACE_PARAMETERS structure, has resources that have been previously allocated. The PF 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 PF miniport driver calls NdisMSetVirtualFunctionBusData to write to the requested PCI configuration space. However, the PF miniport driver can also return PCI configuration space data for the VF that the driver has cached from previous read or write operations of the PCI configuration space.

    Note  If an independent hardware vendor (IHV) provides a virtual bus driver (VBD) as part of its SR-IOV driver package, its PF miniport driver must not call NdisMSetVirtualFunctionBusData. Instead, the driver must interface with the VBD through a private communication channel, and request that the VBD call SetVirtualFunctionData. 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 the NDIS_SRIOV_READ_VF_CONFIG_SPACE_PARAMETERS structure.

For more information, see Setting 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 set request of OID_SRIOV_WRITE_VF_CONFIG_SPACE.

Status Code Description

NDIS_STATUS_SUCCESS

The OID request completed successfully.

NDIS_STATUS_NOT_SUPPORTED

The PF 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_WRITE_VF_CONFIG_SPACE_PARAMETERS structure have invalid values.

NDIS_STATUS_INVALID_LENGTH

The information buffer was too short. NDIS sets the DATA.SET_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_WRITE_VF_CONFIG_SPACE_PARAMETERS

NdisMSetBusData

NdisMSetVirtualFunctionBusData

OID_NIC_SWITCH_ALLOCATE_VF

OID_SRIOV_READ_VF_CONFIG_SPACE

SetVirtualFunctionData