diff options
author | Yaroslav Brustinov <ybrustin@cisco.com> | 2016-03-06 01:48:57 +0200 |
---|---|---|
committer | Yaroslav Brustinov <ybrustin@cisco.com> | 2016-03-06 01:48:57 +0200 |
commit | b5cf4165ac6ca8e3a56a2f4f6bb4b28cfab33c98 (patch) | |
tree | 8518bfd107617b94a65f7f8af7dc3a8138e734f5 | |
parent | 0f1b82cfc8078e0b363b96e7e649dbe49eb24e2a (diff) |
improve init speed of 1gb ports (12 ports init time reduced from 55 secs to 15)
-rw-r--r-- | src/main_dpdk.cpp | 20 | ||||
-rw-r--r-- | src/main_dpdk.h | 1 |
2 files changed, 17 insertions, 4 deletions
diff --git a/src/main_dpdk.cpp b/src/main_dpdk.cpp index 57b3719b..92bfda09 100644 --- a/src/main_dpdk.cpp +++ b/src/main_dpdk.cpp @@ -1472,6 +1472,10 @@ void CPhyEthIF::update_link_status(){ rte_eth_link_get(m_port_id, &m_link); } +void CPhyEthIF::update_link_status_nowait(){ + rte_eth_link_get_nowait(m_port_id, &m_link); +} + void CPhyEthIF::add_mac(char * mac){ struct ether_addr mac_addr; int i=0; @@ -2645,6 +2649,7 @@ public: void get_stats(CGlobalStats & stats); void dump_post_test_stats(FILE *fd); void dump_config(FILE *fd); + void dump_links_status(FILE *fd); public: port_cfg_t m_port_cfg; @@ -2942,10 +2947,6 @@ int CGlobalTRex::ixgbe_start(void){ _if->disable_flow_control(); } - _if->update_link_status(); - - _if->dump_link(stdout); - _if->add_mac((char *)CGlobalInfo::m_options.get_src_mac_addr(i)); fflush(stdout); @@ -2956,6 +2957,7 @@ int CGlobalTRex::ixgbe_start(void){ get_ex_drv()->wait_for_stable_link(); if ( !is_all_links_are_up(true) ){ + dump_links_status(stdout); rte_exit(EXIT_FAILURE, " " " one of the link is down \n"); } @@ -2963,6 +2965,8 @@ int CGlobalTRex::ixgbe_start(void){ get_ex_drv()->wait_after_link_up(); } + dump_links_status(stdout); + ixgbe_rx_queue_flush(); @@ -3209,6 +3213,14 @@ void CGlobalTRex::dump_config(FILE *fd){ } +void CGlobalTRex::dump_links_status(FILE *fd){ + for (int i=0; i<m_max_ports; i++) { + CPhyEthIF * _if=&m_ports[i]; + _if->update_link_status_nowait(); + _if->dump_link(fd); + } +} + void CGlobalTRex::dump_post_test_stats(FILE *fd){ uint64_t pkt_out=0; diff --git a/src/main_dpdk.h b/src/main_dpdk.h index 33615636..a475d321 100644 --- a/src/main_dpdk.h +++ b/src/main_dpdk.h @@ -89,6 +89,7 @@ class CPhyEthIF { void start(); void stop(); void update_link_status(); + void update_link_status_nowait(); bool is_link_up(){ return (m_link.link_status?true:false); } |