From 2dab6b6d09f9f1474d2ade6b465ebfa5ce3b3f5e Mon Sep 17 00:00:00 2001 From: Yaroslav Brustinov Date: Sat, 22 Oct 2016 10:38:27 +0200 Subject: dpdk_setup_ports.py: fix add of help in case of "t-rex-64 --help" dpdk_setup_ports.py: fix warning of TRex is already running if different NICs are being used singleton_daemon.py: fix error socket in use immediately after check if in use trex-console: fix crash in case of "tui --help" trex-console: try-catch commands instead of crashing add async notification on port status/atttibutes change add port xstats support add description of interfaces main_dpdk.cpp: fix --client_cfg not working with Python API Signed-off-by: Yaroslav Brustinov --- src/stateless/cp/trex_stateless_port.cpp | 11 ++++++++--- src/stateless/cp/trex_streams_compiler.h | 6 +++--- 2 files changed, 11 insertions(+), 6 deletions(-) (limited to 'src/stateless/cp') diff --git a/src/stateless/cp/trex_stateless_port.cpp b/src/stateless/cp/trex_stateless_port.cpp index 8c6a1573..1a92b309 100644 --- a/src/stateless/cp/trex_stateless_port.cpp +++ b/src/stateless/cp/trex_stateless_port.cpp @@ -255,6 +255,11 @@ TrexStatelessPort::start_traffic(const TrexPortMultiplier &mul, double duration, /* caclulate the effective factor for DP */ double factor = calculate_effective_factor(mul, force); + /* zero factor */ + if (factor == 0) { + throw TrexException("Zero multiplier, nothing to send."); + } + StreamsFeeder feeder(this); /* compiler it */ @@ -278,7 +283,7 @@ TrexStatelessPort::start_traffic(const TrexPortMultiplier &mul, double duration, feeder.set_status(true); - /* generate a message to all the relevant DP cores to start transmitting */ + /* generate a message to all the relevant DP cores to stop transmitting */ assert(m_pending_async_stop_event == TrexDpPortEvents::INVALID_ID); m_pending_async_stop_event = m_dp_events.create_event(new AsyncStopEvent()); @@ -581,7 +586,7 @@ void TrexStatelessPort::get_properties(std::string &driver, uint32_t &speed) { driver = m_api_info.driver_name; - speed = platform_api->get_link_speed(m_port_id); + speed = platform_api->getPortAttrObj()->get_link_speed(m_port_id); } bool @@ -662,7 +667,7 @@ TrexStatelessPort::send_message_to_rx(TrexStatelessCpToRxMsgBase *msg) { uint64_t TrexStatelessPort::get_port_speed_bps() const { - return (uint64_t) platform_api->get_link_speed(m_port_id) * 1000 * 1000; + return (uint64_t) platform_api->getPortAttrObj()->get_link_speed(m_port_id) * 1000 * 1000; } static inline double diff --git a/src/stateless/cp/trex_streams_compiler.h b/src/stateless/cp/trex_streams_compiler.h index c944df4a..43fee09b 100644 --- a/src/stateless/cp/trex_streams_compiler.h +++ b/src/stateless/cp/trex_streams_compiler.h @@ -309,7 +309,7 @@ public: } double get_factor_pps(double req_pps) const { - if ( (req_pps - m_fixed.m_pps) <= 0 ) { + if ( (req_pps - m_fixed.m_pps) < 0 ) { std::stringstream ss; ss << "current stream configuration enforces a minimum rate of '" << m_fixed.m_pps << "' pps"; throw TrexException(ss.str()); @@ -319,7 +319,7 @@ public: } double get_factor_bps_l1(double req_bps_l1) const { - if ( (req_bps_l1 - m_fixed.m_bps_l1) <= 0 ) { + if ( (req_bps_l1 - m_fixed.m_bps_l1) < 0 ) { std::stringstream ss; ss << "current stream configuration enforces a minimum rate of '" << m_fixed.m_bps_l1 << "' BPS L1"; throw TrexException(ss.str()); @@ -329,7 +329,7 @@ public: } double get_factor_bps_l2(double req_bps_l2) const { - if ( (req_bps_l2 - m_fixed.m_bps_l2) <= 0 ) { + if ( (req_bps_l2 - m_fixed.m_bps_l2) < 0 ) { std::stringstream ss; ss << "current stream configuration enforces a minimum rate of '" << m_fixed.m_bps_l2 << "' BPS L2"; throw TrexException(ss.str()); -- cgit 1.2.3-korg