DOCA-AR 1.0
 
Loading...
Searching...
No Matches
doca_ar_conntrack.c File Reference

simple connection tracking table module for recording flow info and modifying headers of packets forwarded by software More...

#include "doca_ar_conntrack.h"
#include <rte_hash.h>
#include <rte_jhash.h>
#include <rte_hash_crc.h>
#include <rte_mempool.h>
#include <rte_malloc.h>
#include <rte_memcpy.h>

Functions

 DOCA_LOG_REGISTER (DOCA_AR_CONNTRACK)
 
uint32_t myHash (const void *key, uint32_t key_len, uint32_t init_val)
 user-defined hash function,here we directly use the rss val precomputed by hardware as the result of hash function so that we can save the cpu cosumption
 
int doca_ar_conntrack_init_env (int _maxConntrack)
 init connection tracking table and mempool
 
struct doca_ar_conndoca_ar_add_conn (struct doca_ar_conn_match *match, uint16_t bestPath)
 get conn from mempool and add conn into the conntrack table
 
void doca_ar_del_conn (void *_conn)
 del conn from the conntrack table and put back to mempool
 
struct doca_ar_conndoca_ar_find_conn (struct doca_ar_conn_match *match)
 find the conn from conntrack table
 
int doca_ar_parse_conn (struct doca_ar_conn_match *match, struct rte_mbuf *m)
 pasrse conn match from rte_mbuf
 
void doca_ar_print_match (struct doca_ar_conn_match *match)
 debug api for pring match info
 
void doca_ar_modify_conn (struct doca_ar_conn *conn, struct rte_mbuf *m)
 modify the sport of conn and offload cksum
 
void doca_ar_dump_conn (struct cmdline *cl)
 iterate the whole conntrack table and print all conns info onto cmdline
 

Variables

struct rte_hash * CT = NULL
 
struct rte_mempool * CT_POOL = NULL
 
int maxConntrack = 0
 

Detailed Description

simple connection tracking table module for recording flow info and modifying headers of packets forwarded by software

Author
Mark Chen (markc.nosp@m.hen7.nosp@m.7888@.nosp@m.gmai.nosp@m.l.com)
Version
1.0
Date
2024-01-07

Function Documentation

◆ doca_ar_add_conn()

struct doca_ar_conn * doca_ar_add_conn ( struct doca_ar_conn_match * match,
uint16_t bestPath )

get conn from mempool and add conn into the conntrack table

Parameters
match
bestPath
Returns
struct doca_ar_conn*

◆ doca_ar_conntrack_init_env()

int doca_ar_conntrack_init_env ( int maxConntrack)

init connection tracking table and mempool

Parameters
maxConntrack
Returns
int

◆ doca_ar_del_conn()

void doca_ar_del_conn ( void * conn)

del conn from the conntrack table and put back to mempool

Parameters
conn

◆ doca_ar_dump_conn()

void doca_ar_dump_conn ( struct cmdline * cl)

iterate the whole conntrack table and print all conns info onto cmdline

Parameters
cl

◆ doca_ar_find_conn()

struct doca_ar_conn * doca_ar_find_conn ( struct doca_ar_conn_match * match)

find the conn from conntrack table

Parameters
match
Returns
struct doca_ar_conn*

◆ doca_ar_modify_conn()

void doca_ar_modify_conn ( struct doca_ar_conn * conn,
struct rte_mbuf * m )

modify the sport of conn and offload cksum

Parameters
conn
m

◆ doca_ar_parse_conn()

int doca_ar_parse_conn ( struct doca_ar_conn_match * match,
struct rte_mbuf * m )

pasrse conn match from rte_mbuf

Parameters
match
m
Returns
int

◆ doca_ar_print_match()

void doca_ar_print_match ( struct doca_ar_conn_match * match)

debug api for pring match info

Parameters
match

◆ DOCA_LOG_REGISTER()

DOCA_LOG_REGISTER ( DOCA_AR_CONNTRACK )

◆ myHash()

uint32_t myHash ( const void * key,
uint32_t key_len,
uint32_t init_val )

user-defined hash function,here we directly use the rss val precomputed by hardware as the result of hash function so that we can save the cpu cosumption

Parameters
key
key_len
init_val
Returns
uint32_t

Variable Documentation

◆ CT

struct rte_hash* CT = NULL

◆ CT_POOL

struct rte_mempool* CT_POOL = NULL

◆ maxConntrack

int maxConntrack = 0