40 struct simple_fwd_ft_entry_head
head;
97 update = !!(query_stats.counter.total_pkts - e->last_counter);
98 e->last_counter = query_stats.
counter.total_pkts;
111 LIST_REMOVE(ft_entry, next);
136 bool still_aging =
false;
137 uint64_t t = rte_rdtsc();
142 ptr = LIST_NEXT(node, next);
177 for (i = 0; i < ft->
cfg.
size; i++) {
201 fprintf(stderr,
"Error creating thread ret:%d\n", ret);
265 uint32_t user_data_size,
271 uint32_t nb_flows_aligned;
278 if (!rte_is_power_of_2(nb_flows))
279 nb_flows_aligned = rte_align32pow2(nb_flows);
281 nb_flows_aligned = nb_flows;
283 nb_flows_aligned <<= 1;
287 ft = calloc(1, alloc_size);
294 ft->
cfg.
size = nb_flows_aligned;
295 ft->
cfg.
mask = nb_flows_aligned - 1;
299 DOCA_LOG_TRC(
"FT created: flows=%d, user_data_size=%d", nb_flows_aligned, user_data_size);
300 for (i = 0; i < ft->
cfg.
size; i++)
320 struct simple_fwd_ft_entry_head *
first;
326 LIST_FOREACH(node,
first, next)
369 struct simple_fwd_ft_entry_head *
first;
398 LIST_INSERT_HEAD(
first, new_e, next);
415 for (i = 0; i < ft->
cfg.
size; i++) {
417 while (node !=
NULL) {
418 ptr = LIST_NEXT(node, next);
static struct doca_flow_pipe_entry * entry[MAX_ENTRIES]
enum doca_error doca_error_t
DOCA API return codes.
DOCA_STABLE const char * doca_error_get_descr(doca_error_t error)
Returns the description string of an error code.
@ DOCA_ERROR_INVALID_VALUE
DOCA_EXPERIMENTAL doca_error_t doca_flow_resource_query_entry(struct doca_flow_pipe_entry *entry, struct doca_flow_resource_query *query_stats)
Extract information about specific entry.
#define DOCA_LOG_ERR(format,...)
Generates an ERROR application log message.
#define DOCA_LOG_WARN(format,...)
Generates a WARNING application log message.
#define DOCA_LOG_TRC(format,...)
Generates a TRACE application log message.
#define DOCA_LOG_DBG(format,...)
Generates a DEBUG application log message.
void simple_fwd_ft_update_expiration(struct simple_fwd_ft_entry *e)
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)
struct simple_fwd_ft * simple_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 void _ft_destroy_entry(struct simple_fwd_ft *ft, struct simple_fwd_ft_entry *ft_entry)
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)
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_destroy(struct simple_fwd_ft *ft)
void simple_fwd_ft_destroy_entry(struct simple_fwd_ft *ft, struct simple_fwd_ft_entry *ft_entry)
static int simple_fwd_ft_key_fill(struct simple_fwd_pkt_info *pinfo, struct simple_fwd_ft_key *key)
static bool simple_fwd_ft_update_counter(struct simple_fwd_ft_entry *e)
static bool simple_fwd_ft_key_equal(struct simple_fwd_ft_key *key1, struct simple_fwd_ft_key *key2)
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)
void simple_fwd_ft_update_age_sec(struct simple_fwd_ft_entry *e, uint32_t age_sec)
DOCA_LOG_REGISTER(SIMPLE_FWD_FT)
static bool simple_fwd_ft_aging_ft_entry(struct simple_fwd_ft *ft, unsigned int i)
#define simple_fwd_ft_key_get_dst_port(inner, pinfo)
#define simple_fwd_ft_key_get_ipv4_src(inner, pinfo)
#define simple_fwd_ft_key_get_ipv4_dst(inner, pinfo)
#define simple_fwd_ft_key_get_src_port(inner, pinfo)
struct doca_flow_resource_query::@115::@117 counter
struct simple_fwd_ft_entry_head head
struct simple_fwd_ft_key key
struct simple_fwd_ft_user_ctx user_ctx
struct simple_fwd_ft_bucket buckets[0]
struct simple_fwd_ft_cfg cfg
void(* simple_fwd_aging_cb)(struct simple_fwd_ft_user_ctx *ctx)
struct simple_fwd_ft_stats stats
volatile int stop_aging_thread
void(* simple_fwd_aging_hw_cb)(void)
struct simple_fwd_pkt_format outer
enum doca_flow_tun_type tun_type
struct simple_fwd_pkt_format inner
struct simple_fwd_pkt_tun_format tun
struct upf_accel_ctx * ctx