summaryrefslogtreecommitdiffstats
path: root/src/bp_sim.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/bp_sim.h')
-rwxr-xr-xsrc/bp_sim.h55
1 files changed, 54 insertions, 1 deletions
diff --git a/src/bp_sim.h b/src/bp_sim.h
index b4ef54d1..e1852da4 100755
--- a/src/bp_sim.h
+++ b/src/bp_sim.h
@@ -711,6 +711,14 @@ public:
return (btGetMaskBit32(m_flags1, 8, 8) ? true : false);
}
+ void setCloseEnable(bool enable) {
+ btSetMaskBit32(m_flags1, 9, 9, (enable ? 1 : 0) );
+ }
+
+ bool getCloseEnable(){
+ return (btGetMaskBit32(m_flags1, 9, 9) ? true : false);
+ }
+
public:
void Dump(FILE *fd);
@@ -2067,7 +2075,7 @@ public:
#define BURST_OFFSET_DTIME (100.0/1000000)
#define EAT_WINDOW_DTIME (15.0/1000000)
#define WAIT_WINDOW_SIZE (-1.0/1000000)
-
+
bool Create(CFlowGenListPerThread * parent);
void Delete();
@@ -2173,11 +2181,15 @@ private:
bool always,
CFlowGenListPerThread * thread,
double &old_offset);
+
+ FORCE_NO_INLINE void handle_time_strech(dsec_t cur_time, dsec_t dt, dsec_t &offset, CFlowGenListPerThread * thread);
+
private:
void handle_command(CGenNode *node, CFlowGenListPerThread *thread, bool &exit_scheduler);
void handle_flow_pkt(CGenNode *node, CFlowGenListPerThread *thread);
void handle_flow_sync(CGenNode *node, CFlowGenListPerThread *thread, bool &exit_scheduler);
void handle_pcap_pkt(CGenNode *node, CFlowGenListPerThread *thread);
+ void handle_maintenance(CFlowGenListPerThread *thread);
public:
pqueue_t m_p_queue;
@@ -2190,6 +2202,8 @@ public:
uint64_t m_non_active;
uint64_t m_limit;
CTimeHistogram m_realtime_his;
+
+ dsec_t m_last_sync_time_sec;
};
@@ -3821,6 +3835,45 @@ public:
m_stateless_dp_info.stop_traffic(port_id, false, 0);
}
+ /**
+ * return true if a core currently has some pending CP
+ * messages
+ */
+ bool are_any_pending_cp_messages() {
+ if (get_is_stateless()) {
+ return m_stateless_dp_info.are_any_pending_cp_messages();
+ } else {
+ /* for stateful this is always false */
+ return false;
+ }
+ }
+
+ /**
+ * a core provides services for two interfaces
+ * it can either be idle, active for one port
+ * or active for both
+ */
+ bool is_port_active(uint8_t port_id) {
+ /* for stateful (batch) core is always active,
+ for stateless relay the query to the next level
+ */
+ if (get_is_stateless()) {
+ return m_stateless_dp_info.is_port_active(port_id);
+ } else {
+ return true;
+ }
+ }
+
+
+ /**
+ * returns the two ports associated with this core
+ *
+ */
+ void get_port_ids(uint8_t &p1, uint8_t &p2) {
+ p1 = 2 * getDualPortId();
+ p2 = p1 + 1;
+ }
+
void Dump(FILE *fd);
void DumpCsv(FILE *fd);
void DumpStats(FILE *fd);