summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/main_dpdk.cpp20
-rw-r--r--src/main_dpdk.h1
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);
}