summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/stateless/cp/trex_stateless_port.cpp8
-rw-r--r--src/stateless/cp/trex_streams_compiler.h12
2 files changed, 10 insertions, 10 deletions
diff --git a/src/stateless/cp/trex_stateless_port.cpp b/src/stateless/cp/trex_stateless_port.cpp
index ec3907b1..4dc3e449 100644
--- a/src/stateless/cp/trex_stateless_port.cpp
+++ b/src/stateless/cp/trex_stateless_port.cpp
@@ -600,7 +600,7 @@ TrexStatelessPort::calculate_effective_factor(const TrexPortMultiplier &mul, boo
double factor = calculate_effective_factor_internal(mul);
/* did we exceeded the max L1 line rate ? */
- double expected_l1_rate = factor * m_graph_obj->get_max_bps_l1();
+ double expected_l1_rate = m_graph_obj->get_max_bps_l1(factor);
/* if not force and exceeded - throw exception */
if ( (!force) && (expected_l1_rate > get_port_speed_bps()) ) {
@@ -774,9 +774,9 @@ TrexStatelessPort::get_port_effective_rate(double &pps,
generate_streams_graph();
}
- pps = m_graph_obj->get_max_pps() * m_factor;
- bps_L1 = m_graph_obj->get_max_bps_l1() * m_factor;
- bps_L2 = m_graph_obj->get_max_bps_l2() * m_factor;
+ pps = m_graph_obj->get_max_pps(m_factor);
+ bps_L1 = m_graph_obj->get_max_bps_l1(m_factor);
+ bps_L2 = m_graph_obj->get_max_bps_l2(m_factor);
percentage = (bps_L1 / get_port_speed_bps()) * 100.0;
}
diff --git a/src/stateless/cp/trex_streams_compiler.h b/src/stateless/cp/trex_streams_compiler.h
index 69b44c3d..0ce71b49 100644
--- a/src/stateless/cp/trex_streams_compiler.h
+++ b/src/stateless/cp/trex_streams_compiler.h
@@ -231,16 +231,16 @@ public:
uint32_t stream_id;
};
- double get_max_pps() const {
- return m_total.m_pps;
+ double get_max_pps(double factor = 1) const {
+ return (m_var.m_pps * factor + m_fixed.m_pps);
}
- double get_max_bps_l1() const {
- return m_total.m_bps_l1;
+ double get_max_bps_l1(double factor = 1) const {
+ return (m_var.m_bps_l1 * factor + m_fixed.m_bps_l1);
}
- double get_max_bps_l2() const {
- return m_total.m_bps_l2;
+ double get_max_bps_l2(double factor = 1) const {
+ return (m_var.m_bps_l2 * factor + m_fixed.m_bps_l2);
}
double get_factor_pps(double req_pps) const {