X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=examples%2Fl3fwd%2Fl3fwd.h;h=38ca19133c9a3915836ae1344199da595db208a8;hb=79aab97c94024c4f969308ec806efb168cccc83d;hp=b3cdcd4963c851dd11a1b1b29f57088efca4a2fd;hpb=99fc91d18082688533c008bc0f500f69522c8900;p=dpdk.git diff --git a/examples/l3fwd/l3fwd.h b/examples/l3fwd/l3fwd.h index b3cdcd4963..38ca19133c 100644 --- a/examples/l3fwd/l3fwd.h +++ b/examples/l3fwd/l3fwd.h @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause - * Copyright(c) 2010-2016 Intel Corporation + * Copyright(c) 2010-2021 Intel Corporation */ #ifndef __L3_FWD_H__ @@ -12,7 +12,7 @@ #define RTE_LOGTYPE_L3FWD RTE_LOGTYPE_USER1 -#if !defined(NO_HASH_MULTI_LOOKUP) && defined(RTE_MACHINE_CPUFLAG_NEON) +#if !defined(NO_HASH_MULTI_LOOKUP) && defined(__ARM_NEON) #define NO_HASH_MULTI_LOOKUP 1 #endif @@ -28,6 +28,8 @@ #define MEMPOOL_CACHE_SIZE 256 #define MAX_RX_QUEUE_PER_LCORE 16 +#define VECTOR_SIZE_DEFAULT MAX_PKT_BURST +#define VECTOR_TMO_NS_DEFAULT 1E6 /* 1ms */ /* * Try to avoid TX buffering if we have at least MAX_TX_BURST packets to send. */ @@ -54,7 +56,7 @@ /* 32-bit has less address-space for hugepage memory, limit to 1M entries */ #define L3FWD_HASH_ENTRIES (1024*1024*1) #endif -#define HASH_ENTRY_NUMBER_DEFAULT 4 +#define HASH_ENTRY_NUMBER_DEFAULT 16 struct mbuf_table { uint16_t len; @@ -180,13 +182,16 @@ is_valid_ipv4_pkt(struct rte_ipv4_hdr *pkt, uint32_t link_len) int init_mem(uint16_t portid, unsigned int nb_mbuf); -/* Function pointers for LPM or EM functionality. */ +/* Function pointers for LPM, EM or FIB functionality. */ void setup_lpm(const int socketid); void setup_hash(const int socketid); +void +setup_fib(const int socketid); + int em_check_ptype(int portid); @@ -202,21 +207,67 @@ lpm_cb_parse_ptype(uint16_t port, uint16_t queue, struct rte_mbuf *pkts[], uint16_t nb_pkts, uint16_t max_pkts, void *user_param); int -em_main_loop(__attribute__((unused)) void *dummy); +em_main_loop(__rte_unused void *dummy); + +int +lpm_main_loop(__rte_unused void *dummy); int -lpm_main_loop(__attribute__((unused)) void *dummy); +fib_main_loop(__rte_unused void *dummy); int -lpm_event_main_loop_tx_d(__attribute__((unused)) void *dummy); +lpm_event_main_loop_tx_d(__rte_unused void *dummy); +int +lpm_event_main_loop_tx_d_burst(__rte_unused void *dummy); +int +lpm_event_main_loop_tx_q(__rte_unused void *dummy); +int +lpm_event_main_loop_tx_q_burst(__rte_unused void *dummy); +int +lpm_event_main_loop_tx_d_vector(__rte_unused void *dummy); int -lpm_event_main_loop_tx_d_burst(__attribute__((unused)) void *dummy); +lpm_event_main_loop_tx_d_burst_vector(__rte_unused void *dummy); int -lpm_event_main_loop_tx_q(__attribute__((unused)) void *dummy); +lpm_event_main_loop_tx_q_vector(__rte_unused void *dummy); int -lpm_event_main_loop_tx_q_burst(__attribute__((unused)) void *dummy); +lpm_event_main_loop_tx_q_burst_vector(__rte_unused void *dummy); -/* Return ipv4/ipv6 fwd lookup struct for LPM or EM. */ +int +em_event_main_loop_tx_d(__rte_unused void *dummy); +int +em_event_main_loop_tx_d_burst(__rte_unused void *dummy); +int +em_event_main_loop_tx_q(__rte_unused void *dummy); +int +em_event_main_loop_tx_q_burst(__rte_unused void *dummy); +int +em_event_main_loop_tx_d_vector(__rte_unused void *dummy); +int +em_event_main_loop_tx_d_burst_vector(__rte_unused void *dummy); +int +em_event_main_loop_tx_q_vector(__rte_unused void *dummy); +int +em_event_main_loop_tx_q_burst_vector(__rte_unused void *dummy); + +int +fib_event_main_loop_tx_d(__rte_unused void *dummy); +int +fib_event_main_loop_tx_d_burst(__rte_unused void *dummy); +int +fib_event_main_loop_tx_q(__rte_unused void *dummy); +int +fib_event_main_loop_tx_q_burst(__rte_unused void *dummy); +int +fib_event_main_loop_tx_d_vector(__rte_unused void *dummy); +int +fib_event_main_loop_tx_d_burst_vector(__rte_unused void *dummy); +int +fib_event_main_loop_tx_q_vector(__rte_unused void *dummy); +int +fib_event_main_loop_tx_q_burst_vector(__rte_unused void *dummy); + + +/* Return ipv4/ipv6 fwd lookup struct for LPM, EM or FIB. */ void * em_get_ipv4_l3fwd_lookup_struct(const int socketid); @@ -229,4 +280,10 @@ lpm_get_ipv4_l3fwd_lookup_struct(const int socketid); void * lpm_get_ipv6_l3fwd_lookup_struct(const int socketid); +void * +fib_get_ipv4_l3fwd_lookup_struct(const int socketid); + +void * +fib_get_ipv6_l3fwd_lookup_struct(const int socketid); + #endif /* __L3_FWD_H__ */