Soft Patch Panel
 help / color / mirror / Atom feed
* [spp] [PATCH 1/3] spp_vf: add sleep after disconnect detection
       [not found] <20190111042743.22673-1-x-fn-spp@sl.ntt-tx.co.jp>
@ 2019-01-11  4:27 ` x-fn-spp
  2019-01-11  4:27 ` [spp] [PATCH 2/3] spp_vf: improve command response time x-fn-spp
  2019-01-11  4:27 ` [spp] [PATCH 3/3] spp_mirror: " x-fn-spp
  2 siblings, 0 replies; 3+ messages in thread
From: x-fn-spp @ 2019-01-11  4:27 UTC (permalink / raw)
  To: ferruh.yigit, ogawa.yasufumi; +Cc: spp

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

This update is for adding sleep() to add interval to reconnect.

Interval of accepting command is reduced to fix slow response
in previous patches, but still need to add another interval to
reconnect to spp-ctl.

Signed-off-by: Hideyuki Yamashita <yamashita.hideyuki@po.ntt-tx.co.jp>
Signed-off-by: Naoki Takada <takada.naoki@lab.ntt.co.jp>
---
 src/vf/common/command_proc.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/src/vf/common/command_proc.c b/src/vf/common/command_proc.c
index a612061..00ecdc1 100644
--- a/src/vf/common/command_proc.c
+++ b/src/vf/common/command_proc.c
@@ -1648,11 +1648,13 @@ spp_command_proc_do(void)
 
 	msg_ret = spp_receive_message(&sock, &msgbuf);
 	if (unlikely(msg_ret <= 0)) {
-		if (likely(msg_ret == 0))
+		if (likely(msg_ret == 0)) {
+			sleep(1);
 			return SPP_RET_OK;
-		else if (unlikely(msg_ret == SPP_CONNERR_TEMPORARY))
+		} else if (unlikely(msg_ret == SPP_CONNERR_TEMPORARY)) {
+			sleep(1);
 			return SPP_RET_OK;
-		else
+		} else
 			return SPP_RET_NG;
 	}
 
-- 
2.17.1

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [spp] [PATCH 2/3] spp_vf: improve command response time
       [not found] <20190111042743.22673-1-x-fn-spp@sl.ntt-tx.co.jp>
  2019-01-11  4:27 ` [spp] [PATCH 1/3] spp_vf: add sleep after disconnect detection x-fn-spp
@ 2019-01-11  4:27 ` x-fn-spp
  2019-01-11  4:27 ` [spp] [PATCH 3/3] spp_mirror: " x-fn-spp
  2 siblings, 0 replies; 3+ messages in thread
From: x-fn-spp @ 2019-01-11  4:27 UTC (permalink / raw)
  To: ferruh.yigit, ogawa.yasufumi; +Cc: spp

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

This patch improves command response time of spp_vf.

Signed-off-by: Hideyuki Yamashita <yamashita.hideyuki@po.ntt-tx.co.jp>
Signed-off-by: Naoki Takada <takada.naoki@lab.ntt.co.jp>
---
 src/vf/spp_vf.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/vf/spp_vf.c b/src/vf/spp_vf.c
index 4e4a8e1..b81ad11 100644
--- a/src/vf/spp_vf.c
+++ b/src/vf/spp_vf.c
@@ -349,7 +349,12 @@ main(int argc, char *argv[])
 			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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [spp] [PATCH 3/3] spp_mirror: improve command response time
       [not found] <20190111042743.22673-1-x-fn-spp@sl.ntt-tx.co.jp>
  2019-01-11  4:27 ` [spp] [PATCH 1/3] spp_vf: add sleep after disconnect detection x-fn-spp
  2019-01-11  4:27 ` [spp] [PATCH 2/3] spp_vf: improve command response time x-fn-spp
@ 2019-01-11  4:27 ` x-fn-spp
  2 siblings, 0 replies; 3+ messages in thread
From: x-fn-spp @ 2019-01-11  4:27 UTC (permalink / raw)
  To: ferruh.yigit, ogawa.yasufumi; +Cc: spp

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

This patch improves command response time of spp_mirror.

Signed-off-by: Hideyuki Yamashita <yamashita.hideyuki@po.ntt-tx.co.jp>
Signed-off-by: Naoki Takada <takada.naoki@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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-01-11  4:30 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20190111042743.22673-1-x-fn-spp@sl.ntt-tx.co.jp>
2019-01-11  4:27 ` [spp] [PATCH 1/3] spp_vf: add sleep after disconnect detection x-fn-spp
2019-01-11  4:27 ` [spp] [PATCH 2/3] spp_vf: improve command response time x-fn-spp
2019-01-11  4:27 ` [spp] [PATCH 3/3] spp_mirror: " x-fn-spp

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).