NVIDIA DOCA SDK Data Center on a Chip Framework Documentation
simple_fwd_ft.c File Reference
#include <stdint.h>
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#include <doca_flow.h>
#include <doca_log.h>
#include "simple_fwd.h"
#include "simple_fwd_ft.h"
Include dependency graph for simple_fwd_ft.c:

Go to the source code of this file.

Data Structures

struct  simple_fwd_ft_bucket
 
struct  simple_fwd_ft_stats
 
struct  simple_fwd_ft_cfg
 
struct  simple_fwd_ft
 

Functions

 DOCA_LOG_REGISTER (SIMPLE_FWD_FT)
 
void simple_fwd_ft_update_age_sec (struct simple_fwd_ft_entry *e, uint32_t age_sec)
 
void simple_fwd_ft_update_expiration (struct simple_fwd_ft_entry *e)
 
static bool simple_fwd_ft_update_counter (struct simple_fwd_ft_entry *e)
 
static void _ft_destroy_entry (struct simple_fwd_ft *ft, struct simple_fwd_ft_entry *ft_entry)
 
void simple_fwd_ft_destroy_entry (struct simple_fwd_ft *ft, struct simple_fwd_ft_entry *ft_entry)
 
static bool simple_fwd_ft_aging_ft_entry (struct simple_fwd_ft *ft, unsigned int i)
 
static void * simple_fwd_ft_aging_main (void *void_ptr)
 
static int simple_fwd_ft_aging_thread_start (struct simple_fwd_ft *ft, pthread_t *thread_id)
 
static int simple_fwd_ft_key_fill (struct simple_fwd_pkt_info *pinfo, struct simple_fwd_ft_key *key)
 
static bool simple_fwd_ft_key_equal (struct simple_fwd_ft_key *key1, struct simple_fwd_ft_key *key2)
 
struct simple_fwd_ftsimple_fwd_ft_create (int nb_flows, uint32_t user_data_size, void(*simple_fwd_aging_cb)(struct simple_fwd_ft_user_ctx *ctx), void(*simple_fwd_aging_hw_cb)(void), bool age_thread)
 
static struct simple_fwd_ft_entry_simple_fwd_ft_find (struct simple_fwd_ft *ft, struct simple_fwd_ft_key *key)
 
doca_error_t simple_fwd_ft_find (struct simple_fwd_ft *ft, struct simple_fwd_pkt_info *pinfo, struct simple_fwd_ft_user_ctx **ctx)
 
doca_error_t simple_fwd_ft_add_new (struct simple_fwd_ft *ft, struct simple_fwd_pkt_info *pinfo, struct simple_fwd_ft_user_ctx **ctx)
 
doca_error_t simple_fwd_ft_destroy (struct simple_fwd_ft *ft)
 

Function Documentation

◆ _ft_destroy_entry()

static void _ft_destroy_entry ( struct simple_fwd_ft ft,
struct simple_fwd_ft_entry ft_entry 
)
static

Definition at line 109 of file simple_fwd_ft.c.

◆ _simple_fwd_ft_find()

static struct simple_fwd_ft_entry* _simple_fwd_ft_find ( struct simple_fwd_ft ft,
struct simple_fwd_ft_key key 
)
static

Definition at line 317 of file simple_fwd_ft.c.

◆ DOCA_LOG_REGISTER()

DOCA_LOG_REGISTER ( SIMPLE_FWD_FT  )

◆ simple_fwd_ft_add_new()

doca_error_t simple_fwd_ft_add_new ( struct simple_fwd_ft ft,
struct simple_fwd_pkt_info pinfo,
struct simple_fwd_ft_user_ctx **  ctx 
)

Definition at line 361 of file simple_fwd_ft.c.

◆ simple_fwd_ft_aging_ft_entry()

static bool simple_fwd_ft_aging_ft_entry ( struct simple_fwd_ft ft,
unsigned int  i 
)
static

Definition at line 133 of file simple_fwd_ft.c.

◆ simple_fwd_ft_aging_main()

static void* simple_fwd_ft_aging_main ( void *  void_ptr)
static

Definition at line 162 of file simple_fwd_ft.c.

◆ simple_fwd_ft_aging_thread_start()

static int simple_fwd_ft_aging_thread_start ( struct simple_fwd_ft ft,
pthread_t *  thread_id 
)
static

Definition at line 194 of file simple_fwd_ft.c.

◆ simple_fwd_ft_create()

struct simple_fwd_ft* simple_fwd_ft_create ( int  nb_flows,
uint32_t  user_data_size,
void(*)(struct simple_fwd_ft_user_ctx *ctx simple_fwd_aging_cb,
void(*)(void)  simple_fwd_aging_hw_cb,
bool  age_thread 
)

Definition at line 264 of file simple_fwd_ft.c.

◆ simple_fwd_ft_destroy()

doca_error_t simple_fwd_ft_destroy ( struct simple_fwd_ft ft)

Definition at line 404 of file simple_fwd_ft.c.

◆ simple_fwd_ft_destroy_entry()

void simple_fwd_ft_destroy_entry ( struct simple_fwd_ft ft,
struct simple_fwd_ft_entry ft_entry 
)

Definition at line 117 of file simple_fwd_ft.c.

◆ simple_fwd_ft_find()

doca_error_t simple_fwd_ft_find ( struct simple_fwd_ft ft,
struct simple_fwd_pkt_info pinfo,
struct simple_fwd_ft_user_ctx **  ctx 
)

Definition at line 336 of file simple_fwd_ft.c.

◆ simple_fwd_ft_key_equal()

static bool simple_fwd_ft_key_equal ( struct simple_fwd_ft_key key1,
struct simple_fwd_ft_key key2 
)
static

Definition at line 259 of file simple_fwd_ft.c.

◆ simple_fwd_ft_key_fill()

static int simple_fwd_ft_key_fill ( struct simple_fwd_pkt_info pinfo,
struct simple_fwd_ft_key key 
)
static

Definition at line 214 of file simple_fwd_ft.c.

◆ simple_fwd_ft_update_age_sec()

void simple_fwd_ft_update_age_sec ( struct simple_fwd_ft_entry e,
uint32_t  age_sec 
)

Definition at line 73 of file simple_fwd_ft.c.

◆ simple_fwd_ft_update_counter()

static bool simple_fwd_ft_update_counter ( struct simple_fwd_ft_entry e)
static

Definition at line 90 of file simple_fwd_ft.c.

◆ simple_fwd_ft_update_expiration()

void simple_fwd_ft_update_expiration ( struct simple_fwd_ft_entry e)

Definition at line 78 of file simple_fwd_ft.c.