summaryrefslogtreecommitdiffstats
path: root/src/main_dpdk.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/main_dpdk.cpp')
-rw-r--r--src/main_dpdk.cpp24
1 files changed, 15 insertions, 9 deletions
diff --git a/src/main_dpdk.cpp b/src/main_dpdk.cpp
index c8921ba7..05d89f9d 100644
--- a/src/main_dpdk.cpp
+++ b/src/main_dpdk.cpp
@@ -3859,24 +3859,30 @@ int CGlobalTRex::run_in_master() {
/* exception and scope safe */
std::unique_lock<std::mutex> cp_lock(m_cp_lock);
- uint32_t slow_path_ms = 0;
+ uint32_t slow_path_counter = 0;
+
+ const int FASTPATH_DELAY_MS = 20;
+ const int SLOWPATH_DELAY_MS = 500;
while ( true ) {
- if (slow_path_ms >= 500) {
+ /* fast path */
+ if (!handle_fast_path()) {
+ break;
+ }
+
+ /* slow path */
+ if (slow_path_counter >= SLOWPATH_DELAY_MS) {
if (!handle_slow_path(was_stopped)) {
break;
}
- slow_path_ms = 0;
+ slow_path_counter = 0;
}
- if (!handle_fast_path()) {
- break;
- }
-
+
cp_lock.unlock();
- delay(20);
- slow_path_ms += 20;
+ delay(FASTPATH_DELAY_MS);
+ slow_path_counter += FASTPATH_DELAY_MS;
cp_lock.lock();
}