summaryrefslogtreecommitdiffstats
path: root/src/stateless/dp
diff options
context:
space:
mode:
authorimarom <imarom@cisco.com>2015-11-19 12:35:16 +0200
committerimarom <imarom@cisco.com>2015-11-19 12:35:16 +0200
commita7317d45787669af71ca8c65fd1e51f8a47d2c1e (patch)
tree2ba3d71c3b9e9815f5b9d6bcc63fe496e19ce8b3 /src/stateless/dp
parentd9ed62e91c83039521b817779b4bc0197cc8151a (diff)
async events (DP to CP)
Diffstat (limited to 'src/stateless/dp')
-rw-r--r--src/stateless/dp/trex_stateless_dp_core.cpp13
-rw-r--r--src/stateless/dp/trex_stateless_dp_core.h9
2 files changed, 18 insertions, 4 deletions
diff --git a/src/stateless/dp/trex_stateless_dp_core.cpp b/src/stateless/dp/trex_stateless_dp_core.cpp
index 0747c1a0..4a74d9e5 100644
--- a/src/stateless/dp/trex_stateless_dp_core.cpp
+++ b/src/stateless/dp/trex_stateless_dp_core.cpp
@@ -227,6 +227,7 @@ TrexStatelessDpCore::start_traffic(TrexStreamsCompiledObj *obj, double duration)
if ( duration > 0.0 ){
add_duration( duration );
}
+
}
void
@@ -261,11 +262,15 @@ TrexStatelessDpCore::stop_traffic(uint8_t port_id) {
m_core->m_node_gen.add_node(node);
}
- /* send a message to the control plane to
- generate an async event that traffic has stopped
+ /* inform the control plane we stopped - this might be a async stop
+ (streams ended)
*/
- //CNodeRing *ring = CMsgIns::Ins()->getCpDp()->getRingDpToCp(m_core->m_thread_id);
- //ring->Enqueue((CGenNode *)msg->clone());
+ CNodeRing *ring = CMsgIns::Ins()->getCpDp()->getRingDpToCp(m_core->m_thread_id);
+ TrexStatelessDpToCpMsgBase *event_msg = new TrexDpPortEventMsg(m_core->m_thread_id,
+ port_id,
+ TrexDpPortEvent::EVENT_STOP,
+ 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 aaa6eed3..d07e1d3a 100644
--- a/src/stateless/dp/trex_stateless_dp_core.h
+++ b/src/stateless/dp/trex_stateless_dp_core.h
@@ -112,6 +112,14 @@ 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;
+ }
+
private:
/**
* in idle state loop, the processor most of the time sleeps
@@ -152,6 +160,7 @@ private:
CFlowGenListPerThread *m_core;
double m_duration;
+ int m_event_id;
};
#endif /* __TREX_STATELESS_DP_CORE_H__ */