CNDP  22.08.0
cne_net.h File Reference
#include <net/cne_ip.h>
#include <net/cne_udp.h>
#include <net/cne_tcp.h>

Go to the source code of this file.

Functions

static int cne_net_cksum_flags_prepare (pktmbuf_t *m, uint64_t ol_flags)
 
static int cne_net_cksum_prepare (pktmbuf_t *m)
 

Detailed Description

Network checksum functions to prepare pseudo header checksum for TSO and non-TSO TCP/UDP data.

Definition in file cne_net.h.

Function Documentation

◆ cne_net_cksum_flags_prepare()

static int cne_net_cksum_flags_prepare ( pktmbuf_t m,
uint64_t  ol_flags 
)
inlinestatic

Prepare pseudo header checksum

This function prepares pseudo header checksum for TSO and non-TSO tcp/udp in provided mbufs packet data and based on the requested offload flags.

  • for non-TSO tcp/udp packets full pseudo-header checksum is counted and set in packet data,
  • for TSO the IP payload length is not included in pseudo header.

This function expects that used headers are in the first data segment of mbuf, are not fragmented and can be safely modified.

Parameters
mThe packet mbuf to be fixed.
ol_flagsTX offloads flags to use with this packet.
Returns
0 if checksum is initialized properly

Definition at line 44 of file cne_net.h.

◆ cne_net_cksum_prepare()

static int cne_net_cksum_prepare ( pktmbuf_t m)
inlinestatic

Prepare pseudo header checksum

This function prepares pseudo header checksum for TSO and non-TSO tcp/udp in provided mbufs packet data.

  • for non-TSO tcp/udp packets full pseudo-header checksum is counted and set in packet data,
  • for TSO the IP payload length is not included in pseudo header.

This function expects that used headers are in the first data segment of mbuf, are not fragmented and can be safely modified.

Parameters
mThe packet mbuf to be fixed.
Returns
0 if checksum is initialized properly

Definition at line 125 of file cne_net.h.