summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_sim.py2
-rw-r--r--scripts/exp/imix_3pkt.pcapbin8162 -> 5118 bytes
-rw-r--r--scripts/exp/imix_3pkt_vm.pcapbin4588 -> 4058 bytes
-rw-r--r--scripts/exp/udp_1pkt_range_clients_split.pcapbin7624 -> 7624 bytes
-rw-r--r--scripts/exp/udp_1pkt_tuple_gen_split.pcapbin7624 -> 7624 bytes
-rw-r--r--src/stateless/cp/trex_stream.h4
-rw-r--r--src/stateless/cp/trex_streams_compiler.cpp32
-rw-r--r--src/stateless/dp/trex_stream_node.h7
8 files changed, 15 insertions, 30 deletions
diff --git a/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_sim.py b/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_sim.py
index 2f6b1571..11e80b9a 100644
--- a/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_sim.py
+++ b/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_sim.py
@@ -447,7 +447,7 @@ def compare_caps (cap1, cap2, max_diff_sec = (5 * 1e-6)):
pkts2 = list(RawPcapReader(cap2))
if len(pkts1) != len(pkts2):
- print('{0} contains {1} packets vs. {1} contains {2} packets'.format(cap1, len(pkts1), cap2, len(pkts2)))
+ print('{0} contains {1} packets vs. {2} contains {3} packets'.format(cap1, len(pkts1), cap2, len(pkts2)))
return False
# to be less strict we define equality if all packets from cap1 exists and in cap2
diff --git a/scripts/exp/imix_3pkt.pcap b/scripts/exp/imix_3pkt.pcap
index d36fbe97..13a6e87f 100644
--- a/scripts/exp/imix_3pkt.pcap
+++ b/scripts/exp/imix_3pkt.pcap
Binary files differ
diff --git a/scripts/exp/imix_3pkt_vm.pcap b/scripts/exp/imix_3pkt_vm.pcap
index de78d575..3ec1bfbb 100644
--- a/scripts/exp/imix_3pkt_vm.pcap
+++ b/scripts/exp/imix_3pkt_vm.pcap
Binary files differ
diff --git a/scripts/exp/udp_1pkt_range_clients_split.pcap b/scripts/exp/udp_1pkt_range_clients_split.pcap
index 203de6eb..fb5037cc 100644
--- a/scripts/exp/udp_1pkt_range_clients_split.pcap
+++ b/scripts/exp/udp_1pkt_range_clients_split.pcap
Binary files differ
diff --git a/scripts/exp/udp_1pkt_tuple_gen_split.pcap b/scripts/exp/udp_1pkt_tuple_gen_split.pcap
index 2b7c7976..873ab47f 100644
--- a/scripts/exp/udp_1pkt_tuple_gen_split.pcap
+++ b/scripts/exp/udp_1pkt_tuple_gen_split.pcap
Binary files differ
diff --git a/src/stateless/cp/trex_stream.h b/src/stateless/cp/trex_stream.h
index 1914026b..eba5fed0 100644
--- a/src/stateless/cp/trex_stream.h
+++ b/src/stateless/cp/trex_stream.h
@@ -360,10 +360,6 @@ public:
m_null_stream = enable;
}
- bool get_null_stream() {
- return m_null_stream;
- }
-
uint8_t get_type(void) const {
return ( m_type );
}
diff --git a/src/stateless/cp/trex_streams_compiler.cpp b/src/stateless/cp/trex_streams_compiler.cpp
index c4ae0bed..520868c4 100644
--- a/src/stateless/cp/trex_streams_compiler.cpp
+++ b/src/stateless/cp/trex_streams_compiler.cpp
@@ -481,7 +481,7 @@ TrexStreamsCompiler::compile_on_single_core(uint8_t
continue;
}
- /* compile a single stream to all cores */
+ /* compile the stream for only one core */
compile_stream(stream, factor, 1, objs, nodes);
}
}
@@ -585,10 +585,10 @@ TrexStreamsCompiler::compile_stream_on_all_cores(TrexStream *stream,
std::vector<TrexStream *> core_streams(dp_core_count);
int per_core_burst_total_pkts = (stream->m_burst_total_pkts / dp_core_count);
- int burst_remainder = (stream->m_burst_total_pkts % dp_core_count);
- bool has_remainder = (burst_remainder > 0);
+ const int burst_remainder = (stream->m_burst_total_pkts % dp_core_count);
int remainder_left = burst_remainder;
+ /* this is the stream base IPG (pre split) */
double base_ipg_sec = factor * stream->get_ipg_sec();
@@ -599,7 +599,7 @@ TrexStreamsCompiler::compile_stream_on_all_cores(TrexStream *stream,
/* fix stream ID */
dp_stream->fix_dp_stream_id(new_id, new_next_id);
- /* some phase */
+ /* some phase is added to avoid all the cores TXing at once */
dp_stream->m_mc_phase_pre_sec = base_ipg_sec * i;
@@ -610,22 +610,17 @@ TrexStreamsCompiler::compile_stream_on_all_cores(TrexStream *stream,
dp_stream->update_rate_factor(factor / dp_core_count);
- /* allocate the rest of the packets */
- if (has_remainder) {
- if (remainder_left > 0) {
- dp_stream->m_burst_total_pkts++;
- remainder_left--;
- dp_stream->m_mc_phase_post_sec = base_ipg_sec * remainder_left;
- } else {
- /* a delay slot if no packets left */
- dp_stream->m_mc_phase_post_sec = base_ipg_sec * (dp_core_count - 1 - i + burst_remainder);
- }
-
+ if (remainder_left > 0) {
+ dp_stream->m_burst_total_pkts++;
+ remainder_left--;
+ /* this core needs to wait to the rest of the cores that will participate in the last round */
+ dp_stream->m_mc_phase_post_sec = base_ipg_sec * remainder_left;
} else {
- /* if no remainder (or continous) simply add a reverse phase */
- dp_stream->m_mc_phase_post_sec = base_ipg_sec * (dp_core_count - 1 - i);
+ /* this core did not participate in the last round so it will wait its current round's left + burst_remainder */
+ dp_stream->m_mc_phase_post_sec = base_ipg_sec * (dp_core_count - 1 - i + burst_remainder);
}
+
core_streams[i] = dp_stream;
}
@@ -663,9 +658,6 @@ TrexStreamsCompiler::compile_stream_on_single_core(TrexStream *stream,
dp_stream->m_vm_dp = stream->m_vm_dp->clone();
}
- //dp_stream->m_pkt.binary[14 + 20] = 0;
- //dp_stream->m_pkt.binary[14 + 21] = 0;
-
/* update core 0 with the real stream */
objs[0]->add_compiled_stream(dp_stream);
diff --git a/src/stateless/dp/trex_stream_node.h b/src/stateless/dp/trex_stream_node.h
index d756ba43..19a27350 100644
--- a/src/stateless/dp/trex_stream_node.h
+++ b/src/stateless/dp/trex_stream_node.h
@@ -175,10 +175,6 @@ public:
return ((m_pause | m_null_stream) == 0);
}
- bool is_null_stream() {
- return (m_null_stream == 1);
- }
-
inline uint8_t get_stream_type(){
return (m_stream_type);
}
@@ -235,7 +231,7 @@ public:
if ( m_multi_bursts == 0 ) {
set_state(CGenNodeStateless::ss_INACTIVE);
if ( thread->set_stateless_next_node(this,m_next_stream) ){
- /* update the next stream time using isg */
+ /* update the next stream time using isg and post phase */
m_next_stream->update_refresh_time(m_time + m_ref_stream_info->m_mc_phase_post_sec);
thread->m_node_gen.m_p_queue.push( (CGenNode *)m_next_stream);
@@ -245,6 +241,7 @@ public:
}
}else{
+ /* next burst is like starting a new stream - add pre and post phase */
m_time += get_multi_ibg_sec() + m_ref_stream_info->m_mc_phase_post_sec + m_ref_stream_info->m_mc_phase_pre_sec;
m_single_burst = m_single_burst_refill;
thread->m_node_gen.m_p_queue.push( (CGenNode *)this);