NVIDIA DOCA SDK Data Center on a Chip Framework Documentation
flow_shared_counter_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_counter_sample.c:

Go to the source code of this file.

Macros

#define SET_L4_PORT(layer, port, value)
 

Enumerations

enum  { TCP_ENTRY = 0 , UDP_ENTRY }
 

Functions

 DOCA_LOG_REGISTER (FLOW_SHARED_COUNTER)
 
static doca_error_t create_shared_counter_pipe (struct doca_flow_port *port, int port_id, enum doca_flow_l4_type_ext out_l4_type, struct doca_flow_pipe **pipe)
 
static doca_error_t add_shared_counter_pipe_entry (struct doca_flow_pipe *pipe, enum doca_flow_l4_type_ext out_l4_type, uint32_t shared_counter_id, struct entries_status *status, struct doca_flow_pipe_entry **entry)
 
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_counter (int nb_queues)
 

Macro Definition Documentation

◆ 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 39 of file flow_shared_counter_sample.c.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
TCP_ENTRY 
UDP_ENTRY 

Definition at line 47 of file flow_shared_counter_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 217 of file flow_shared_counter_sample.c.

◆ add_shared_counter_pipe_entry()

static doca_error_t add_shared_counter_pipe_entry ( struct doca_flow_pipe *  pipe,
enum doca_flow_l4_type_ext  out_l4_type,
uint32_t  shared_counter_id,
struct entries_status status,
struct doca_flow_pipe_entry **  entry 
)
static

Definition at line 138 of file flow_shared_counter_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 184 of file flow_shared_counter_sample.c.

◆ create_shared_counter_pipe()

static doca_error_t create_shared_counter_pipe ( struct doca_flow_port *  port,
int  port_id,
enum doca_flow_l4_type_ext  out_l4_type,
struct doca_flow_pipe **  pipe 
)
static

Definition at line 61 of file flow_shared_counter_sample.c.

◆ DOCA_LOG_REGISTER()

DOCA_LOG_REGISTER ( FLOW_SHARED_COUNTER  )

◆ flow_shared_counter()

doca_error_t flow_shared_counter ( int  nb_queues)

Definition at line 289 of file flow_shared_counter_sample.c.