From b094110ef86889a0694dc71503c5610abaf47ebe Mon Sep 17 00:00:00 2001 From: imarom Date: Thu, 19 Nov 2015 22:13:55 +0200 Subject: BUG: didn't do all the states per port on the DP - now fixed --- src/stateless/dp/trex_stateless_dp_core.cpp | 2 +- src/stateless/dp/trex_stateless_dp_core.h | 27 ++++++++++++++++++--------- 2 files changed, 19 insertions(+), 10 deletions(-) (limited to 'src/stateless/dp') diff --git a/src/stateless/dp/trex_stateless_dp_core.cpp b/src/stateless/dp/trex_stateless_dp_core.cpp index cde34a4b..6db66661 100644 --- a/src/stateless/dp/trex_stateless_dp_core.cpp +++ b/src/stateless/dp/trex_stateless_dp_core.cpp @@ -525,7 +525,7 @@ TrexStatelessDpCore::stop_traffic(uint8_t port_id) { TrexStatelessDpToCpMsgBase *event_msg = new TrexDpPortEventMsg(m_core->m_thread_id, port_id, TrexDpPortEvent::EVENT_STOP, - get_event_id()); + lp_port->get_event_id()); ring->Enqueue((CGenNode *)event_msg); } diff --git a/src/stateless/dp/trex_stateless_dp_core.h b/src/stateless/dp/trex_stateless_dp_core.h index 7ee5abc4..c0bbe702 100644 --- a/src/stateless/dp/trex_stateless_dp_core.h +++ b/src/stateless/dp/trex_stateless_dp_core.h @@ -66,6 +66,18 @@ public: bool update_number_of_active_streams(uint32_t d); + state_e get_state() { + return m_state; + } + + void set_event_id(int event_id) { + m_event_id = event_id; + } + + int get_event_id() { + return m_event_id; + } + public: state_e m_state; @@ -75,6 +87,7 @@ public: std::vector m_active_nodes; /* holds the current active nodes */ CFlowGenListPerThread * m_core ; + int m_event_id; }; /* for now */ @@ -166,19 +179,13 @@ public: /* quit the main loop, work in both stateless in stateful, don't free memory trigger from master */ void quit_main_loop(); - void set_event_id(int event_id) { - m_event_id = event_id; - } - - int get_event_id() { - return m_event_id; + state_e get_state() { + return m_state; } bool set_stateless_next_node(CGenNodeStateless * cur_node, CGenNodeStateless * next_node); -private: - TrexStatelessDpPerPort * get_port_db(uint8_t port_id){ assert((m_local_port_offset==port_id) ||(m_local_port_offset+1==port_id)); @@ -188,6 +195,9 @@ private: } + +private: + void schedule_exit(); @@ -236,7 +246,6 @@ private: CFlowGenListPerThread * m_core; double m_duration; - int m_event_id; }; #endif /* __TREX_STATELESS_DP_CORE_H__ */ -- cgit 1.2.3-korg