summaryrefslogtreecommitdiffstats
path: root/src/stateless/messaging
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/messaging
parent70cfb9f88b00016f1413754e5625b5b05acc2063 (diff)
TX barrier
Diffstat (limited to 'src/stateless/messaging')
-rw-r--r--src/stateless/messaging/trex_stateless_messaging.cpp20
-rw-r--r--src/stateless/messaging/trex_stateless_messaging.h30
2 files changed, 41 insertions, 9 deletions
diff --git a/src/stateless/messaging/trex_stateless_messaging.cpp b/src/stateless/messaging/trex_stateless_messaging.cpp
index 257de168..333aec88 100644
--- a/src/stateless/messaging/trex_stateless_messaging.cpp
+++ b/src/stateless/messaging/trex_stateless_messaging.cpp
@@ -180,11 +180,29 @@ TrexStatelessDpUpdate::clone() {
return new_msg;
}
+/*************************
+ barrier message
+ ************************/
+
+bool
+TrexStatelessDpBarrier::handle(TrexStatelessDpCore *dp_core) {
+ dp_core->barrier(m_port_id, m_event_id);
+ return true;
+}
+
+TrexStatelessCpToDpMsgBase *
+TrexStatelessDpBarrier::clone() {
+
+ TrexStatelessCpToDpMsgBase *new_msg = new TrexStatelessDpBarrier(m_port_id, m_event_id);
+
+ return new_msg;
+}
+
/************************* messages from DP to CP **********************/
bool
TrexDpPortEventMsg::handle() {
TrexStatelessPort *port = get_stateless_obj()->get_port_by_id(m_port_id);
- port->get_dp_events().handle_event(m_event_type, m_thread_id, m_event_id);
+ port->get_dp_events().on_core_reporting_in(m_event_id, m_thread_id);
return (true);
}
diff --git a/src/stateless/messaging/trex_stateless_messaging.h b/src/stateless/messaging/trex_stateless_messaging.h
index d56596bf..dda086b7 100644
--- a/src/stateless/messaging/trex_stateless_messaging.h
+++ b/src/stateless/messaging/trex_stateless_messaging.h
@@ -145,7 +145,7 @@ public:
TrexStatelessDpStop(uint8_t port_id) : m_port_id(port_id) {
m_stop_only_for_event_id=false;
- m_event_id=0;
+ m_event_id = 0;
m_core = NULL;
}
@@ -245,6 +245,26 @@ private:
double m_factor;
};
+/**
+ * barrier message for DP core
+ *
+ */
+class TrexStatelessDpBarrier : public TrexStatelessCpToDpMsgBase {
+public:
+
+ TrexStatelessDpBarrier(uint8_t port_id, int event_id) {
+ m_port_id = port_id;
+ m_event_id = event_id;
+ }
+
+ virtual bool handle(TrexStatelessDpCore *dp_core);
+
+ virtual TrexStatelessCpToDpMsgBase * clone();
+
+private:
+ uint8_t m_port_id;
+ int m_event_id;
+};
/************************* messages from DP to CP **********************/
@@ -282,10 +302,9 @@ public:
class TrexDpPortEventMsg : public TrexStatelessDpToCpMsgBase {
public:
- TrexDpPortEventMsg(int thread_id, uint8_t port_id, TrexDpPortEvent::event_e type, int event_id) {
+ TrexDpPortEventMsg(int thread_id, uint8_t port_id, int event_id) {
m_thread_id = thread_id;
m_port_id = port_id;
- m_event_type = type;
m_event_id = event_id;
}
@@ -299,10 +318,6 @@ public:
return m_port_id;
}
- TrexDpPortEvent::event_e get_event_type() {
- return m_event_type;
- }
-
int get_event_id() {
return m_event_id;
}
@@ -310,7 +325,6 @@ public:
private:
int m_thread_id;
uint8_t m_port_id;
- TrexDpPortEvent::event_e m_event_type;
int m_event_id;
};