---
name: "rte_cksum.h"
section: "3"
platform: "linux"
package: "dpdk-doc"
version: "24.11.4-0+deb13u1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/rte_cksum.h"
---

# rte\_cksum.h(3)

## NAME

rte\_cksum.h

## SYNOPSIS

`#include <stdint.h>`\
 `#include <rte_byteorder.h>`\
 `#include <rte_common.h>`\
 `#include <rte_mbuf.h>`\

### 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

### static uint16\_t rte\_raw\_cksum (const void \* buf, size\_t len)` [inline]`, ` [static]`

Process the non-complemented checksum of a buffer.

**Parameters**

*buf* Pointer to the buffer. \
 *len* Length of the buffer.

**Returns**

The non-complemented checksum.

Definition at line **94** of file **rte\_cksum.h**.

### static int rte\_raw\_cksum\_mbuf (const struct rte\_mbuf \* m, uint32\_t off, uint32\_t len, uint16\_t \* cksum)` [inline]`, ` [static]`

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

**Parameters**

*m* The pointer to the mbuf. \
 *off* The offset in bytes to start the checksum. \
 *len* The length in bytes of the data to checksum. \
 *cksum* A 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**.

## Author

Generated automatically by Doxygen for DPDK from the source code.
