X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=app%2Ftest-pmd%2Ftestpmd.h;h=a1f661472a38b22e077e1a97e8939cf3852a7a26;hb=ac91bc493cdde005bab596576665eb7960dafe29;hp=a33b525e2dedbd9f67c55dd9ab9dffb9d3e4d072;hpb=39e5e20f0defa67627e5f53c2d9d62db51fa2d0c;p=dpdk.git diff --git a/app/test-pmd/testpmd.h b/app/test-pmd/testpmd.h index a33b525e2d..a1f661472a 100644 --- a/app/test-pmd/testpmd.h +++ b/app/test-pmd/testpmd.h @@ -57,10 +57,10 @@ typedef uint16_t streamid_t; #define MAX_QUEUE_ID ((1 << (sizeof(queueid_t) * 8)) - 1) -#if defined RTE_LIBRTE_PMD_SOFTNIC && defined RTE_LIBRTE_SCHED -#define TM_MODE 1 +#if defined RTE_LIBRTE_PMD_SOFTNIC +#define SOFTNIC 1 #else -#define TM_MODE 0 +#define SOFTNIC 0 #endif enum { @@ -135,35 +135,13 @@ struct port_flow { uint8_t data[]; /**< Storage for pattern/actions. */ }; -#ifdef TM_MODE -/** - * Soft port tm related parameters - */ -struct softnic_port_tm { - uint32_t default_hierarchy_enable; /**< def hierarchy enable flag */ - uint32_t hierarchy_config; /**< set to 1 if hierarchy configured */ - - uint32_t n_subports_per_port; /**< Num of subport nodes per port */ - uint32_t n_pipes_per_subport; /**< Num of pipe nodes per subport */ - - uint64_t tm_pktfield0_slabpos; /**< Pkt field position for subport */ - uint64_t tm_pktfield0_slabmask; /**< Pkt field mask for the subport */ - uint64_t tm_pktfield0_slabshr; - uint64_t tm_pktfield1_slabpos; /**< Pkt field position for the pipe */ - uint64_t tm_pktfield1_slabmask; /**< Pkt field mask for the pipe */ - uint64_t tm_pktfield1_slabshr; - uint64_t tm_pktfield2_slabpos; /**< Pkt field position table index */ - uint64_t tm_pktfield2_slabmask; /**< Pkt field mask for tc table idx */ - uint64_t tm_pktfield2_slabshr; - uint64_t tm_tc_table[64]; /**< TC translation table */ -}; - +#ifdef SOFTNIC /** * The data structure associate with softnic port */ struct softnic_port { - unsigned int tm_flag; /**< set to 1 if tm feature is enabled */ - struct softnic_port_tm tm; /**< softnic port tm parameters */ + uint32_t default_tm_hierarchy_enable; /**< default tm hierarchy */ + struct fwd_lcore **fwd_lcore_arg; /**< softnic fwd core parameters */ }; #endif @@ -202,9 +180,8 @@ struct rte_port { uint32_t mc_addr_nb; /**< nb. of addr. in mc_addr_pool */ uint8_t slave_flag; /**< bonding slave port */ struct port_flow *flow_list; /**< Associated flows. */ -#ifdef TM_MODE - unsigned int softnic_enable; /**< softnic flag */ - struct softnic_port softport; /**< softnic port params */ +#ifdef SOFTNIC + struct softnic_port softport; /**< softnic params */ #endif }; @@ -266,9 +243,8 @@ extern struct fwd_engine rx_only_engine; extern struct fwd_engine tx_only_engine; extern struct fwd_engine csum_fwd_engine; extern struct fwd_engine icmp_echo_engine; -#ifdef TM_MODE -extern struct fwd_engine softnic_tm_engine; -extern struct fwd_engine softnic_tm_bypass_engine; +#ifdef SOFTNIC +extern struct fwd_engine softnic_fwd_engine; #endif #ifdef RTE_LIBRTE_IEEE1588 extern struct fwd_engine ieee1588_fwd_engine; @@ -334,9 +310,9 @@ extern volatile int test_done; /* stop packet forwarding when set to 1. */ extern uint8_t lsc_interrupt; /**< disabled by "--no-lsc-interrupt" parameter */ extern uint8_t rmv_interrupt; /**< disabled by "--no-rmv-interrupt" parameter */ extern uint32_t event_print_mask; -extern uint8_t hot_plug; /**< enable by "--hot-plug" parameter */ - /**< set by "--print-event xxxx" and "--mask-event xxxx parameters */ +extern uint8_t hot_plug; /**< enable by "--hot-plug" parameter */ +extern int do_mlockall; /**< set by "--mlockall" or "--no-mlockall" parameter */ #ifdef RTE_LIBRTE_IXGBE_BYPASS extern uint32_t bypass_timeout; /**< Store the NIC bypass watchdog timeout */ @@ -479,6 +455,38 @@ struct gso_status { extern struct gso_status gso_ports[RTE_MAX_ETHPORTS]; extern uint16_t gso_max_segment_size; +/* VXLAN encap/decap parameters. */ +struct vxlan_encap_conf { + uint32_t select_ipv4:1; + uint32_t select_vlan:1; + uint8_t vni[3]; + rte_be16_t udp_src; + rte_be16_t udp_dst; + rte_be32_t ipv4_src; + rte_be32_t ipv4_dst; + uint8_t ipv6_src[16]; + uint8_t ipv6_dst[16]; + rte_be16_t vlan_tci; + uint8_t eth_src[ETHER_ADDR_LEN]; + uint8_t eth_dst[ETHER_ADDR_LEN]; +}; +struct vxlan_encap_conf vxlan_encap_conf; + +/* NVGRE encap/decap parameters. */ +struct nvgre_encap_conf { + uint32_t select_ipv4:1; + uint32_t select_vlan:1; + uint8_t tni[3]; + rte_be32_t ipv4_src; + rte_be32_t ipv4_dst; + uint8_t ipv6_src[16]; + uint8_t ipv6_dst[16]; + rte_be16_t vlan_tci; + uint8_t eth_src[ETHER_ADDR_LEN]; + uint8_t eth_dst[ETHER_ADDR_LEN]; +}; +struct nvgre_encap_conf nvgre_encap_conf; + static inline unsigned int lcore_num(void) { @@ -596,6 +604,7 @@ void fwd_config_setup(void); void set_def_fwd_config(void); void reconfig(portid_t new_port_id, unsigned socket_id); int init_fwd_streams(void); +void update_fwd_ports(portid_t new_pid); void set_fwd_eth_peer(portid_t port_id, char *peer_addr); @@ -620,7 +629,7 @@ int port_flow_create(portid_t port_id, int port_flow_destroy(portid_t port_id, uint32_t n, const uint32_t *rule); int port_flow_flush(portid_t port_id); int port_flow_query(portid_t port_id, uint32_t rule, - enum rte_flow_action_type action); + const struct rte_flow_action *action); void port_flow_list(portid_t port_id, uint32_t n, const uint32_t *group); int port_flow_isolate(portid_t port_id, int set); @@ -726,6 +735,7 @@ enum print_warning { DISABLED_WARN }; int port_id_is_invalid(portid_t port_id, enum print_warning warning); +void print_valid_ports(void); int new_socket_id(unsigned int socket_id); queueid_t get_allowed_max_nb_rxq(portid_t *pid);