NDIS VMQ Live Migration Support
To support live migration, a virtual machine (VM) can be paused at any instruction or pending I/O boundary. That is, the VM might not finish pending receive requests. So, the network virtual service provider (VSP) returns all of the received packets to the underlying network adapter that the VM did not return.
Note In Hyper-V, a child partition is also known as a VM.
When the VM is restarted on another host, the network VSP on the new host handles the receive packets that the resumed VM returns and does not pass them down to the new underlying in miniport driver. After the migration is complete, the receive queue that was associated with the VM is freed and it can be reused for another VM.
Note The new network adapter might not support VMQ.
When NDIS requests a miniport driver to free a VMQ receive queue, it follows these steps:
The network adapter stops the DMA transfer of data to receive buffers that are associated with the receive queue, after which the queue must enter the DMA Stopped state. The network adapter probably stopped the DMA activity when it received the OID_RECEIVE_FILTER_CLEAR_FILTER OID request to clear the last set filter on the receive queue.
The miniport driver generates an NDIS_STATUS_RECEIVE_QUEUE_STATE status indication with the QueueState member of the NDIS_RECEIVE_QUEUE_STATE structure set to NdisReceiveQueueOperationalStateDmaStopped to notify NDIS that the DMA transfer has been stopped.
The miniport driver waits for all the indicated receive packets for that queue to be returned to the miniport driver.
The miniport driver frees all the shared memory that it allocated for the network adapter's receive buffers that are associated with the queue by calling NdisFreeSharedMemory.
The miniport driver completes the OID_RECEIVE_FILTER_FREE_QUEUE OID request to free the receive queue.
For more information about queue states, see NDIS VM Queue States.