DPDK: Data Plane Development Kit

18.08.0
rte_meter.h File Reference
#include <stdint.h>

Go to the source code of this file.

Data Structures

struct  rte_meter_srtcm_params
struct  rte_meter_trtcm_params
struct  rte_meter_trtcm

Enumerations

enum  rte_meter_color { e_RTE_METER_GREEN = 0, e_RTE_METER_YELLOW, e_RTE_METER_RED, e_RTE_METER_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_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)
static enum rte_meter_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_meter_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_meter_color pkt_color)
static enum rte_meter_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_meter_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_meter_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

Definition in file rte_meter.h.

Enumeration Type Documentation

Packet Color Set

Enumerator:
e_RTE_METER_GREEN 

Green

e_RTE_METER_YELLOW 

Yellow

e_RTE_METER_RED 

Red

e_RTE_METER_COLORS 

Number of available colors

Definition at line 30 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
pPointer to pre-allocated srTCM profile data structure
paramssrTCM profile parameters
Returns
0 upon success, error code otherwise
Examples:
examples/qos_meter/main.c.
int rte_meter_trtcm_profile_config ( struct rte_meter_trtcm_profile *  p,
struct rte_meter_trtcm_params params 
)

trTCM profile configuration

Parameters
pPointer to pre-allocated trTCM profile data structure
paramstrTCM profile parameters
Returns
0 upon success, error code otherwise
Examples:
examples/qos_meter/main.c.
int rte_meter_srtcm_config ( struct rte_meter_srtcm *  m,
struct rte_meter_srtcm_profile *  p 
)

srTCM configuration per metered traffic flow

Parameters
mPointer to pre-allocated srTCM data structure
psrTCM 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
mPointer to pre-allocated trTCM data structure
ptrTCM profile. Needs to be valid.
Returns
0 upon success, error code otherwise
static enum rte_meter_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 
)
inlinestatic

srTCM color blind traffic metering

Parameters
mHandle to srTCM instance
psrTCM profile specified at srTCM object creation time
timeCurrent CPU time stamp (measured in CPU cycles)
pkt_lenLength of the current IP packet (measured in bytes)
Returns
Color assigned to the current IP packet

Definition at line 270 of file rte_meter.h.

static enum rte_meter_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_meter_color  pkt_color 
)
inlinestatic

srTCM color aware traffic metering

Parameters
mHandle to srTCM instance
psrTCM profile specified at srTCM object creation time
timeCurrent CPU time stamp (measured in CPU cycles)
pkt_lenLength of the current IP packet (measured in bytes)
pkt_colorInput color of the current IP packet
Returns
Color assigned to the current IP packet

Definition at line 311 of file rte_meter.h.

static enum rte_meter_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 
)
inlinestatic

trTCM color blind traffic metering

Parameters
mHandle to trTCM instance
ptrTCM profile specified at trTCM object creation time
timeCurrent CPU time stamp (measured in CPU cycles)
pkt_lenLength of the current IP packet (measured in bytes)
Returns
Color assigned to the current IP packet

Definition at line 353 of file rte_meter.h.

static enum rte_meter_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_meter_color  pkt_color 
)
inlinestatic

trTCM color aware traffic metering

Parameters
mHandle to trTCM instance
ptrTCM profile specified at trTCM object creation time
timeCurrent CPU time stamp (measured in CPU cycles)
pkt_lenLength of the current IP packet (measured in bytes)
pkt_colorInput color of the current IP packet
Returns
Color assigned to the current IP packet

Definition at line 395 of file rte_meter.h.