[spp] [PATCH 3/3] spp_mirror: improve command response time

x-fn-spp at sl.ntt-tx.co.jp x-fn-spp at sl.ntt-tx.co.jp
Fri Jan 11 05:27:43 CET 2019


From: Hideyuki Yamashita <yamashita.hideyuki at po.ntt-tx.co.jp>

This patch improves command response time of spp_mirror.

Signed-off-by: Hideyuki Yamashita <yamashita.hideyuki at po.ntt-tx.co.jp>
Signed-off-by: Naoki Takada <takada.naoki at lab.ntt.co.jp>
---
 src/mirror/spp_mirror.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/mirror/spp_mirror.c b/src/mirror/spp_mirror.c
index 36efa26..fb9bcb1 100644
--- a/src/mirror/spp_mirror.c
+++ b/src/mirror/spp_mirror.c
@@ -681,8 +681,11 @@ main(int argc, char *argv[])
 			ret_do = spp_command_proc_do();
 			if (unlikely(ret_do != SPP_RET_OK))
 				break;
-
-			sleep(1);
+			/*
+			 * To avoid making CPU busy, this thread waits
+			 * here for 100 ms.
+			 */
+			usleep(100);
 
 #ifdef SPP_RINGLATENCYSTATS_ENABLE
 			print_ring_latency_stats();
-- 
2.17.1



More information about the spp mailing list