X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=app%2Ftest-pmd%2Ftestpmd.h;h=abee0a952a31d100b7e8ba43672882ac2232126b;hb=6d13ea8e8e49ab957deae2bba5ecf4a4bfe747d1;hp=f51cd9dd9bbdae3a246ba242240d747cab05a61d;hpb=03ce2c53a3905b11e54c424ca395ae5bea186cbd;p=dpdk.git diff --git a/app/test-pmd/testpmd.h b/app/test-pmd/testpmd.h index f51cd9dd9b..abee0a952a 100644 --- a/app/test-pmd/testpmd.h +++ b/app/test-pmd/testpmd.h @@ -5,6 +5,8 @@ #ifndef _TESTPMD_H_ #define _TESTPMD_H_ +#include + #include #include #include @@ -57,10 +59,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 { @@ -69,6 +71,16 @@ enum { PORT_TOPOLOGY_LOOP, }; +enum { + MP_ALLOC_NATIVE, /**< allocate and populate mempool natively */ + MP_ALLOC_ANON, + /**< allocate mempool natively, but populate using anonymous memory */ + MP_ALLOC_XMEM, + /**< allocate and populate mempool using anonymous memory */ + MP_ALLOC_XMEM_HUGE + /**< allocate and populate mempool using anonymous hugepage memory */ +}; + #ifdef RTE_TEST_PMD_RECORD_BURST_STATS /** * The data structure associated with RX and TX packet burst statistics @@ -107,11 +119,13 @@ struct fwd_stream { unsigned int retry_enabled; /* "read-write" results */ - unsigned int rx_packets; /**< received packets */ - unsigned int tx_packets; /**< received packets transmitted */ - unsigned int fwd_dropped; /**< received packets not forwarded */ - unsigned int rx_bad_ip_csum ; /**< received packets has bad ip checksum */ - unsigned int rx_bad_l4_csum ; /**< received packets has bad l4 checksum */ + uint64_t rx_packets; /**< received packets */ + uint64_t tx_packets; /**< received packets transmitted */ + uint64_t fwd_dropped; /**< received packets not forwarded */ + uint64_t rx_bad_ip_csum ; /**< received packets has bad ip checksum */ + uint64_t rx_bad_l4_csum ; /**< received packets has bad l4 checksum */ + uint64_t rx_bad_outer_l4_csum; + /**< received packets has bad outer l4 checksum */ unsigned int gro_times; /**< GRO operation times */ #ifdef RTE_TEST_PMD_RECORD_CORE_CYCLES uint64_t core_cycles; /**< used for RX and TX processing */ @@ -124,46 +138,21 @@ struct fwd_stream { /** Descriptor for a single flow. */ struct port_flow { - size_t size; /**< Allocated space including data[]. */ struct port_flow *next; /**< Next flow in list. */ struct port_flow *tmp; /**< Temporary linking. */ uint32_t id; /**< Flow rule ID. */ struct rte_flow *flow; /**< Opaque flow object returned by PMD. */ - struct rte_flow_attr attr; /**< Attributes. */ - struct rte_flow_item *pattern; /**< Pattern. */ - struct rte_flow_action *actions; /**< Actions. */ - 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 */ + struct rte_flow_conv_rule rule; /* Saved flow rule description. */ + uint8_t data[]; /**< Storage for flow rule description */ }; +#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 @@ -173,23 +162,18 @@ struct softnic_port { struct rte_port { struct rte_eth_dev_info dev_info; /**< PCI info + driver name */ struct rte_eth_conf dev_conf; /**< Port configuration. */ - struct ether_addr eth_addr; /**< Port ethernet address */ + struct rte_ether_addr eth_addr; /**< Port ethernet address */ struct rte_eth_stats stats; /**< Last port statistics */ - uint64_t tx_dropped; /**< If no descriptor in TX ring */ - struct fwd_stream *rx_stream; /**< Port RX stream, if unique */ - struct fwd_stream *tx_stream; /**< Port TX stream, if unique */ unsigned int socket_id; /**< For NUMA support */ uint16_t parse_tunnel:1; /**< Parse internal headers */ uint16_t tso_segsz; /**< Segmentation offload MSS for non-tunneled packets. */ uint16_t tunnel_tso_segsz; /**< Segmentation offload MSS for tunneled pkts. */ uint16_t tx_vlan_id;/**< The tag ID */ uint16_t tx_vlan_id_outer;/**< The outer tag ID */ - void *fwd_ctx; /**< Forwarding mode context */ - uint64_t rx_bad_ip_csum; /**< rx pkts with bad ip checksum */ - uint64_t rx_bad_l4_csum; /**< rx pkts with bad l4 checksum */ uint8_t tx_queue_stats_mapping_enabled; uint8_t rx_queue_stats_mapping_enabled; volatile uint16_t port_status; /**< port started or not */ + uint8_t need_setup; /**< port just attached */ uint8_t need_reconfig; /**< need reconfiguring port or not */ uint8_t need_reconfig_queues; /**< need reconfiguring queues or not */ uint8_t rss_flag; /**< enable rss or not */ @@ -198,14 +182,18 @@ struct rte_port { uint16_t nb_tx_desc[MAX_QUEUE_ID+1]; /**< per queue tx desc number */ struct rte_eth_rxconf rx_conf[MAX_QUEUE_ID+1]; /**< per queue rx configuration */ struct rte_eth_txconf tx_conf[MAX_QUEUE_ID+1]; /**< per queue tx configuration */ - struct ether_addr *mc_addr_pool; /**< pool of multicast addrs */ + struct rte_ether_addr *mc_addr_pool; /**< pool of multicast addrs */ 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 */ + const struct rte_eth_rxtx_callback *rx_dump_cb[MAX_QUEUE_ID+1]; + const struct rte_eth_rxtx_callback *tx_dump_cb[MAX_QUEUE_ID+1]; +#ifdef SOFTNIC + struct softnic_port softport; /**< softnic params */ #endif + /**< metadata value to insert in Tx packets. */ + rte_be32_t tx_metadata; + const struct rte_eth_rxtx_callback *tx_set_md_cb[MAX_QUEUE_ID+1]; }; /** @@ -266,9 +254,9 @@ 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; +extern struct fwd_engine noisy_vnf_engine; +#ifdef SOFTNIC +extern struct fwd_engine softnic_fwd_engine; #endif #ifdef RTE_LIBRTE_IEEE1588 extern struct fwd_engine ieee1588_fwd_engine; @@ -276,6 +264,8 @@ extern struct fwd_engine ieee1588_fwd_engine; extern struct fwd_engine * fwd_engines[]; /**< NULL terminated array. */ +extern uint16_t mempool_flags; + /** * Forwarding Configuration * @@ -328,13 +318,15 @@ extern uint8_t numa_support; /**< set by "--numa" parameter */ extern uint16_t port_topology; /**< set by "--port-topology" parameter */ extern uint8_t no_flush_rx; /**