-
Notifications
You must be signed in to change notification settings - Fork 5
/
pfm_comm.h
88 lines (73 loc) · 1.88 KB
/
pfm_comm.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
#ifndef __PFM_COMM_H__
#define __PFM_COMM_H__ 1
#include <rte_ether.h>
#include "pfm.h"
#define MAX_LCORES 32
#define MAX_LINK_COUNT 5
#define LAST_LINK_ID MAX_LINK_COUNT
#define MAX_KNI_PORTS 5
#define MAX_LOCAL_IP_COUNT (MAX_KNI_PORTS*2)
#define MBUF_COUNT 4096
#define MBUF_CASHE_SIZE 128
#define MBUF_PRIV_SIZE 0
/* DPDK object names */
#define MBUF_NAME "MBUF"
#define TX_RING_NAME "TXRING"
#define RX_RING_NAME "RXRING"
#define DIST_NAME "DISTNAME"
#define TX_RING_SIZE 64
#define RX_RING_SIZE TX_RING_SIZE
#define TX_BURST_SIZE 32
#define RX_BURST_SIZE TX_BURST_SIZE
#define MAC_ADDR_SIZE RTE_ETHER_ADDR_LEN
#define IP_ADDR_SIZE 4
#define STR_IP_ADDR_SIZE 20
#define DEFAULT_MTU_SIZE 1500
#define DEFAULT_MIN_MTU_SIZE 68
#define DEFAULT_MAX_MTU_SIZE 65535
#define TIMER_RESOLUTION_CYCLES 20000000ULL
#define ARP_TABLE_SIZE 32
enum {
LCORE_MAIN = 0,
LCORE_RXLOOP = 1,
LCORE_TXLOOP = 2,
LCORE_DISTRIBUTOR = 3,
LCORE_WORKER = 4,
LCORE_MIN_LCORE_COUNT
};
#define MAX_WORKERS (MAX_LCORES - LCORE_WORKER)
typedef enum
{
ADMSTATE_UNLOCKED,
ADMSTATE_LOCKED,
} admin_state_t;
typedef enum
{
OPSSTATE_NOTCONFIGURED,
OPSSTATE_ENABLED,
OPSSTATE_DISABLED,
OPSSTATE_FAULTY
} ops_state_t;
typedef struct {
int kniIdx;
pfm_ip_addr_t ip_addr;
pfm_ip_addr_t network_mask;
pfm_ip_addr_t default_gateway_ip;
} local_ip_addr_t;
typedef struct {
int lcore_count;
int kni_count;
int local_ip_count;
local_ip_addr_t local_ip_addr_list[MAX_LOCAL_IP_COUNT];
struct rte_mempool *mbuf_pool;
struct rte_ring *rx_ring_ptr ;
struct rte_ring *tx_ring_ptr ;
struct rte_kni *kni_ptr;
struct rte_distributor *dist_ptr;
} sys_info_t;
extern volatile pfm_bool_t force_quit_g; /* all loops will use this
varable to determin the looping need to continue
or not. By setting this varlbale to TRUE, all loops
can be terminated */
extern sys_info_t sys_info_g;
#endif