1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(c) 2010-2016 Intel Corporation
11 #include <sys/queue.h>
17 #include <rte_common.h>
18 #include <rte_byteorder.h>
20 #include <rte_memory.h>
21 #include <rte_memcpy.h>
23 #include <rte_per_lcore.h>
24 #include <rte_launch.h>
25 #include <rte_cycles.h>
26 #include <rte_prefetch.h>
27 #include <rte_lcore.h>
28 #include <rte_branch_prediction.h>
29 #include <rte_interrupts.h>
31 #include <rte_random.h>
32 #include <rte_debug.h>
33 #include <rte_ether.h>
34 #include <rte_ethdev.h>
35 #include <rte_mempool.h>
45 main(int argc, char **argv)
51 ret = rte_eal_init(argc, argv);
57 /* Parse application arguments (after the EAL ones) */
58 ret = app_parse_args(argc, argv);
67 /* Launch per-lcore init on every lcore */
68 rte_eal_mp_remote_launch(app_lcore_main_loop, NULL, CALL_MAIN);
69 RTE_LCORE_FOREACH_WORKER(lcore) {
70 if (rte_eal_wait_lcore(lcore) < 0)
78 app_lcore_main_loop(__rte_unused void *arg)
82 lcore = rte_lcore_id();
84 if (lcore == app.core_rx) {
85 switch (app.pipeline_type) {
86 case e_APP_PIPELINE_ACL:
91 app_main_loop_rx_metadata();
96 if (lcore == app.core_worker) {
97 switch (app.pipeline_type) {
98 case e_APP_PIPELINE_STUB:
99 app_main_loop_worker_pipeline_stub();
102 case e_APP_PIPELINE_HASH_KEY8_EXT:
103 case e_APP_PIPELINE_HASH_KEY8_LRU:
104 case e_APP_PIPELINE_HASH_KEY16_EXT:
105 case e_APP_PIPELINE_HASH_KEY16_LRU:
106 case e_APP_PIPELINE_HASH_KEY32_EXT:
107 case e_APP_PIPELINE_HASH_KEY32_LRU:
108 case e_APP_PIPELINE_HASH_SPEC_KEY8_EXT:
109 case e_APP_PIPELINE_HASH_SPEC_KEY8_LRU:
110 case e_APP_PIPELINE_HASH_SPEC_KEY16_EXT:
111 case e_APP_PIPELINE_HASH_SPEC_KEY16_LRU:
112 case e_APP_PIPELINE_HASH_SPEC_KEY32_EXT:
113 case e_APP_PIPELINE_HASH_SPEC_KEY32_LRU:
114 /* cases for cuckoo hash table types */
115 case e_APP_PIPELINE_HASH_CUCKOO_KEY8:
116 case e_APP_PIPELINE_HASH_CUCKOO_KEY16:
117 case e_APP_PIPELINE_HASH_CUCKOO_KEY32:
118 case e_APP_PIPELINE_HASH_CUCKOO_KEY48:
119 case e_APP_PIPELINE_HASH_CUCKOO_KEY64:
120 case e_APP_PIPELINE_HASH_CUCKOO_KEY80:
121 case e_APP_PIPELINE_HASH_CUCKOO_KEY96:
122 case e_APP_PIPELINE_HASH_CUCKOO_KEY112:
123 case e_APP_PIPELINE_HASH_CUCKOO_KEY128:
124 app_main_loop_worker_pipeline_hash();
127 case e_APP_PIPELINE_ACL:
129 rte_exit(EXIT_FAILURE, "ACL not present in build\n");
131 app_main_loop_worker_pipeline_acl();
135 case e_APP_PIPELINE_LPM:
136 app_main_loop_worker_pipeline_lpm();
139 case e_APP_PIPELINE_LPM_IPV6:
140 app_main_loop_worker_pipeline_lpm_ipv6();
143 case e_APP_PIPELINE_NONE:
145 app_main_loop_worker();
150 if (lcore == app.core_tx) {