diff options
author | imarom <imarom@cisco.com> | 2015-10-29 14:24:29 +0200 |
---|---|---|
committer | imarom <imarom@cisco.com> | 2015-10-29 14:24:29 +0200 |
commit | 3978adceba8ce3861097747868da22bce379edd2 (patch) | |
tree | c157fa1df02d67073852108f0cd123a9b35dafb9 /src/stateless/cp | |
parent | 6aad159d20ce35c76a54f7dc45e97ebc4477ba52 (diff) |
some bug fixes:
1. added a active bit to all the active nodes - when a stop arrives
it invalidates them for next time
2. some small flag issues in the stateless port
Diffstat (limited to 'src/stateless/cp')
-rw-r--r-- | src/stateless/cp/trex_stateless_port.cpp | 16 | ||||
-rw-r--r-- | src/stateless/cp/trex_stateless_port.h | 2 |
2 files changed, 11 insertions, 7 deletions
diff --git a/src/stateless/cp/trex_stateless_port.cpp b/src/stateless/cp/trex_stateless_port.cpp index 3e6e256f..375d1f63 100644 --- a/src/stateless/cp/trex_stateless_port.cpp +++ b/src/stateless/cp/trex_stateless_port.cpp @@ -76,9 +76,6 @@ TrexStatelessPort::start_traffic(void) { return (RC_ERR_FAILED_TO_COMPILE_STREAMS); } - /* move the state to transmiting */ - m_port_state = PORT_STATE_TRANSMITTING; - /* generate a message to all the relevant DP cores to start transmitting */ TrexStatelessCpToDpMsgBase *start_msg = new TrexStatelessDpStart(compiled_obj); @@ -87,15 +84,18 @@ TrexStatelessPort::start_traffic(void) { ring->Enqueue((CGenNode *)start_msg); + /* move the state to transmiting */ + m_port_state = PORT_STATE_TRANSMITTING; + return (RC_OK); } -void +TrexStatelessPort::rc_e TrexStatelessPort::stop_traffic(void) { /* real code goes here */ - if (m_port_state == PORT_STATE_TRANSMITTING) { - m_port_state = PORT_STATE_UP_IDLE; + if (m_port_state != PORT_STATE_TRANSMITTING) { + return (RC_ERR_BAD_STATE_FOR_OP); } /* generate a message to all the relevant DP cores to start transmitting */ @@ -105,6 +105,10 @@ TrexStatelessPort::stop_traffic(void) { CNodeRing *ring = CMsgIns::Ins()->getCpDp()->getRingCpToDp(0); ring->Enqueue((CGenNode *)stop_msg); + + m_port_state = PORT_STATE_UP_IDLE; + + return (RC_OK); } /** diff --git a/src/stateless/cp/trex_stateless_port.h b/src/stateless/cp/trex_stateless_port.h index 474fccf7..4851a4b5 100644 --- a/src/stateless/cp/trex_stateless_port.h +++ b/src/stateless/cp/trex_stateless_port.h @@ -62,7 +62,7 @@ public: * stop traffic * */ - void stop_traffic(void); + rc_e stop_traffic(void); /** * access the stream table |