2 // Copyright (c) 2017 Intel Corporation
4 // Licensed under the Apache License, Version 2.0 (the "License");
5 // you may not use this file except in compliance with the License.
6 // You may obtain a copy of the License at
8 // http://www.apache.org/licenses/LICENSE-2.0
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
19 * L3fwd common header file for LPM IPv4 and IPv6 stack initialization
22 #ifndef L3FWD_COMMON_H
23 #define L3FWD_COMMON_H
25 /* Standard Libraries */
30 #include <sys/types.h>
31 #include <sys/queue.h>
32 #include <sys/param.h>
41 /* DPDK RTE Libraries */
42 #include <rte_common.h>
44 #include <rte_jhash.h>
47 #include <rte_byteorder.h>
49 #include <rte_memory.h>
50 #include <rte_memcpy.h>
51 #include <rte_memzone.h>
53 #include <rte_per_lcore.h>
54 #include <rte_launch.h>
55 #include <rte_atomic.h>
56 #include <rte_cycles.h>
57 #include <rte_prefetch.h>
58 #include <rte_lcore.h>
59 #include <rte_per_lcore.h>
60 #include <rte_branch_prediction.h>
61 #include <rte_interrupts.h>
63 #include <rte_random.h>
64 #include <rte_debug.h>
65 #include <rte_ether.h>
66 #include <rte_ethdev.h>
68 #include <rte_mempool.h>
73 #include <rte_table_hash.h>
74 #include <rte_table.h>
75 #include <rte_table_lpm.h>
76 #include <rte_string_fns.h>
77 #include <rte_cpuflags.h>
78 #include <l3fwd_lpm4.h>
79 #include <l3fwd_lpm6.h>
80 #include <rte_table_lpm_ipv6.h>
85 #define MAX_ROUTES 4 /**< MAX route that can be added*/
86 #define L3FWD_DEBUG 1 /**< if set, enables the fast path logs */
87 #define MULTIPATH_FEAT 1 /**< if set, enables the ECMP Multicast feature */
89 //#define IPPROTO_ICMPV6 58 /**< Protocol ID for ICMPv6 */
92 * L3fwd initilazation for creating IPv4 and IPv6 LPM table.
94 void l3fwd_init(void);
97 * L3fwd IPv4 LPM table population, it calls IPv4 route add function which stores all the route in LPM table
99 void populate_lpm4_table_routes(void);
102 * L3fwd IPv6 LPM table population, it calls IPv6 route add function which stores all the route in LPM6 table
104 void populate_lpm6_table_routes(void);
107 * L3fwd LPM table population for both IPv4 and IPv6.
109 void populate_lpm_routes(void);