diff options
author | 2016-11-30 17:54:54 +0200 | |
---|---|---|
committer | 2016-11-30 17:54:54 +0200 | |
commit | 1783336927c38d4fc87f510a1816ece2cc318321 (patch) | |
tree | 59bf5cf5f20b53bbd32ecb46387051d84a71f85b | |
parent | b812770167d37125b3f3e1b0673517d8f83393ac (diff) |
minor bugs
Signed-off-by: imarom <imarom@cisco.com>
6 files changed, 20 insertions, 16 deletions
diff --git a/scripts/automation/trex_control_plane/stl/console/trex_console.py b/scripts/automation/trex_control_plane/stl/console/trex_console.py index f1635b97..e4321b87 100755 --- a/scripts/automation/trex_control_plane/stl/console/trex_console.py +++ b/scripts/automation/trex_control_plane/stl/console/trex_console.py @@ -320,6 +320,7 @@ class TRexConsole(TRexGeneralCmd): def help_push (self): self.do_push("-h") + @verify_connected def do_portattr (self, line): '''Change/show port(s) attributes\n''' self.stateless_client.set_port_attr_line(line) diff --git a/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_client.py b/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_client.py index 0425c207..feb6ef45 100755 --- a/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_client.py +++ b/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_client.py @@ -1403,6 +1403,7 @@ class STLClient(object): # get stats + @__api_check(True) def get_stats (self, ports = None, sync_now = True): """ Return dictionary containing statistics information gathered from the server. diff --git a/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_rx_features.py b/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_rx_features.py index 5c2fd9af..3754e608 100644 --- a/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_rx_features.py +++ b/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_rx_features.py @@ -139,7 +139,7 @@ class ARPResolver(Resolver): self.src = self.port.get_src_addr() if self.dst['ipv4'] is None: - return self.port.err("Port has a non-IPv4 destination: '{0}'".format(dst['mac'])) + return self.port.err("Port has a non-IPv4 destination: '{0}'".format(self.dst['mac'])) if self.src['ipv4'] is None: return self.port.err('Port must have an IPv4 source address configured') diff --git a/src/common/pcap.cpp b/src/common/pcap.cpp index f5eb3c41..b976aed7 100755 --- a/src/common/pcap.cpp +++ b/src/common/pcap.cpp @@ -223,6 +223,7 @@ bool LibPCapWriter::Create(char * name) printf(" ERROR create file \n"); return(false); } + /* prepare the write counter */ m_pkt_count = 0; return init(); diff --git a/src/rpc-server/commands/trex_rpc_cmd_general.cpp b/src/rpc-server/commands/trex_rpc_cmd_general.cpp index 849c9be3..cb7d5149 100644 --- a/src/rpc-server/commands/trex_rpc_cmd_general.cpp +++ b/src/rpc-server/commands/trex_rpc_cmd_general.cpp @@ -648,7 +648,11 @@ TrexRpcCmdGetPortStatus::_run(const Json::Value ¶ms, Json::Value &result) { get_stateless_obj()->get_platform_api()->getPortAttrObj(port_id)->to_json(result["result"]["attr"]); /* RX info */ - result["result"]["rx_info"] = port->rx_features_to_json(); + try { + result["result"]["rx_info"] = port->rx_features_to_json(); + } catch (const TrexException &ex) { + generate_execute_err(result, ex.what()); + } return (TREX_RPC_CMD_OK); } diff --git a/src/stateless/rx/trex_stateless_rx_core.cpp b/src/stateless/rx/trex_stateless_rx_core.cpp index b24fcb8f..f518fcd3 100644 --- a/src/stateless/rx/trex_stateless_rx_core.cpp +++ b/src/stateless/rx/trex_stateless_rx_core.cpp @@ -182,31 +182,28 @@ void CRxCoreStateless::port_manager_tick() { } void CRxCoreStateless::handle_work_stage(bool do_try_rx_queue) { - int i = 0; - int j = 0; + + /* set the next sync time to */ + dsec_t sync_time_sec = now_sec() + (1.0 / 1000); while (m_state == STATE_WORKING) { - + if (do_try_rx_queue) { try_rx_queues(); } process_all_pending_pkts(); - /* TODO: with scheduler, this should be solved better */ - i++; - if (i == 100000) { // approx 10msec - i = 0; - periodic_check_for_cp_messages(); // m_state might change in here - - j++; - if (j == 100) { // approx 1 sec - j = 0; - port_manager_tick(); - } + dsec_t now = now_sec(); + + if ( (now - sync_time_sec) > 0 ) { + periodic_check_for_cp_messages(); + port_manager_tick(); + sync_time_sec = now + (1.0 / 1000); } rte_pause(); + } } |