Determining SR-IOV Capabilities
This topic describes how NDIS and overlying drivers determine the single root I/O virtualization (SR-IOV) capabilities of a network adapter. This topic contains the following information:
Reporting SR-IOV Capabilities during MiniportInitializeEx
Querying SR-IOV Capabilities by Overlying Drivers
Reporting SR-IOV Capabilities during MiniportInitializeEx
When NDIS calls the miniport driver's MiniportInitializeEx function, the driver provides the following SR-IOV capabilities:
The complete set of SR-IOV hardware capabilities that the network adapter can support.
The SR-IOV capabilities that are currently enabled on the network adapter.
Whether the miniport driver is managing the PCI Express (PCIe) Physical Function (PF) or Virtual Function (VF) on the network adapter.
The miniport driver reports the SR-IOV hardware capabilities of the underlying network adapter through an NDIS_SRIOV_CAPABILITIES structure that is initialized in the following way:
The miniport driver initializes the Header member. The driver sets the Type member of Header to NDIS_OBJECT_TYPE_DEFAULT.
Starting with NDIS 6.30, the miniport driver sets the Revision member of Header to NDIS_SRIOV_CAPABILITIES _REVISION_1 and the Size member to NDIS_SIZEOF_SRIOV_CAPABILITIES_REVISION_1.
The miniport driver sets the appropriate flags in the SriovCapabilities member to report SR-IOV capabilities.
If the network adapter supports SR-IOV, the miniport driver for the PCI Express (PCIe) Physical Function of the adapter must set the following flags:
NDIS_SRIOV_CAPS_SRIOV_SUPPORTED
NDIS_SRIOV_CAPS_PF_MINIPORT
Note
The miniport driver for a PCIe Virtual Function (VF) of the network adapter must set both the NDIS_SRIOV_CAPS_VF_MINIPORT flag and the NDIS_SRIOV_CAPS_SRIOV_SUPPORTED flag.
When NDIS calls the miniport driver's MiniportInitializeEx function, the driver registers the SR-IOV capabilities of the network adapter by following these steps:
The miniport driver initializes an NDIS_MINIPORT_ADAPTER_HARDWARE_ASSIST_ATTRIBUTES structure.
The miniport driver sets the HardwareSriovCapabilities member to a pointer to the previously initialized NDIS_SRIOV_CAPABILITIES structure.
If the registry setting for the *SRIOV INF keyword has a value of one, the SR-IOV capabilities are currently enabled on the network adapter. The miniport driver sets the CurrentSriovCapabilities members to a pointer to the same NDIS_SRIOV_CAPABILITIES structure.
If the registry setting for the *SRIOV INF keyword has a value of zero, the SR-IOV capabilities are currently disabled on the network adapter. The miniport driver must set the CurrentSriovCapabilities member to NULL.
For more information about the *SRIOV INF keyword, see Standardized INF Keywords for SR-IOV.
The driver calls NdisMSetMiniportAttributes and sets the MiniportAttributes parameter to a pointer to the NDIS_MINIPORT_ADAPTER_HARDWARE_ASSIST_ATTRIBUTES structure.
For more information about the adapter initialization process, see Initializing a Miniport Adapter.
Querying SR-IOV Capabilities by Overlying Drivers
NDIS passes the network adapter's currently enabled SR-IOV capabilities to overlying drivers that bind to the network adapter in the following way:
When NDIS calls an overlying filter driver's FilterAttach function, NDIS passes the network adapter's SR-IOV capabilities through the AttachParameters parameter. This parameter contains a pointer to an NDIS_FILTER_ATTACH_PARAMETERS structure. The SriovCapabilities member of this structure contains a pointer to an NDIS_SRIOV_CAPABILITIES structure.
When NDIS calls an overlying protocol driver's ProtocolBindAdapterEx function, NDIS passes the network adapter's SR-IOV capabilities through the BindParameters parameter. This parameter contains a pointer to an NDIS_FILTER_ATTACH_PARAMETERS structure. The SriovCapabilities member of this structure contains a pointer to an NDIS_SRIOV_CAPABILITIES structure.
NDIS also returns the NDIS_SRIOV_CAPABILITIES structure when it handles object identifier (OID) query requests of OID_SRIOV_HARDWARE_CAPABILITIES and OID_SRIOV_CURRENT_CAPABILITIES that are issued by overlying protocol or filter drivers.