summaryrefslogtreecommitdiffstats
path: root/src/stateless/cp
diff options
context:
space:
mode:
Diffstat (limited to 'src/stateless/cp')
-rw-r--r--src/stateless/cp/trex_stateless_port.cpp11
-rw-r--r--src/stateless/cp/trex_streams_compiler.h6
2 files changed, 11 insertions, 6 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
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());