NVIDIA DOCA SDK Data Center on a Chip Framework Documentation
switch_core.c File Reference
#include <rte_ethdev.h>
#include <doca_log.h>
#include "utils.h"
#include "dpdk_utils.h"
#include "flow_pipes_manager.h"
#include "switch_core.h"
#include "flow_common.h"
Include dependency graph for switch_core.c:

Go to the source code of this file.

Macros

#define MAX_PORT_STR_LEN   128 /* Maximal length of port name */
 
#define DEFAULT_TIMEOUT_US   (10000) /* Timeout for processing pipe entries */
 

Functions

 DOCA_LOG_REGISTER (SWITCH::Core)
 
static void pipe_create (struct doca_flow_pipe_cfg *cfg, uint16_t port_id, struct doca_flow_fwd *fwd, uint64_t fw_pipe_id, struct doca_flow_fwd *fwd_miss, uint64_t fw_miss_pipe_id)
 
static void pipe_add_entry (uint16_t pipe_queue, uint64_t pipe_id, struct doca_flow_match *match, struct doca_flow_actions *actions, struct doca_flow_monitor *monitor, struct doca_flow_fwd *fwd, uint64_t fw_pipe_id, uint32_t flags)
 
static void pipe_control_add_entry (uint16_t pipe_queue, uint8_t priority, uint64_t pipe_id, struct doca_flow_match *match, struct doca_flow_match *match_mask, struct doca_flow_fwd *fwd, uint64_t fw_pipe_id)
 
static void pipe_destroy (uint64_t pipe_id)
 
static void pipe_rm_entry (uint16_t pipe_queue, uint64_t entry_id, uint32_t flags)
 
static void port_pipes_flush (uint16_t port_id)
 
static void flow_query (uint64_t entry_id, struct doca_flow_resource_query *stats)
 
static void port_pipes_dump (uint16_t port_id, FILE *fd)
 
static void register_actions_on_flow_parser (void)
 
doca_error_t switch_init (struct application_dpdk_config *app_dpdk_config, struct flow_switch_ctx *ctx)
 
void switch_destroy (void)
 

Variables

static struct flow_pipes_managerpipes_manager
 
static struct doca_flow_port * ports [FLOW_SWITCH_PORTS_MAX]
 
static uint32_t actions_mem_size [FLOW_SWITCH_PORTS_MAX]
 
static int nb_ports
 

Macro Definition Documentation

◆ DEFAULT_TIMEOUT_US

#define DEFAULT_TIMEOUT_US   (10000) /* Timeout for processing pipe entries */

Definition at line 39 of file switch_core.c.

◆ MAX_PORT_STR_LEN

#define MAX_PORT_STR_LEN   128 /* Maximal length of port name */

Definition at line 38 of file switch_core.c.

Function Documentation

◆ DOCA_LOG_REGISTER()

DOCA_LOG_REGISTER ( SWITCH::Core  )

◆ flow_query()

static void flow_query ( uint64_t  entry_id,
struct doca_flow_resource_query stats 
)
static

Definition at line 330 of file switch_core.c.

◆ pipe_add_entry()

static void pipe_add_entry ( uint16_t  pipe_queue,
uint64_t  pipe_id,
struct doca_flow_match match,
struct doca_flow_actions actions,
struct doca_flow_monitor monitor,
struct doca_flow_fwd fwd,
uint64_t  fw_pipe_id,
uint32_t  flags 
)
static

Definition at line 115 of file switch_core.c.

◆ pipe_control_add_entry()

static void pipe_control_add_entry ( uint16_t  pipe_queue,
uint8_t  priority,
uint64_t  pipe_id,
struct doca_flow_match match,
struct doca_flow_match match_mask,
struct doca_flow_fwd fwd,
uint64_t  fw_pipe_id 
)
static

Definition at line 192 of file switch_core.c.

◆ pipe_create()

static void pipe_create ( struct doca_flow_pipe_cfg *  cfg,
uint16_t  port_id,
struct doca_flow_fwd fwd,
uint64_t  fw_pipe_id,
struct doca_flow_fwd fwd_miss,
uint64_t  fw_miss_pipe_id 
)
static

Definition at line 56 of file switch_core.c.

◆ pipe_destroy()

static void pipe_destroy ( uint64_t  pipe_id)
static

Definition at line 255 of file switch_core.c.

◆ pipe_rm_entry()

static void pipe_rm_entry ( uint16_t  pipe_queue,
uint64_t  entry_id,
uint32_t  flags 
)
static

Definition at line 277 of file switch_core.c.

◆ port_pipes_dump()

static void port_pipes_dump ( uint16_t  port_id,
FILE *  fd 
)
static

Definition at line 353 of file switch_core.c.

◆ port_pipes_flush()

static void port_pipes_flush ( uint16_t  port_id)
static

Definition at line 309 of file switch_core.c.

◆ register_actions_on_flow_parser()

static void register_actions_on_flow_parser ( void  )
static

Definition at line 370 of file switch_core.c.

◆ switch_destroy()

void switch_destroy ( void  )

Definition at line 433 of file switch_core.c.

◆ switch_init()

doca_error_t switch_init ( struct application_dpdk_config app_dpdk_config,
struct flow_switch_ctx ctx 
)

Definition at line 382 of file switch_core.c.

Variable Documentation

◆ actions_mem_size

uint32_t actions_mem_size[FLOW_SWITCH_PORTS_MAX]
static

Definition at line 43 of file switch_core.c.

◆ nb_ports

int nb_ports
static

Definition at line 44 of file switch_core.c.

◆ pipes_manager

struct flow_pipes_manager* pipes_manager
static

Definition at line 41 of file switch_core.c.

◆ ports

struct doca_flow_port* ports[FLOW_SWITCH_PORTS_MAX]
static

Definition at line 42 of file switch_core.c.