---
name: "rte_meter.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_meter.h"
---

# rte\_meter.h(3)

## NAME

rte\_meter.h

## SYNOPSIS

`#include <stdint.h>`\

### Data Structures

struct **rte\_meter\_srtcm\_params**\
 struct **rte\_meter\_trtcm\_params**\
 struct **rte\_meter\_trtcm\_rfc4115\_params**\
 struct **rte\_meter\_trtcm**\
 struct **rte\_meter\_trtcm\_rfc4115**\

### Enumerations

enum **rte\_color** { **RTE\_COLOR\_GREEN** = 0, **RTE\_COLOR\_YELLOW**, **RTE\_COLOR\_RED**, **RTE\_COLORS** }\

### Functions

int **rte\_meter\_srtcm\_profile\_config** (struct rte\_meter\_srtcm\_profile \*p, struct **rte\_meter\_srtcm\_params** \*params)\
 int **rte\_meter\_trtcm\_profile\_config** (struct rte\_meter\_trtcm\_profile \*p, struct **rte\_meter\_trtcm\_params** \*params)\
 int **rte\_meter\_trtcm\_rfc4115\_profile\_config** (struct rte\_meter\_trtcm\_rfc4115\_profile \*p, struct **rte\_meter\_trtcm\_rfc4115\_params** \*params)\
 int **rte\_meter\_srtcm\_config** (struct rte\_meter\_srtcm \*m, struct rte\_meter\_srtcm\_profile \*p)\
 int **rte\_meter\_trtcm\_config** (struct **rte\_meter\_trtcm** \*m, struct rte\_meter\_trtcm\_profile \*p)\
 int **rte\_meter\_trtcm\_rfc4115\_config** (struct **rte\_meter\_trtcm\_rfc4115** \*m, struct rte\_meter\_trtcm\_rfc4115\_profile \*p)\
 static enum **rte\_color** **rte\_meter\_srtcm\_color\_blind\_check** (struct rte\_meter\_srtcm \*m, struct rte\_meter\_srtcm\_profile \*p, uint64\_t time, uint32\_t pkt\_len)\
 static enum **rte\_color** **rte\_meter\_srtcm\_color\_aware\_check** (struct rte\_meter\_srtcm \*m, struct rte\_meter\_srtcm\_profile \*p, uint64\_t time, uint32\_t pkt\_len, enum **rte\_color** pkt\_color)\
 static enum **rte\_color** **rte\_meter\_trtcm\_color\_blind\_check** (struct **rte\_meter\_trtcm** \*m, struct rte\_meter\_trtcm\_profile \*p, uint64\_t time, uint32\_t pkt\_len)\
 static enum **rte\_color** **rte\_meter\_trtcm\_color\_aware\_check** (struct **rte\_meter\_trtcm** \*m, struct rte\_meter\_trtcm\_profile \*p, uint64\_t time, uint32\_t pkt\_len, enum **rte\_color** pkt\_color)\
 static enum **rte\_color** **rte\_meter\_trtcm\_rfc4115\_color\_blind\_check** (struct **rte\_meter\_trtcm\_rfc4115** \*m, struct rte\_meter\_trtcm\_rfc4115\_profile \*p, uint64\_t time, uint32\_t pkt\_len)\
 static enum **rte\_color** **rte\_meter\_trtcm\_rfc4115\_color\_aware\_check** (struct **rte\_meter\_trtcm\_rfc4115** \*m, struct rte\_meter\_trtcm\_rfc4115\_profile \*p, uint64\_t time, uint32\_t pkt\_len, enum **rte\_color** pkt\_color)\

## Detailed Description

RTE Traffic Metering

Traffic metering algorithms:

- 1\.

  Single Rate Three Color Marker (srTCM): defined by IETF RFC 2697

- 2\.

  Two Rate Three Color Marker (trTCM): defined by IETF RFC 2698

- 3\.

  Two Rate Three Color Marker (trTCM): defined by IETF RFC 4115

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

## Enumeration Type Documentation

### enum rte\_color

Color

**Enumerator**

- *RTE\_COLOR\_GREEN*

  *Green*

- *RTE\_COLOR\_YELLOW*

  *Yellow*

- *RTE\_COLOR\_RED*

  *Red*

- *RTE\_COLORS*

  *Number of colors*

*Definition at line* **32** *of file* **rte\_meter.h***.*

## Function Documentation

### int rte\_meter\_srtcm\_profile\_config (struct rte\_meter\_srtcm\_profile \* p, struct rte\_meter\_srtcm\_params \* params)

*srTCM profile configuration*

**Parameters**

*p Pointer to pre-allocated srTCM profile data structure* \
 *params srTCM profile parameters*

**Returns**

*0 upon success, error code otherwise*

### int rte\_meter\_trtcm\_profile\_config (struct rte\_meter\_trtcm\_profile \* p, struct rte\_meter\_trtcm\_params \* params)

*trTCM profile configuration*

**Parameters**

*p Pointer to pre-allocated trTCM profile data structure* \
 *params trTCM profile parameters*

**Returns**

*0 upon success, error code otherwise*

### int rte\_meter\_trtcm\_rfc4115\_profile\_config (struct rte\_meter\_trtcm\_rfc4115\_profile \* p, struct rte\_meter\_trtcm\_rfc4115\_params \* params)

*trTCM RFC 4115 profile configuration*

**Parameters**

*p Pointer to pre-allocated trTCM profile data structure* \
 *params trTCM profile parameters*

**Returns**

*0 upon success, error code otherwise*

### int rte\_meter\_srtcm\_config (struct rte\_meter\_srtcm \* m, struct rte\_meter\_srtcm\_profile \* p)

