NVIDIA DOCA SDK Data Center on a Chip Framework Documentation
flow_pipes_manager.c File Reference
#include <rte_errno.h>
#include <rte_hash.h>
#include <rte_jhash.h>
#include <rte_malloc.h>
#include <doca_log.h>
#include <doca_error.h>
#include "flow_pipes_manager.h"
Include dependency graph for flow_pipes_manager.c:

Go to the source code of this file.

Macros

#define FNV_OFFSET   0xcbf29ce484222325 /* FNV-1a offset basis */
 
#define FNV_PRIME   0x100000001b3 /* FNV-1a prime */
 
#define DEFAULT_ENTRIES_NUM   128 /* entry table init size */
 

Functions

 DOCA_LOG_REGISTER (FLOW_PIPES_MANAGER)
 
static uint64_t * generateID (void *ptr)
 
static struct pipe_infocreate_pipe_info (struct doca_flow_pipe *pipe, struct rte_hash *pipes_table)
 
static void destroy_pipe_info (struct pipe_info *pipe_info)
 
doca_error_t create_pipes_manager (struct flow_pipes_manager **pipes_manager)
 
void destroy_pipes_manager (struct flow_pipes_manager *manager)
 
doca_error_t pipes_manager_pipe_create (struct flow_pipes_manager *manager, struct doca_flow_pipe *pipe, uint16_t port_id, uint64_t *pipe_id)
 
doca_error_t pipes_manager_pipe_add_entry (struct flow_pipes_manager *manager, struct doca_flow_pipe_entry *entry, uint64_t pipe_id, uint64_t *entry_id)
 
doca_error_t pipes_manager_get_pipe (struct flow_pipes_manager *manager, uint64_t pipe_id, struct doca_flow_pipe **pipe)
 
doca_error_t pipes_manager_get_entry (struct flow_pipes_manager *manager, uint64_t entry_id, struct doca_flow_pipe_entry **entry)
 
doca_error_t pipes_manager_pipe_destroy (struct flow_pipes_manager *manager, uint64_t pipe_id)
 
doca_error_t pipes_manager_pipe_rm_entry (struct flow_pipes_manager *manager, uint64_t entry_id)
 
doca_error_t pipes_manager_pipes_flush (struct flow_pipes_manager *manager, uint16_t port_id)
 

Macro Definition Documentation

◆ DEFAULT_ENTRIES_NUM

#define DEFAULT_ENTRIES_NUM   128 /* entry table init size */

Definition at line 38 of file flow_pipes_manager.c.

◆ FNV_OFFSET

#define FNV_OFFSET   0xcbf29ce484222325 /* FNV-1a offset basis */

Definition at line 36 of file flow_pipes_manager.c.

◆ FNV_PRIME

#define FNV_PRIME   0x100000001b3 /* FNV-1a prime */

Definition at line 37 of file flow_pipes_manager.c.

Function Documentation

◆ create_pipe_info()

static struct pipe_info* create_pipe_info ( struct doca_flow_pipe *  pipe,
struct rte_hash *  pipes_table 
)
static

Definition at line 71 of file flow_pipes_manager.c.

◆ create_pipes_manager()

doca_error_t create_pipes_manager ( struct flow_pipes_manager **  pipes_manager)

RTE Hash may access memory after our key if the key length isn't divisible by 4. Hence, we will use uint32_t instead of uint16_t, and use temp variables of correct type so to ensure we don't read out of bounds of the original (uint16_t) variable.

Definition at line 109 of file flow_pipes_manager.c.

◆ destroy_pipe_info()

static void destroy_pipe_info ( struct pipe_info pipe_info)
static

Definition at line 103 of file flow_pipes_manager.c.

◆ destroy_pipes_manager()

void destroy_pipes_manager ( struct flow_pipes_manager manager)

Definition at line 160 of file flow_pipes_manager.c.

◆ DOCA_LOG_REGISTER()

DOCA_LOG_REGISTER ( FLOW_PIPES_MANAGER  )

◆ generateID()

static uint64_t* generateID ( void *  ptr)
static

Definition at line 48 of file flow_pipes_manager.c.

◆ pipes_manager_get_entry()

doca_error_t pipes_manager_get_entry ( struct flow_pipes_manager manager,
uint64_t  entry_id,
struct doca_flow_pipe_entry **  entry 
)

Definition at line 371 of file flow_pipes_manager.c.

◆ pipes_manager_get_pipe()

doca_error_t pipes_manager_get_pipe ( struct flow_pipes_manager manager,
uint64_t  pipe_id,
struct doca_flow_pipe **  pipe 
)

Definition at line 359 of file flow_pipes_manager.c.

◆ pipes_manager_pipe_add_entry()

doca_error_t pipes_manager_pipe_add_entry ( struct flow_pipes_manager manager,
struct doca_flow_pipe_entry *  entry,
uint64_t  pipe_id,
uint64_t *  entry_id 
)

Definition at line 306 of file flow_pipes_manager.c.

◆ pipes_manager_pipe_create()

doca_error_t pipes_manager_pipe_create ( struct flow_pipes_manager manager,
struct doca_flow_pipe *  pipe,
uint16_t  port_id,
uint64_t *  pipe_id 
)

RTE Hash may access memory after our key if the key length isn't divisible by 4. Use this temp variable to ensure we don't read out of bounds of the original variable.

Definition at line 197 of file flow_pipes_manager.c.

◆ pipes_manager_pipe_destroy()

doca_error_t pipes_manager_pipe_destroy ( struct flow_pipes_manager manager,
uint64_t  pipe_id 
)

Definition at line 393 of file flow_pipes_manager.c.

◆ pipes_manager_pipe_rm_entry()

doca_error_t pipes_manager_pipe_rm_entry ( struct flow_pipes_manager manager,
uint64_t  entry_id 
)

Definition at line 432 of file flow_pipes_manager.c.

◆ pipes_manager_pipes_flush()

doca_error_t pipes_manager_pipes_flush ( struct flow_pipes_manager manager,
uint16_t  port_id 
)

RTE Hash may access memory after our key if the key length isn't divisible by 4. Use this temp variable to ensure we don't read out of bounds of the original variable.

Definition at line 471 of file flow_pipes_manager.c.