---
name: "rte_gro.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_gro.h"
---

# rte\_gro.h(3)

## NAME

rte\_gro.h

## SYNOPSIS

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

### Data Structures

struct **rte\_gro\_param**\

### Macros

\#define **RTE\_GRO\_MAX\_BURST\_ITEM\_NUM**   128U\
 \#define **RTE\_GRO\_TYPE\_MAX\_NUM**   64\
 \#define **RTE\_GRO\_TYPE\_SUPPORT\_NUM**   2\
 \#define **RTE\_GRO\_TCP\_IPV4**   (1ULL \<\< RTE\_GRO\_TCP\_IPV4\_INDEX)\
 \#define **RTE\_GRO\_IPV4\_VXLAN\_TCP\_IPV4**   (1ULL \<\< RTE\_GRO\_IPV4\_VXLAN\_TCP\_IPV4\_INDEX)\
 \#define **RTE\_GRO\_UDP\_IPV4**   (1ULL \<\< RTE\_GRO\_UDP\_IPV4\_INDEX)\
 \#define **RTE\_GRO\_IPV4\_VXLAN\_UDP\_IPV4**   (1ULL \<\< RTE\_GRO\_IPV4\_VXLAN\_UDP\_IPV4\_INDEX)\
 \#define **RTE\_GRO\_TCP\_IPV6**   (1ULL \<\< RTE\_GRO\_TCP\_IPV6\_INDEX)\

### Functions

void \* **rte\_gro\_ctx\_create** (const struct **rte\_gro\_param** \*param)\
 void **rte\_gro\_ctx\_destroy** (void \*ctx)\
 uint16\_t **rte\_gro\_reassemble\_burst** (struct **rte\_mbuf** \*\*pkts, uint16\_t nb\_pkts, const struct **rte\_gro\_param** \*param)\
 uint16\_t **rte\_gro\_reassemble** (struct **rte\_mbuf** \*\*pkts, uint16\_t nb\_pkts, void \*ctx)\
 uint16\_t **rte\_gro\_timeout\_flush** (void \*ctx, uint64\_t timeout\_cycles, uint64\_t gro\_types, struct **rte\_mbuf** \*\*out, uint16\_t max\_nb\_out)\
 uint64\_t **rte\_gro\_get\_pkt\_count** (void \*ctx)\

## Detailed Description

Interface to GRO library

Definition in file **rte\_gro.h**.

## Macro Definition Documentation

### #define RTE\_GRO\_MAX\_BURST\_ITEM\_NUM 128U

the max number of packets that **rte\_gro\_reassemble\_burst()** can process in each invocation.

Definition at line **23** of file **rte\_gro.h**.

### #define RTE\_GRO\_TYPE\_MAX\_NUM 64

the max number of supported GRO types

Definition at line **25** of file **rte\_gro.h**.

### #define RTE\_GRO\_TYPE\_SUPPORT\_NUM 2

the number of currently supported GRO types

Definition at line **27** of file **rte\_gro.h**.

### #define RTE\_GRO\_TCP\_IPV4 (1ULL \<\< RTE\_GRO\_TCP\_IPV4\_INDEX)

TCP/IPv4 GRO flag

Definition at line **31** of file **rte\_gro.h**.

### #define RTE\_GRO\_IPV4\_VXLAN\_TCP\_IPV4 (1ULL \<\< RTE\_GRO\_IPV4\_VXLAN\_TCP\_IPV4\_INDEX)

VxLAN TCP/IPv4 GRO flag.

Definition at line **34** of file **rte\_gro.h**.

### #define RTE\_GRO\_UDP\_IPV4 (1ULL \<\< RTE\_GRO\_UDP\_IPV4\_INDEX)

UDP/IPv4 GRO flag

Definition at line **37** of file **rte\_gro.h**.

### #define RTE\_GRO\_IPV4\_VXLAN\_UDP\_IPV4 (1ULL \<\< RTE\_GRO\_IPV4\_VXLAN\_UDP\_IPV4\_INDEX)

VxLAN UDP/IPv4 GRO flag.

Definition at line **40** of file **rte\_gro.h**.

