summaryrefslogtreecommitdiffstats
path: root/src/stateless/dp/trex_stateless_dp_core.cpp
diff options
context:
space:
mode:
authorimarom <imarom@cisco.com>2016-03-02 11:05:51 +0200
committerimarom <imarom@cisco.com>2016-03-02 13:35:09 +0200
commit59a3b58d240661a2bc06c6ede473d2eda4eb5e55 (patch)
tree37dd8d43c4bc6a0421d5964d7d1c57be3cca51a2 /src/stateless/dp/trex_stateless_dp_core.cpp
parent70cfb9f88b00016f1413754e5625b5b05acc2063 (diff)
TX barrier
Diffstat (limited to 'src/stateless/dp/trex_stateless_dp_core.cpp')
-rw-r--r--src/stateless/dp/trex_stateless_dp_core.cpp36
1 files changed, 22 insertions, 14 deletions
diff --git a/src/stateless/dp/trex_stateless_dp_core.cpp b/src/stateless/dp/trex_stateless_dp_core.cpp
index 0f578b99..19eface1 100644
--- a/src/stateless/dp/trex_stateless_dp_core.cpp
+++ b/src/stateless/dp/trex_stateless_dp_core.cpp
@@ -265,9 +265,9 @@ bool TrexStatelessDpPerPort::pause_traffic(uint8_t port_id){
}
-bool TrexStatelessDpPerPort::stop_traffic(uint8_t port_id,
- bool stop_on_id,
- int event_id){
+bool TrexStatelessDpPerPort::stop_traffic(uint8_t port_id,
+ bool stop_on_id,
+ int event_id){
if (m_state == TrexStatelessDpPerPort::ppSTATE_IDLE) {
@@ -829,9 +829,9 @@ TrexStatelessDpCore::update_traffic(uint8_t port_id, double factor) {
void
-TrexStatelessDpCore::stop_traffic(uint8_t port_id,
- bool stop_on_id,
- int event_id) {
+TrexStatelessDpCore::stop_traffic(uint8_t port_id,
+ bool stop_on_id,
+ int event_id) {
/* we cannot remove nodes not from the top of the queue so
for every active node - make sure next time
the scheduler invokes it, it will be free */
@@ -843,20 +843,19 @@ TrexStatelessDpCore::stop_traffic(uint8_t port_id,
//printf(" skip .. %f\n",m_core->m_cur_time_sec);
return;
}
-
-#if 0
- if ( are_all_ports_idle() ) {
- /* just a place holder if we will need to do somthing in that case */
- }
-#endif
/* inform the control plane we stopped - this might be a async stop
(streams ended)
- */
+ */
+ #if 0
+ if ( are_all_ports_idle() ) {
+ /* just a place holder if we will need to do somthing in that case */
+ }
+ #endif
+
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,
lp_port->get_event_id());
ring->Enqueue((CGenNode *)event_msg);
@@ -872,3 +871,12 @@ TrexStatelessDpCore::handle_cp_msg(TrexStatelessCpToDpMsgBase *msg) {
delete msg;
}
+void
+TrexStatelessDpCore::barrier(uint8_t port_id, int event_id) {
+
+ CNodeRing *ring = CMsgIns::Ins()->getCpDp()->getRingDpToCp(m_core->m_thread_id);
+ TrexStatelessDpToCpMsgBase *event_msg = new TrexDpPortEventMsg(m_core->m_thread_id,
+ port_id,
+ event_id);
+ ring->Enqueue((CGenNode *)event_msg);
+}