summaryrefslogtreecommitdiffstats
path: root/src/stateless
diff options
context:
space:
mode:
Diffstat (limited to 'src/stateless')
-rw-r--r--src/stateless/rx/trex_stateless_rx_core.cpp6
-rw-r--r--src/stateless/rx/trex_stateless_rx_core.h52
2 files changed, 1 insertions, 57 deletions
diff --git a/src/stateless/rx/trex_stateless_rx_core.cpp b/src/stateless/rx/trex_stateless_rx_core.cpp
index 8f2f5d64..b3555c13 100644
--- a/src/stateless/rx/trex_stateless_rx_core.cpp
+++ b/src/stateless/rx/trex_stateless_rx_core.cpp
@@ -52,12 +52,8 @@ void CRFC2544Info::export_data(rfc2544_info_t_ &obj) {
obj.set_err_cntrs(m_seq_err, m_ooo, m_dup, m_seq_err_events_too_big, m_seq_err_events_too_low);
obj.set_jitter(m_jitter.get_jitter());
- json_str = "";
- m_latency.dump_json("", json_str);
- // This is a hack. We need to make the dump_json return json object.
- reader.parse( json_str.c_str(), json);
+ m_latency.dump_json(json);
obj.set_latency_json(json);
- obj.set_last_max(m_last_max.getMax());
};
void CCPortLatencyStl::reset() {
diff --git a/src/stateless/rx/trex_stateless_rx_core.h b/src/stateless/rx/trex_stateless_rx_core.h
index 1528a7e1..ce1bc1ad 100644
--- a/src/stateless/rx/trex_stateless_rx_core.h
+++ b/src/stateless/rx/trex_stateless_rx_core.h
@@ -28,55 +28,6 @@
class TrexStatelessCpToRxMsgBase;
-class CLastMax {
- public:
- CLastMax() {
- m_max1 = 0;
- m_max1 = 1;
- m_choose = true;
- }
-
- void update(dsec_t val) {
- if (m_choose) {
- if (val > m_max1) {
- m_max1 = val;
- sanb_smp_memory_barrier();
- }
- } else {
- if (val > m_max2) {
- m_max2 = val;
- sanb_smp_memory_barrier();
- }
- }
- }
-
- dsec_t getMax() {
- if (m_choose)
- return m_max2;
- else
- return m_max1;
- }
-
- void switchMax() {
- if (m_choose) {
- m_max2 = 0;
- m_choose = false;
- sanb_smp_memory_barrier();
- }
- else {
- m_max1 = 0;
- m_choose = true;
- sanb_smp_memory_barrier();
- }
- }
-
- private:
- dsec_t m_max1;
- dsec_t m_max2;
- bool m_choose;
-};
-
-
class CCPortLatencyStl {
public:
void reset();
@@ -112,12 +63,10 @@ class CRFC2544Info {
void export_data(rfc2544_info_t_ &obj);
inline void add_sample(double stime) {
m_latency.Add(stime);
- m_last_max.update(stime);
m_jitter.calc(stime);
}
inline void sample_period_end() {
m_latency.update();
- m_last_max.switchMax();
}
inline uint32_t get_seq() {return m_seq;}
inline void set_seq(uint32_t val) {m_seq = val;}
@@ -136,7 +85,6 @@ class CRFC2544Info {
uint64_t m_seq_err_events_too_low; // How many packet seq num lower than expected events we had
uint64_t m_ooo; // Packets we got with seq num lower than expected (We guess they are out of order)
uint64_t m_dup; // Packets we got with same seq num
- CLastMax m_last_max; // maximum for last measurement period (reset whenever we read it).
};
class CRxCoreStateless {