DPDK 25.03.0-rc0
Functions
rte_cksum.h File Reference
#include <stdint.h>
#include <rte_byteorder.h>
#include <rte_common.h>
#include <rte_mbuf.h>

Go to the source code of this file.

Functions

static uint16_t rte_raw_cksum (const void *buf, size_t len)
 
static int rte_raw_cksum_mbuf (const struct rte_mbuf *m, uint32_t off, uint32_t len, uint16_t *cksum)
 

Detailed Description

Protocol independent checksum utilities.

Definition in file rte_cksum.h.

Function Documentation

◆ rte_raw_cksum()

static uint16_t rte_raw_cksum ( const void *  buf,
size_t  len 
)
inlinestatic

Process the non-complemented checksum of a buffer.

Parameters
bufPointer to the buffer.
lenLength of the buffer.
Returns
The non-complemented checksum.

Definition at line 94 of file rte_cksum.h.

◆ rte_raw_cksum_mbuf()

static int rte_raw_cksum_mbuf ( const struct rte_mbuf m,
uint32_t  off,
uint32_t  len,
uint16_t *  cksum 
)
inlinestatic

Compute the raw (non complemented) checksum of a packet.

Parameters
mThe pointer to the mbuf.
offThe offset in bytes to start the checksum.
lenThe length in bytes of the data to checksum.
cksumA pointer to the checksum, filled on success.
Returns
0 on success, -1 on error (bad length or offset).

Definition at line 117 of file rte_cksum.h.