Bewerken

Delen via


Shared Memory in Receive Buffers

This section describes the layout of the shared memory in VMQ receive buffers.For more information about using the buffers in receive indications, see VMQ Receive Path.

If the overlying protocol driver set the NDIS_RECEIVE_QUEUE_PARAMETERS_LOOKAHEAD_SPLIT_REQUIRED flag in the Flags member of the NDIS_RECEIVE_QUEUE_PARAMETERS structure, the network adapter should split a received packet at an offset equal to or greater than the requested lookahead size and use DMA to transfer the lookahead data and the post-lookahead data to separate shared memory segments.

Miniport drivers specify the settings for the lookahead type (NdisSharedMemoryUsageReceiveLookahead) or other shared memory types when the shared memory is allocated. For example, the miniport driver calls the NdisAllocateSharedMemory function and sets the Usage member in the NDIS_SHARED_MEMORY_PARAMETERS structure to NdisSharedMemoryUsageReceiveLookahead. Miniport drivers should allocated shared memory for a queue when the queue allocation is complete. For information about allocating and freeing shared memory resources for queues, see Shared Memory Resource Allocation.

The following illustration shows the relationships for the network data when the incoming data is split into two shared memory buffers.

Diagram showing network data relationships with incoming data split into two shared memory buffers.

The NET_BUFFER_SHARED_MEMORY structure specifies shared memory information. There can be a linked list of such shared memory buffers that are associated with a NET_BUFFER structure.

Use the NET_BUFFER_SHARED_MEM_NEXT_SEGMENT, NET_BUFFER_SHARED_MEM_FLAGS, NET_BUFFER_SHARED_MEM_HANDLE, NET_BUFFER_SHARED_MEM_OFFSET, and NET_BUFFER_SHARED_MEM_LENGTH macros to access the NET_BUFFER_SHARED_MEMORY in a NET_BUFFER structure. The SharedMemoryInfo member of the NET_BUFFER structure contains the first NET_BUFFER_SHARED_MEMORY structure in the linked list.

Note  Starting with NDIS 6.30, splitting packet data into separate lookahead buffers is no longer supported. Starting with Windows Server 2012, the overlying protocol driver will not set the NDIS_RECEIVE_QUEUE_PARAMETERS_LOOKAHEAD_SPLIT_REQUIRED flag in the Flags member of the NDIS_RECEIVE_QUEUE_PARAMETERS structure.