OID_SWITCH_NIC_REQUEST

An object identifier (OID) method request of OID_SWITCH_NIC_REQUEST is used to encapsulate and forward OID requests to the Hyper-V extensible switch external network adapter. This allows the encapsulated OID request to be delivered to the driver for the underlying physical network adapter that is bound to the external network adapter.

This OID request is also used to encapsulate OID requests that were issued to other network adapters that are connected to extensible switch ports. In this case, the encapsulated OID request is forwarded through the extensible switch driver stack for inspection by extensions.

The InformationBuffer member of the NDIS_OID_REQUEST structure contains a pointer to an NDIS_SWITCH_NIC_OID_REQUEST structure. This structure specifies the forwarding information for the OID request. This structure also contains a pointer to the original NDIS_OID_REQUEST structure of the OID request that is being forwarded.

Remarks

When OID requests arrive at the Hyper-V extensible switch interface, it encapsulates them in order to forward them down the extensible switch control path. These OID requests include the following:

  • Hardware offload OID requests, including requests for Internet Protocol security (IPsec), virtual machine queue (VMQ), and single root I/O virtualization (SR-IOV). These OID requests are issued by an overlying protocol or filter driver that runs in the management operating system of the Hyper-V parent partition.

    When these OID requests arrive at the extensible switch interface, the protocol edge of the extensible switch encapsulates the OID request within an NDIS_SWITCH_NIC_OID_REQUEST structure. The protocol edge sets the members of this structure in the following way:

    • The DestinationPortId and DestinationNicIndex members are set to the corresponding values for the external network adapter.

    • If the OID request was originated from a Hyper-V child partition, the SourcePortId and SourceNicIndex members are set to the corresponding values for the port and network adapter that are used by the partition. Otherwise, the SourcePortId and SourceNicIndex members are set to zero.

      Note The extension must retain the values of these members if it forwards or redirects the OID request.

    • The OidRequest member is set to a pointer to the NDIS_OID_REQUEST structure for the encapsulated OID request.

    The protocol edge then issues the OID_SWITCH_NIC_REQUEST request to forward the encapsulated OID request down the extensible switch control path to the external network adapter.

    An underlying forwarding extension can redirect encapsulated hardware offload OID requests to a physical network adapter that is bound to the external network adapter. For example, if the extension supports physical network adapters from an extensible switch team that are bound to the external network adapter, it can forward the OID_SWITCH_NIC_REQUEST request to a physical adapter in the load balancing failover (LBFO) team that supports the hardware offload. For more information on this procedure, see Managing Hardware Offload OID Requests to Physical Network Adapters.

    For more information about extensible switch teams, see Types of Physical Network Adapter Configurations.

  • Multicast OID requests, including OID_802_3_ADD_MULTICAST_ADDRESS and OID_802_3_DELETE_MULTICAST_ADDRESS. These OID requests are issued by overlying protocol and filter drivers that run in either the management operating system or the guest operating system of a Hyper-V child partition.

    When these OID requests arrive at the extensible switch interface, the protocol edge of the extensible switch encapsulates the OID request within an NDIS_SWITCH_NIC_OID_REQUEST structure. The protocol edge also sets the SourcePortId and SourceNicIndex members to the corresponding values for the port and network adapter from which the OID request originated. The protocol edge then issues the OID_SWITCH_NIC_REQUEST request to forward the encapsulated OID request down the extensible switch control path for inspection by underlying extensions.

    Note In this case, the protocol edge sets the DestinationPortId and DestinationNicIndex members to zero. This specifies that the encapsulated OID request is to be delivered to extensions in the control path.

    Underlying forwarding extensions can inspect these encapsulated OID requests and retain the multicast address information that they specify. For example, the extension may need this information if it originates multicast packets that it forwards to an extensible switch port.

    For more information, see Forwarding OID Requests from a Hyper-V Child Partition.

A forwarding extension can also issue an OID_SWITCH_NIC_REQUEST in order to forward encapsulated OID requests to a physical network adapter that is bound to the external network adapter. This allows the extension to originate its own OID request or redirect an existing OID request to a physical network adapter that is bound to the external network adapter. In order to do this, the extension must follow these steps:

  1. The extension calls ReferenceSwitchNic to increment a reference counter for the index of the destination physical network adapter. This guarantees that the extensible switch interface will not delete the physical network adapter connection while its reference counter is nonzero.

    Note The extensible switch interface could disconnect the physical network adapter connection while its reference counter is nonzero. For more information, see Hyper-V Extensible Switch Port and Network Adapter States.

  2. The extension encapsulates the OID request by initializing an NDIS_SWITCH_NIC_OID_REQUEST structure in the following way:

    • The DestinationPortId member must be set to the identifier of the extensible switch port to which the external network adapter is connected.

    • The DestinationNicIndex member must be set to the nonzero index value of the underlying physical network adapter.

    • If the extension is originating on behalf of a Hyper-V child partition, the SourcePortId and SourceNicIndex members are set to the corresponding values for the port and network adapter that are used by the partition. Otherwise, the SourcePortId and SourceNicIndex members are set to zero.

      For example, if the extension is managing hardware offload resources for a child partition, it must set the SourcePortId and SourceNicIndex members to specify which partition the encapsulated hardware offload OID request is for.

    • The OidRequest member must be set to a pointer to an initialized NDIS_OID_REQUEST structure for the encapsulated OID request.

  3. The extension calls NdisFOidRequest to forward the OID request to the specified destination extensible switch port and network adapter.

  4. When NDIS calls the FilterOidRequestComplete function, the extension calls DereferenceSwitchNic to clear the reference counter for the index of the destination physical network adapter.

Return Status Codes

The underlying miniport edge of the extensible switch completes the OID query request of OID_SWITCH_NIC_REQUEST and returns one of the following status codes.

Status Code Description

NDIS_STATUS_SUCCESS

The OID request completed successfully.

NDIS_STATUS_Xxx

The request failed for other reasons.

Requirements

Version

Supported in NDIS 6.30 and later.

Header

Ntddndis.h (include Ndis.h)

See also


NDIS_STATUS_INDICATION

NDIS_SWITCH_NIC_OID_REQUEST