Enumerating NIC Switches on a Network Adapter

An overlying driver or user application can obtain a list of all NIC switches that have been created on a network adapter that supports single root I/O virtualization (SR-IOV). The driver or application issues an object identifier (OID) query request of OID_NIC_SWITCH_ENUM_SWITCHES to obtain this list.

After a successful return from this OID request, the InformationBuffer member of the NDIS_OID_REQUEST structure contains a pointer to a buffer that contains the following:

Note  Starting with Windows Server 2012, the SR-IOV interface supports only one NIC switch on the network adapter. This switch is known as the default NIC switch, and is referenced by the NDIS_DEFAULT_SWITCH_ID identifier.

NDIS handles the OID_NIC_SWITCH_ENUM_SWITCHES request for miniport drivers. NDIS returns the information from an internal cache of the data that it maintains from the following sources:

Note  NDIS also provides the enumeration of the switches in the NicSwitchArray member in the NDIS_BIND_PARAMETERS and NDIS_FILTER_ATTACH_PARAMETERS structures. Therefore, the overlying protocol and filter drivers do not have to issue OID_NIC_SWITCH_ENUM_SWITCHES requests to obtain this information.