X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=app%2Ftest-pmd%2Ftestpmd.h;h=0b4b42b9e3d446e41d788ec4a6525cb7d69a4a35;hb=900550de04a74594035d9da26914e02dbc8c640c;hp=2fa43c3c56f68233b7fe9065e37115991c94d531;hpb=dada9ef6edc59015b6674b5a95258787c71401b0;p=dpdk.git diff --git a/app/test-pmd/testpmd.h b/app/test-pmd/testpmd.h index 2fa43c3c56..0b4b42b9e3 100644 --- a/app/test-pmd/testpmd.h +++ b/app/test-pmd/testpmd.h @@ -41,6 +41,16 @@ int main(int argc, char **argv); #endif +#define RTE_PORT_ALL (~(portid_t)0x0) + +#define RTE_TEST_RX_DESC_MAX 2048 +#define RTE_TEST_TX_DESC_MAX 2048 + +#define RTE_PORT_STOPPED (uint16_t)0 +#define RTE_PORT_STARTED (uint16_t)1 +#define RTE_PORT_CLOSED (uint16_t)2 +#define RTE_PORT_HANDLING (uint16_t)3 + /* * Default size of the mbuf data buffer to receive standard 1518-byte * Ethernet frames in a mono-segment memory buffer. @@ -131,6 +141,14 @@ struct rte_port { 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_reconfig; /**< need reconfiguring port or not */ + uint8_t need_reconfig_queues; /**< need reconfiguring queues or not */ + uint8_t rss_flag; /**< enable rss or not */ + struct rte_eth_rxconf rx_conf; /**< rx configuration */ + struct rte_eth_txconf tx_conf; /**< tx configuration */ }; /** @@ -197,6 +215,53 @@ struct fwd_config { portid_t nb_fwd_ports; /**< Nb. of ports involved. */ }; +/** + * DCB mode enable + */ +enum dcb_mode_enable +{ + DCB_VT_ENABLED, + DCB_ENABLED +}; + +/* + * DCB general config info + */ +struct dcb_config { + enum dcb_mode_enable dcb_mode; + uint8_t vt_en; + enum rte_eth_nb_tcs num_tcs; + uint8_t pfc_en; +}; + +/* + * In DCB io FWD mode, 128 RX queue to 128 TX queue mapping + */ +enum dcb_queue_mapping_mode { + DCB_VT_Q_MAPPING = 0, + DCB_4_TCS_Q_MAPPING, + DCB_8_TCS_Q_MAPPING +}; + +#define MAX_TX_QUEUE_STATS_MAPPINGS 1024 /* MAX_PORT of 32 @ 32 tx_queues/port */ +#define MAX_RX_QUEUE_STATS_MAPPINGS 4096 /* MAX_PORT of 32 @ 128 rx_queues/port */ + +struct queue_stats_mappings { + uint8_t port_id; + uint16_t queue_id; + uint8_t stats_counter_id; +} __rte_cache_aligned; + +extern struct queue_stats_mappings tx_queue_stats_mappings_array[]; +extern struct queue_stats_mappings rx_queue_stats_mappings_array[]; + +/* Assign both tx and rx queue stats mappings to the same default values */ +extern struct queue_stats_mappings *tx_queue_stats_mappings; +extern struct queue_stats_mappings *rx_queue_stats_mappings; + +extern uint16_t nb_tx_queue_stats_mappings; +extern uint16_t nb_rx_queue_stats_mappings; + /* globals used for configuration */ extern uint16_t verbose_level; /**< Drives messages being displayed, if any. */ extern uint8_t interactive; @@ -232,10 +297,17 @@ extern uint16_t nb_rxd; extern uint16_t nb_txd; extern uint16_t rx_free_thresh; +extern uint8_t rx_drop_en; extern uint16_t tx_free_thresh; extern uint16_t tx_rs_thresh; +extern uint32_t txq_flags; + +extern uint8_t dcb_config; +extern uint8_t dcb_test; +extern enum dcb_queue_mapping_mode dcb_q_mapping; extern uint16_t mbuf_data_size; /**< Mbuf data space size. */ +extern uint32_t param_total_num_mbufs; extern struct rte_fdir_conf fdir_conf; @@ -330,6 +402,7 @@ void launch_args_parse(int argc, char** argv); void prompt(void); void nic_stats_display(portid_t port_id); void nic_stats_clear(portid_t port_id); +void nic_stats_mapping_display(portid_t port_id); void port_infos_display(portid_t port_id); void fwd_lcores_config_display(void); void fwd_config_display(void); @@ -358,11 +431,20 @@ void set_fwd_ports_list(unsigned int *portlist, unsigned int nb_pt); void set_fwd_ports_mask(uint64_t portmask); void set_fwd_ports_number(uint16_t nb_pt); -void rx_vlan_filter_set(portid_t port_id, uint16_t vlan_id, int on); +void rx_vlan_strip_set(portid_t port_id, int on); +void rx_vlan_strip_set_on_queue(portid_t port_id, uint16_t queue_id, int on); + +void rx_vlan_filter_set(portid_t port_id, int on); void rx_vlan_all_filter_set(portid_t port_id, int on); +void rx_vft_set(portid_t port_id, uint16_t vlan_id, int on); +void vlan_extend_set(portid_t port_id, int on); +void vlan_tpid_set(portid_t port_id, uint16_t tp_id); void tx_vlan_set(portid_t port_id, uint16_t vlan_id); void tx_vlan_reset(portid_t port_id); + +void set_qmap(portid_t port_id, uint8_t is_rx, uint16_t queue_id, uint8_t map_value); + void tx_cksum_set(portid_t port_id, uint8_t cksum_mask); void set_verbose_level(uint16_t vb_level); @@ -371,6 +453,12 @@ void set_nb_pkt_per_burst(uint16_t pkt_burst); void set_pkt_forwarding_mode(const char *fwd_mode); void start_packet_forwarding(int with_tx_first); void stop_packet_forwarding(void); +void init_port_config(void); +int init_port_dcb_config(portid_t pid,struct dcb_config *dcb_conf); +void start_port(portid_t pid); +void stop_port(portid_t pid); +void close_port(portid_t pid); +int all_ports_stopped(void); void pmd_test_exit(void); void fdir_add_signature_filter(portid_t port_id, uint8_t queue_id,