From 148f1080f80a8af6e20529f83512cae6f438eefa Mon Sep 17 00:00:00 2001 From: Alessandro Thea Date: Tue, 7 Nov 2023 10:17:55 +0100 Subject: [PATCH] skipping nanosleep call if sleep set to 0 --- src/detail/IfaceWrapper.hxx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/detail/IfaceWrapper.hxx b/src/detail/IfaceWrapper.hxx index daab998..bf99869 100644 --- a/src/detail/IfaceWrapper.hxx +++ b/src/detail/IfaceWrapper.hxx @@ -103,8 +103,10 @@ IfaceWrapper::rx_runner(void *arg __rte_unused) { // If no full buffers in burst... if (!fb_count) { - // Sleep n nanoseconds... (value from config, timespec initialized in lcore first lines) - /*int response =*/ nanosleep(&sleep_request, nullptr); + if (m_lcore_sleep_ns) { + // Sleep n nanoseconds... (value from config, timespec initialized in lcore first lines) + /*int response =*/ nanosleep(&sleep_request, nullptr); + } } } // main while(quit) loop