### #define RTE\_GRO\_TCP\_IPV6 (1ULL \<\< RTE\_GRO\_TCP\_IPV6\_INDEX)

TCP/IPv6 GRO flag.

Definition at line **43** of file **rte\_gro.h**.

## Function Documentation

### void \* rte\_gro\_ctx\_create (const struct rte\_gro\_param \* param)

**Warning**

**EXPERIMENTAL:** this API may change without prior notice

This function create a GRO context object, which is used to merge packets in **rte\_gro\_reassemble()**.

**Parameters**

*param* applications use it to pass needed parameters to create a GRO context object.

**Returns**

if create successfully, return a pointer which points to the GRO context object. Otherwise, return NULL.

### void rte\_gro\_ctx\_destroy (void \* ctx)

**Warning**

**EXPERIMENTAL:** this API may change without prior notice

This function destroys a GRO context object.

**Parameters**

*ctx* pointer points to a GRO context object.

### uint16\_t rte\_gro\_reassemble\_burst (struct rte\_mbuf \*\* pkts, uint16\_t nb\_pkts, const struct rte\_gro\_param \* param)

This is one of the main reassembly APIs, which merges numbers of packets at a time. It doesn't check if input packets have correct checksums and doesn't re-calculate checksums for merged packets. It assumes the packets are complete (i.e., MF==0 && frag\_off==0), when IP fragmentation is possible (i.e., DF==0). The GROed packets are returned as soon as the function finishes.

**Parameters**

*pkts* Pointer array pointing to the packets to reassemble. Besides, it keeps MBUF addresses for the GROed packets. \
 *nb\_pkts* The number of packets to reassemble \
 *param* Application-determined parameters for reassembling packets.

**Returns**

The number of packets after been GROed. If no packets are merged, the return value is equals to nb\_pkts.

### uint16\_t rte\_gro\_reassemble (struct rte\_mbuf \*\* pkts, uint16\_t nb\_pkts, void \* ctx)

**Warning**

**EXPERIMENTAL:** this API may change without prior notice

Reassembly function, which tries to merge input packets with the existed packets in the reassembly tables of a given GRO context. It doesn't check if input packets have correct checksums and doesn't re-calculate checksums for merged packets. Additionally, it assumes the packets are complete (i.e., MF==0 && frag\_off==0), when IP fragmentation is possible (i.e., DF==0).

If the input packets have invalid parameters (e.g. no data payload, unsupported GRO types), they are returned to applications. Otherwise, they are either merged or inserted into the table. Applications need to flush packets from the tables by flush API, if they want to get the GROed packets.

**Parameters**

*pkts* Packets to reassemble. It's also used to store the unprocessed packets. \
 *nb\_pkts* The number of packets to reassemble \
 *ctx* GRO context object pointer

**Returns**

The number of unprocessed packets.

### uint16\_t rte\_gro\_timeout\_flush (void \* ctx, uint64\_t timeout\_cycles, uint64\_t gro\_types, struct rte\_mbuf \*\* out, uint16\_t max\_nb\_out)

**Warning**

**EXPERIMENTAL:** this API may change without prior notice

This function flushes the timeout packets from the reassembly tables of desired GRO types. The max number of flushed packets is the element number of 'out'.

Additionally, the flushed packets may have incorrect checksums, since this function doesn't re-calculate checksums for merged packets.

**Parameters**

*ctx* GRO context object pointer. \
 *timeout\_cycles* The max TTL for packets in reassembly tables, measured in nanosecond. \
 *gro\_types* This function flushes packets whose GRO types are specified by gro\_types. \
 *out* Pointer array used to keep flushed packets. \
 *max\_nb\_out* The element number of 'out'. It's also the max number of timeout packets that can be flushed finally.

**Returns**

The number of flushed packets.

### uint64\_t rte\_gro\_get\_pkt\_count (void \* ctx)

**Warning**

**EXPERIMENTAL:** this API may change without prior notice

This function returns the number of packets in all reassembly tables of a given GRO context.

**Parameters**

*ctx* GRO context object pointer.

**Returns**

The number of packets in the tables.

## Author

Generated automatically by Doxygen for DPDK from the source code.
