Soft Patch Panel
 help / color / mirror / Atom feed
From: x-fn-spp@sl.ntt-tx.co.jp
To: ferruh.yigit@intel.com, ogawa.yasufumi@lab.ntt.co.jp
Cc: spp@dpdk.org
Subject: [spp] [PATCH 1/3] spp_vf: add sleep after disconnect detection
Date: Fri, 11 Jan 2019 13:27:41 +0900	[thread overview]
Message-ID: <201901110427.x0B4RhHp023481@imss03.silk.ntt-tx.co.jp> (raw)
In-Reply-To: <20190111042743.22673-1-x-fn-spp@sl.ntt-tx.co.jp>

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

       reply	other threads:[~2019-01-11  4:30 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20190111042743.22673-1-x-fn-spp@sl.ntt-tx.co.jp>
2019-01-11  4:27 ` x-fn-spp [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201901110427.x0B4RhHp023481@imss03.silk.ntt-tx.co.jp \
    --to=x-fn-spp@sl.ntt-tx.co.jp \
    --cc=ferruh.yigit@intel.com \
    --cc=ogawa.yasufumi@lab.ntt.co.jp \
    --cc=spp@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).