FreeNetBufferListForwardingContext routine

The FreeNetBufferListForwardingContext function releases resources in the out-of-band (OOB) extensible switch forwarding context of a NET_BUFFER_LIST structure. This data was used for send or receive operations in a Hyper-V extensible switch, and was previously allocated by calling the AllocateNetBufferListForwardingContext function.

Syntax


NDIS_STATUS FreeNetBufferListForwardingContext(
  _In_     NDIS_SWITCH_CONTEXT NdisSwitchContext,
  _Inout_  PNET_BUFFER_LIST NetBufferList
);

Parameters

NdisSwitchContext [in]

An NDIS_SWITCH_CONTEXT value that contains the handle of the extensible switch module to which the Hyper-V extensible switch extension is attached. When the extension calls NdisFGetOptionalSwitchHandlers, this handle is returned through the NdisSwitchContext parameter.

NetBufferList [in, out]

A pointer to a linked list of NET_BUFFER_LIST structures.

Note  This structure must contain an extensible switch forwarding context that was previously allocated by calling the AllocateNetBufferListForwardingContext function.

Return value

If the call succeeds, the function returns NDIS_STATUS_SUCCESS. Otherwise, it returns an NDIS_STATUS_Xxx error code that is defined in Ndis.h.

Remarks

The extensible switch extension can originate packet send operations within the extensible switch data path. For example, the extension can send packets to any port on the extensible switch. For more information about this data path, see Hyper-V Extensible Switch Data Path.

If the extensible switch extension originates a packet send operation, the extension must call the AllocateNetBufferListForwardingContext function. This function allocates and initializes the forwarding context for the specified NET_BUFFER_LIST structure. For more information about this context, see Hyper-V Extensible Switch Forwarding Context.

When the send operation is complete, the extension must call the FreeNetBufferListForwardingContext function to deallocate the forwarding context.

Note  The extension must call the FreeNetBufferListForwardingContext function when the send operation is completed. The extension must do this regardless of whether it adds the packet's NET_BUFFER_LIST structure to a lookaside list or calls NdisFreeNetBufferList to return the structure to a pool.

For more information on how to originate send operations, see Filter Module Send and Receive Operations.

Note  If the NetBufferList parameter contains a pointer to a linked-list of multiple NET_BUFFER_LIST structures, only the first NET_BUFFER_LIST structure in the list has its forwarding context deallocated.

Requirements

Version

Supported in NDIS 6.30 and later.

Header

Ndis.h (include Ndis.h)

IRQL

<= DISPATCH_LEVEL

See also

AllocateNetBufferListForwardingContext
NdisFreeNetBufferList
NdisFGetOptionalSwitchHandlers
NET_BUFFER_LIST

 

 

Send comments about this topic to Microsoft

Show:
© 2014 Microsoft