Allocating VPorts for VMMQ

NDIS allocates VPorts when the Virtual Machine Multiple Queues (VMMQ) capability is present in the following way.

NDIS creates a non-default VPort on the miniport adapter by issuing the OID_NIC_SWITCH_CREATE_VPORT OID request. When creating an RSS physical function (PF) VPort, NDIS will initialize the NDIS_NIC_SWITCH_VPORT_PARAMETERS structure as follows:

  • NDIS sets the AttachedFunctionId field to NDIS_PF_FUNCTION_ID.

  • If VMMQ is enabled, NDIS sets the NumQueuePairs field to the number of VMMQ queue pairs that should be used for this VPort. This number includes the default RSS processor for this VPort. It is guaranteed that total number of processors will not exceed this number. If VMMQ is disabled, NDIS sets this value to one.

  • If VMMQ is enabled, the ProcessorAffinity field defines a bitmask of the potential RSS processors that the miniport adapter must use for this VPort. The processors that the network stack used to populate the indirection table entries for the VPort are a subset of the processors that this bitmask identifies. The mask will be a subset of the RSS processors returned from the call to NdisGetRssProcessorInformation and the number of set bits might exceed the number of RSS queues requested for the VPort. If VMMQ is disabled, the miniport adapter must use the lowest processor number specified in this bitmask when setting the affinity of the VPort queue.

  • NDIS sets the NDIS_NIC_SWITCH_VPORT_PARAMS_NUM_QUEUE_PAIRS_CHANGED flag to indicate that the NumQueuePairs member has been updated after the VPort has been created. When VMMQ is enabled, the number of queues for default and non-default VPorts can be updated.