NET_PACKET_CHECKSUM structure

Warning

Some information in this topic relates to prereleased product, which may be substantially modified before it's commercially released. Microsoft makes no warranties, express or implied, with respect to the information provided here.

NetAdapterCx is preview only in Windows 10, version 1903.

A NET_PACKET_CHECKSUM structure describes checksum information for a NET_PACKET.

Syntax

typedef struct _NET_PACKET_CHECKSUM {
  UINT8 Layer2 : 2;
  UINT8 Layer3 : 2;
  UINT8 Layer4 : 2;
  UINT8 Reserved : 2;
} NET_PACKET_CHECKSUM;

Members

Layer2

A bit field that specifies a flag from either NET_PACKET_TX_CHECKSUM_ACTION or NET_PACKET_RX_CHECKSUM_EVALUATION. Targets the checksum field in the packet's layer 2 header.

Layer3

A bit field that specifies a flag from either NET_PACKET_TX_CHECKSUM_ACTION or NET_PACKET_RX_CHECKSUM_EVALUATION. Targets the checksum field in the packet's layer 3 header.

Layer4

A bit field that specifies a flag from either NET_PACKET_TX_CHECKSUM_ACTION or NET_PACKET_RX_CHECKSUM_EVALUATION. Targets the checksum field in the packet's layer 4 header.

Reserved

Reserved for system use.

Remarks

Client drivers can obtain this structure for a packet by calling NetExtensionGetPacketChecksum.

For a transmit queue, the client specifies flag values from the NET_PACKET_TX_CHECKSUM_ACTION enumeration:

typedef enum _NET_PACKET_TX_CHECKSUM_ACTION
{
    NET_PACKET_TX_CHECKSUM_PASSTHROUGH                  = 0,
    NET_PACKET_TX_CHECKSUM_REQUIRED                     = 2,
} NET_PACKET_TX_CHECKSUM_ACTION;

For a receive queue, the client specifies flag values from the NET_PACKET_RX_CHECKSUM_EVALUATION enumeration:

typedef enum _NET_PACKET_RX_CHECKSUM_EVALUATION
{
    NET_PACKET_RX_CHECKSUM_NOT_CHECKED                  = 0,
    NET_PACKET_RX_CHECKSUM_VALID                        = 1,
    NET_PACKET_RX_CHECKSUM_INVALID                      = 2,
} NET_PACKET_RX_CHECKSUM_EVALUATION;

In a transmit queue, the client cross-references the Checksum information for a packet with the Layout member of a NET_PACKET in order to determine which hardware transmit checksum offloads need to be enabled. A NET_PACKET_TX_CHECKSUM_ACTION value of NET_PACKET_TX_CHECKSUM_REQUIRED means that the client should perform the checksum calculation for this layer.

In a receive queue, the client converts its hardware packet descriptors' receive checksum offload fields into NET_PACKET_RX_CHECKSUM_EVALUATION values for each layer. NET_PACKET_RX_CHECKSUM_VALID indicates that the hardware determined that the checksum value is correct, while NET_PACKET_RX_CHECKSUM_INVALID means that it is incorrect. The default value is NET_PACKET_RX_CHECKSUM_NOT_CHECKED, which means that the checksum will be validated in software further up in the networking stack. The client should also fill out the Layout member of the NET_PACKET structure.

Requirements

   
Minimum KMDF version 1.29
Header checksumtypes.h

See Also

Packet descriptors and extensions