*srTCM configuration per metered traffic flow*

**Parameters**

*m Pointer to pre-allocated srTCM data structure* \
 *p srTCM profile. Needs to be valid.*

**Returns**

*0 upon success, error code otherwise*

### int rte\_meter\_trtcm\_config (struct rte\_meter\_trtcm \* m, struct rte\_meter\_trtcm\_profile \* p)

*trTCM configuration per metered traffic flow*

**Parameters**

*m Pointer to pre-allocated trTCM data structure* \
 *p trTCM profile. Needs to be valid.*

**Returns**

*0 upon success, error code otherwise*

### int rte\_meter\_trtcm\_rfc4115\_config (struct rte\_meter\_trtcm\_rfc4115 \* m, struct rte\_meter\_trtcm\_rfc4115\_profile \* p)

*trTCM RFC 4115 configuration per metered traffic flow*

**Parameters**

*m Pointer to pre-allocated trTCM data structure* \
 *p trTCM profile. Needs to be valid.*

**Returns**

*0 upon success, error code otherwise*

### static enum rte\_color rte\_meter\_srtcm\_color\_blind\_check (struct rte\_meter\_srtcm \* m, struct rte\_meter\_srtcm\_profile \* p, uint64\_t time, uint32\_t pkt\_len)` [inline]`, ` [static]`

*srTCM color blind traffic metering*

**Parameters**

*m Handle to srTCM instance* \
 *p srTCM profile specified at srTCM object creation time* \
 *time Current CPU time stamp (measured in CPU cycles)* \
 *pkt\_len Length of the current IP packet (measured in bytes)*

**Returns**

*Color assigned to the current IP packet*

*Definition at line* **397** *of file* **rte\_meter.h***.*

### static enum rte\_color rte\_meter\_srtcm\_color\_aware\_check (struct rte\_meter\_srtcm \* m, struct rte\_meter\_srtcm\_profile \* p, uint64\_t time, uint32\_t pkt\_len, enum rte\_color pkt\_color)` [inline]`, ` [static]`

*srTCM color aware traffic metering*

**Parameters**

*m Handle to srTCM instance* \
 *p srTCM profile specified at srTCM object creation time* \
 *time Current CPU time stamp (measured in CPU cycles)* \
 *pkt\_len Length of the current IP packet (measured in bytes)* \
 *pkt\_color Input color of the current IP packet*

**Returns**

*Color assigned to the current IP packet*

*Definition at line* **438** *of file* **rte\_meter.h***.*

### static enum rte\_color rte\_meter\_trtcm\_color\_blind\_check (struct rte\_meter\_trtcm \* m, struct rte\_meter\_trtcm\_profile \* p, uint64\_t time, uint32\_t pkt\_len)` [inline]`, ` [static]`

*trTCM color blind traffic metering*

**Parameters**

*m Handle to trTCM instance* \
 *p trTCM profile specified at trTCM object creation time* \
 *time Current CPU time stamp (measured in CPU cycles)* \
 *pkt\_len Length of the current IP packet (measured in bytes)*

**Returns**

*Color assigned to the current IP packet*

*Definition at line* **480** *of file* **rte\_meter.h***.*

### static enum rte\_color rte\_meter\_trtcm\_color\_aware\_check (struct rte\_meter\_trtcm \* m, struct rte\_meter\_trtcm\_profile \* p, uint64\_t time, uint32\_t pkt\_len, enum rte\_color pkt\_color)` [inline]`, ` [static]`

*trTCM color aware traffic metering*

**Parameters**

*m Handle to trTCM instance* \
 *p trTCM profile specified at trTCM object creation time* \
 *time Current CPU time stamp (measured in CPU cycles)* \
 *pkt\_len Length of the current IP packet (measured in bytes)* \
 *pkt\_color Input color of the current IP packet*

**Returns**

*Color assigned to the current IP packet*

*Definition at line* **522** *of file* **rte\_meter.h***.*

### static enum rte\_color rte\_meter\_trtcm\_rfc4115\_color\_blind\_check (struct rte\_meter\_trtcm\_rfc4115 \* m, struct rte\_meter\_trtcm\_rfc4115\_profile \* p, uint64\_t time, uint32\_t pkt\_len)` [inline]`, ` [static]`

*trTCM RFC4115 color blind traffic metering*

**Parameters**

*m Handle to trTCM instance* \
 *p trTCM profile specified at trTCM object creation time* \
 *time Current CPU time stamp (measured in CPU cycles)* \
 *pkt\_len Length of the current IP packet (measured in bytes)*

**Returns**

*Color assigned to the current IP packet*

*Definition at line* **565** *of file* **rte\_meter.h***.*

### static enum rte\_color rte\_meter\_trtcm\_rfc4115\_color\_aware\_check (struct rte\_meter\_trtcm\_rfc4115 \* m, struct rte\_meter\_trtcm\_rfc4115\_profile \* p, uint64\_t time, uint32\_t pkt\_len, enum rte\_color pkt\_color)` [inline]`, ` [static]`

*trTCM RFC4115 color aware traffic metering*

**Parameters**

*m Handle to trTCM instance* \
 *p trTCM profile specified at trTCM object creation time* \
 *time Current CPU time stamp (measured in CPU cycles)* \
 *pkt\_len Length of the current IP packet (measured in bytes)* \
 *pkt\_color Input color of the current IP packet*

**Returns**

*Color assigned to the current IP packet*

*Definition at line* **608** *of file* **rte\_meter.h***.*

## Author

*Generated automatically by Doxygen for DPDK from the source code.*
