NVIDIA DOCA SDK Data Center on a Chip Framework Documentation
flow_shared_meter_sample.c File Reference
#include <string.h>
#include <unistd.h>
#include <rte_byteorder.h>
#include <doca_log.h>
#include <doca_flow.h>
#include "flow_common.h"
Include dependency graph for flow_shared_meter_sample.c:

Go to the source code of this file.

Macros

#define METER_COLOR_MASK   3
 
#define SET_L4_PORT(layer, port, value)
 

Functions

 DOCA_LOG_REGISTER (FLOW_SHARED_METER)
 
static doca_error_t create_color_matched_pipe (struct doca_flow_port *port, const struct doca_flow_fwd *fwd_on_green, const struct doca_flow_fwd *fwd_on_red, struct doca_flow_pipe **color_pipe)
 
static doca_error_t create_shared_meter_mark_pipe (struct doca_flow_port *port, enum doca_flow_l4_meta out_l4_meta_type, enum doca_flow_l4_type_ext out_l4_type, struct doca_flow_pipe *color_pipe, struct doca_flow_pipe **pipe)
 
static doca_error_t add_shared_meter_pipe_entry (struct doca_flow_pipe *pipe, enum doca_flow_l4_type_ext out_l4_type, uint32_t shared_meter_id, struct entries_status *status)
 
static doca_error_t create_control_pipe (struct doca_flow_port *port, struct doca_flow_pipe **pipe)
 
static doca_error_t add_control_pipe_entries (struct doca_flow_pipe *control_pipe, struct doca_flow_pipe *tcp_pipe, struct doca_flow_pipe *udp_pipe, struct entries_status *status)
 
doca_error_t flow_shared_meter (int nb_queues)
 

Macro Definition Documentation

◆ METER_COLOR_MASK

#define METER_COLOR_MASK   3

Definition at line 39 of file flow_shared_meter_sample.c.

◆ SET_L4_PORT

#define SET_L4_PORT (   layer,
  port,
  value 
)
Value:
do { \
if (match.layer.l4_type_ext == DOCA_FLOW_L4_TYPE_EXT_TCP) \
match.layer.tcp.l4_port.port = (value); \
else if (match.layer.l4_type_ext == DOCA_FLOW_L4_TYPE_EXT_UDP) \
match.layer.udp.l4_port.port = (value); \
} while (0)
@ DOCA_FLOW_L4_TYPE_EXT_TCP
@ DOCA_FLOW_L4_TYPE_EXT_UDP
type value

Definition at line 42 of file flow_shared_meter_sample.c.

Function Documentation

◆ add_control_pipe_entries()

static doca_error_t add_control_pipe_entries ( struct doca_flow_pipe *  control_pipe,
struct doca_flow_pipe *  tcp_pipe,
struct doca_flow_pipe *  udp_pipe,
struct entries_status status 
)
static

Definition at line 304 of file flow_shared_meter_sample.c.

◆ add_shared_meter_pipe_entry()

static doca_error_t add_shared_meter_pipe_entry ( struct doca_flow_pipe *  pipe,
enum doca_flow_l4_type_ext  out_l4_type,
uint32_t  shared_meter_id,
struct entries_status status 
)
static

Definition at line 224 of file flow_shared_meter_sample.c.

◆ create_color_matched_pipe()

static doca_error_t create_color_matched_pipe ( struct doca_flow_port *  port,
const struct doca_flow_fwd fwd_on_green,
const struct doca_flow_fwd fwd_on_red,
struct doca_flow_pipe **  color_pipe 
)
static

Definition at line 59 of file flow_shared_meter_sample.c.

◆ create_control_pipe()

static doca_error_t create_control_pipe ( struct doca_flow_port *  port,
struct doca_flow_pipe **  pipe 
)
static

Definition at line 271 of file flow_shared_meter_sample.c.

◆ create_shared_meter_mark_pipe()

static doca_error_t create_shared_meter_mark_pipe ( struct doca_flow_port *  port,
enum doca_flow_l4_meta  out_l4_meta_type,
enum doca_flow_l4_type_ext  out_l4_type,
struct doca_flow_pipe *  color_pipe,
struct doca_flow_pipe **  pipe 
)
static

Definition at line 144 of file flow_shared_meter_sample.c.

◆ DOCA_LOG_REGISTER()

DOCA_LOG_REGISTER ( FLOW_SHARED_METER  )

◆ flow_shared_meter()

doca_error_t flow_shared_meter ( int  nb_queues)

Definition at line 376 of file flow_shared_meter_sample.c.