diff options
author | Yaroslav Brustinov <ybrustin@cisco.com> | 2016-10-22 10:38:27 +0200 |
---|---|---|
committer | Yaroslav Brustinov <ybrustin@cisco.com> | 2016-10-28 14:38:32 +0200 |
commit | 2dab6b6d09f9f1474d2ade6b465ebfa5ce3b3f5e (patch) | |
tree | bab2898d6b631d5495c62a8ad4b86ccea4eae786 /src/stateless/cp/trex_stateless_port.cpp | |
parent | 00bfc58e6f76f7a67a6b62f297f72792534fef52 (diff) |
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 <ybrustin@cisco.com>
Diffstat (limited to 'src/stateless/cp/trex_stateless_port.cpp')
-rw-r--r-- | src/stateless/cp/trex_stateless_port.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
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 |