Bewerken

Delen via


Querying and Changing NVGRE Task Offload State

This section describes how to query or change the current Network Virtualization using Generic Routing Encapsulation (NVGRE) Task Offload state of an NVGRE-capable miniport driver. NVGRE task offload can be enabled by default, but it must not be operationally active by default. A NIC should not begin performing task offloads on encapsulated packets until this feature is enabled explicitly by an NDIS protocol or filter driver.

Querying NVGRE Task Offload State

To query a miniport driver's current NVGRE task offload state, an NDIS protocol or filter driver uses the OID_TCP_OFFLOAD_CURRENT_CONFIG OID request. This will return an NDIS_OFFLOAD structure whose EncapsulatedPacketTaskOffloadGre member is an NDIS_ENCAPSULATED_PACKET_TASK_OFFLOAD structure that contains NDIS_OFFLOAD_SUPPORTED if those offloads are currently enabled for GRE-encapsulated packets and NDIS_OFFLOAD_NOT_SUPPORTED otherwise. NDIS handles this OID and does not pass it down to the miniport.

Note  To determine whether a miniport driver supports NVGRE task offload, use the OID_TCP_OFFLOAD_HARDWARE_CAPABILITIES OID request as described in Determining the NVGRE Task Offload Capabilities of a Network Adapter.

Changing NVGRE Task Offload State

An NDIS protocol or filter driver can enable or disable NVGRE task offload by issuing the OID_TCP_OFFLOAD_PARAMETERS OID request. This OID uses an NDIS_OFFLOAD_PARAMETERS structure. In this structure, the EncapsulatedPacketTaskOffload member can have the following values:

Term Description

NDIS_OFFLOAD_SET_NO_CHANGE

The NVGRE task offload state is unchanged.

NDIS_OFFLOAD_SET_ON

Specify this flag to enable NVGRE task offload.

NDIS_OFFLOAD_SET_OFF

Specify this flag to disable NVGRE task offload.

After the miniport driver processes the OID_TCP_OFFLOAD_PARAMETERS OID request, it must issue an NDIS_STATUS_TASK_OFFLOAD_CURRENT_CONFIG status indication with the updated offload state.

When a miniport driver receives a OID_TCP_OFFLOAD_PARAMETERS OID request in which the NDIS_OFFLOAD_SET_OFF flag is specified, the driver should indicate any existing encapsulated packets that are partially processed for task offloads up the stack before completing the OID request.

Base task offloads for normal packets are enabled by existing OIDs such as OID_OFFLOAD_ENCAPSULATION and OID_RECEIVE_FILTER_ALLOCATE_QUEUE. The EncapsulatedPacketTaskOffload member setting supplements these OIDs and instructs the NIC to also do these offloads for encapsulated packets.