1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(c) 2010-2016 Intel Corporation
8 #ifndef APP_MBUF_ARRAY_SIZE
9 #define APP_MBUF_ARRAY_SIZE 256
12 struct app_mbuf_array {
13 struct rte_mbuf *array[APP_MBUF_ARRAY_SIZE];
18 #define APP_MAX_PORTS 4
28 uint32_t ports[APP_MAX_PORTS];
30 uint32_t port_rx_ring_size;
31 uint32_t port_tx_ring_size;
34 struct rte_ring *rings_rx[APP_MAX_PORTS];
35 struct rte_ring *rings_tx[APP_MAX_PORTS];
36 uint32_t ring_rx_size;
37 uint32_t ring_tx_size;
39 /* Internal buffers */
40 struct app_mbuf_array mbuf_rx;
41 struct app_mbuf_array mbuf_tx[APP_MAX_PORTS];
44 struct rte_mempool *pool;
45 uint32_t pool_buffer_size;
47 uint32_t pool_cache_size;
50 uint32_t burst_size_rx_read;
51 uint32_t burst_size_rx_write;
52 uint32_t burst_size_worker_read;
53 uint32_t burst_size_worker_write;
54 uint32_t burst_size_tx_read;
55 uint32_t burst_size_tx_write;
58 uint32_t pipeline_type;
59 } __rte_cache_aligned;
61 extern struct app_params app;
63 int app_parse_args(int argc, char **argv);
64 void app_print_usage(void);
66 int app_lcore_main_loop(void *arg);
70 e_APP_PIPELINE_NONE = 0,
73 e_APP_PIPELINE_HASH_KEY8_EXT,
74 e_APP_PIPELINE_HASH_KEY8_LRU,
75 e_APP_PIPELINE_HASH_KEY16_EXT,
76 e_APP_PIPELINE_HASH_KEY16_LRU,
77 e_APP_PIPELINE_HASH_KEY32_EXT,
78 e_APP_PIPELINE_HASH_KEY32_LRU,
80 e_APP_PIPELINE_HASH_SPEC_KEY8_EXT,
81 e_APP_PIPELINE_HASH_SPEC_KEY8_LRU,
82 e_APP_PIPELINE_HASH_SPEC_KEY16_EXT,
83 e_APP_PIPELINE_HASH_SPEC_KEY16_LRU,
84 e_APP_PIPELINE_HASH_SPEC_KEY32_EXT,
85 e_APP_PIPELINE_HASH_SPEC_KEY32_LRU,
89 e_APP_PIPELINE_LPM_IPV6,
91 e_APP_PIPELINE_HASH_CUCKOO_KEY8,
92 e_APP_PIPELINE_HASH_CUCKOO_KEY16,
93 e_APP_PIPELINE_HASH_CUCKOO_KEY32,
94 e_APP_PIPELINE_HASH_CUCKOO_KEY48,
95 e_APP_PIPELINE_HASH_CUCKOO_KEY64,
96 e_APP_PIPELINE_HASH_CUCKOO_KEY80,
97 e_APP_PIPELINE_HASH_CUCKOO_KEY96,
98 e_APP_PIPELINE_HASH_CUCKOO_KEY112,
99 e_APP_PIPELINE_HASH_CUCKOO_KEY128,
103 void app_main_loop_rx(void);
104 void app_main_loop_rx_metadata(void);
105 uint64_t test_hash(void *key,
110 uint32_t test_hash_cuckoo(const void *key,
114 void app_main_loop_worker(void);
115 void app_main_loop_worker_pipeline_stub(void);
116 void app_main_loop_worker_pipeline_hash(void);
117 void app_main_loop_worker_pipeline_acl(void);
118 void app_main_loop_worker_pipeline_lpm(void);
119 void app_main_loop_worker_pipeline_lpm_ipv6(void);
121 void app_main_loop_tx(void);
125 #define APP_FLUSH 0x3FF
128 #define APP_METADATA_OFFSET(offset) (sizeof(struct rte_mbuf) + (offset))
130 #endif /* _MAIN_H_ */