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

the critical logic of doca-ar More...

#include "doca_ar_core.h"
#include "doca_ar_conntrack.h"
#include "doca_ar_pipe.h"
#include <cmdline_rdline.h>
#include <cmdline_parse.h>
#include <cmdline_parse_ipaddr.h>
#include <cmdline_parse_num.h>
#include <cmdline_parse_string.h>
#include <cmdline.h>
#include <rte_string_fns.h>
#include <cmdline_socket.h>
#include <rte_byteorder.h>
#include <cmdline_parse_etheraddr.h>
#include <rte_ethdev.h>

Data Structures

struct  PortStats
 packets num the control plane recv and sent More...
 
struct  PROBE_HDR
 the user-defined probe packets header More...
 
struct  cmd_simple_result
 

Macros

#define PACKET_BURST   128
 num of tx_burst and rx_burst
 
#define EXPIRE_TIME   10
 default timeout of conn
 
#define PROBE_PATH_AMOUNT   4
 default probed paths amount and packets amount we sent
 
#define PROBE_TIMEOUT   50
 Probe Timeout[ms].
 

Enumerations

enum  LB_SCHEME { DOCA_AR , ECMP }
 Load balancing scheme we used. More...
 

Functions

 DOCA_LOG_REGISTER (DOCA_AR_CORE)
 
void printPortStats (struct cmdline *cl)
 print packets num the control plane recv and sent
 
uint16_t AR (struct rte_mempool *pool, struct doca_ar_conn_match *match, struct rte_mbuf *m)
 the ar algorithm we used in doca-ar, this is the most critical function the whole app
 
int process_packets (void *args)
 logic of processing control plane packets
 
void doca_ar_cmd ()
 enter into dpdk cmdline
 
void doca_ar ()
 start doca-ar and enter into cmdline
 

Variables

struct PortStats __rte_cache_aligned
 
volatile bool force_quit = false
 flag of quit
 
unsigned int runing_lore_id = 0
 id of lcore processing packets
 
struct PortStats portStats [NB_PORTS] = {0}
 packets num the control plane recv and sent
 
enum LB_SCHEME lb_scheme = ECMP
 Load balancing scheme we used.
 
cmdline_parse_token_string_t cmd_simple
 
cmdline_parse_inst_t simple_cmdline
 
cmdline_parse_ctx_t main_ctx []
 

Detailed Description

the critical logic of doca-ar

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

Macro Definition Documentation

◆ EXPIRE_TIME

#define EXPIRE_TIME   10

default timeout of conn

◆ PACKET_BURST

#define PACKET_BURST   128

num of tx_burst and rx_burst

◆ PROBE_PATH_AMOUNT

#define PROBE_PATH_AMOUNT   4

default probed paths amount and packets amount we sent

◆ PROBE_TIMEOUT

#define PROBE_TIMEOUT   50

Probe Timeout[ms].

Enumeration Type Documentation

◆ LB_SCHEME

enum LB_SCHEME

Load balancing scheme we used.

Enumerator
DOCA_AR 

use doca-ar

ECMP 

use ecmp

Function Documentation

◆ AR()

uint16_t AR ( struct rte_mempool * pool,
struct doca_ar_conn_match * match,
struct rte_mbuf * m )

the ar algorithm we used in doca-ar, this is the most critical function the whole app

Parameters
poolpackets mempool
matchthe match of new conn
mpacket of this new conn
Returns
uint16_t the best path we probed and the final src port of this new conn

Ether

IP

UDP

Payload

offload cksum

◆ doca_ar()

void doca_ar ( )

start doca-ar and enter into cmdline

◆ doca_ar_cmd()

void doca_ar_cmd ( )

enter into dpdk cmdline

◆ DOCA_LOG_REGISTER()

DOCA_LOG_REGISTER ( DOCA_AR_CORE )

◆ printPortStats()

void printPortStats ( struct cmdline * cl)

print packets num the control plane recv and sent

Parameters
cl

◆ process_packets()

int process_packets ( void * args)

logic of processing control plane packets

Parameters
args
Returns
int

Variable Documentation

◆ __rte_cache_aligned

struct PortStats __rte_cache_aligned

◆ cmd_simple

cmdline_parse_token_string_t cmd_simple
Initial value:
=
TOKEN_STRING_INITIALIZER(struct cmd_simple_result, simple, "quit#dumpFDB#portStats#conntrack")
Definition doca_ar_core.c:278

◆ force_quit

volatile bool force_quit = false

flag of quit

◆ lb_scheme

enum LB_SCHEME lb_scheme = ECMP

Load balancing scheme we used.

◆ main_ctx

cmdline_parse_ctx_t main_ctx[]
Initial value:
= {
NULL}
cmdline_parse_inst_t simple_cmdline
Definition doca_ar_core.c:309

◆ portStats

struct PortStats portStats[NB_PORTS] = {0}

packets num the control plane recv and sent

◆ runing_lore_id

unsigned int runing_lore_id = 0

id of lcore processing packets

◆ simple_cmdline

cmdline_parse_inst_t simple_cmdline
Initial value:
= {
.f = cmd_simple_parsed,
.data = NULL,
.help_str = "quit/dumpFDB/portStats/conntrack",
.tokens = {
(void *)&cmd_simple,
NULL,
},
}
cmdline_parse_token_string_t cmd_simple
Definition doca_ar_core.c:307