summaryrefslogtreecommitdiffstats
path: root/src/stateless
diff options
context:
space:
mode:
authorimarom <imarom@cisco.com>2016-11-30 17:54:54 +0200
committerimarom <imarom@cisco.com>2016-11-30 17:54:54 +0200
commit1783336927c38d4fc87f510a1816ece2cc318321 (patch)
tree59bf5cf5f20b53bbd32ecb46387051d84a71f85b /src/stateless
parentb812770167d37125b3f3e1b0673517d8f83393ac (diff)
minor bugs
Signed-off-by: imarom <imarom@cisco.com>
Diffstat (limited to 'src/stateless')
-rw-r--r--src/stateless/rx/trex_stateless_rx_core.cpp25
1 files changed, 11 insertions, 14 deletions
diff --git a/src/stateless/rx/trex_stateless_rx_core.cpp b/src/stateless/rx/trex_stateless_rx_core.cpp
index b24fcb8f..f518fcd3 100644
--- a/src/stateless/rx/trex_stateless_rx_core.cpp
+++ b/src/stateless/rx/trex_stateless_rx_core.cpp
@@ -182,31 +182,28 @@ void CRxCoreStateless::port_manager_tick() {
}
void CRxCoreStateless::handle_work_stage(bool do_try_rx_queue) {
- int i = 0;
- int j = 0;
+
+ /* set the next sync time to */
+ dsec_t sync_time_sec = now_sec() + (1.0 / 1000);
while (m_state == STATE_WORKING) {
-
+
if (do_try_rx_queue) {
try_rx_queues();
}
process_all_pending_pkts();
- /* TODO: with scheduler, this should be solved better */
- i++;
- if (i == 100000) { // approx 10msec
- i = 0;
- periodic_check_for_cp_messages(); // m_state might change in here
-
- j++;
- if (j == 100) { // approx 1 sec
- j = 0;
- port_manager_tick();
- }
+ dsec_t now = now_sec();
+
+ if ( (now - sync_time_sec) > 0 ) {
+ periodic_check_for_cp_messages();
+ port_manager_tick();
+ sync_time_sec = now + (1.0 / 1000);
}
rte_pause();
+
}
}