From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from tama500.ecl.ntt.co.jp (tama500.ecl.ntt.co.jp [129.60.39.148]) by dpdk.org (Postfix) with ESMTP id BAFE22BB1 for ; Thu, 25 Oct 2018 07:19:54 +0200 (CEST) Received: from vc1.ecl.ntt.co.jp (vc1.ecl.ntt.co.jp [129.60.86.153]) by tama500.ecl.ntt.co.jp (8.13.8/8.13.8) with ESMTP id w9P5Jqjo007517; Thu, 25 Oct 2018 14:19:52 +0900 Received: from vc1.ecl.ntt.co.jp (localhost [127.0.0.1]) by vc1.ecl.ntt.co.jp (Postfix) with ESMTP id CA4ABEA7CFC; Thu, 25 Oct 2018 14:19:52 +0900 (JST) Received: from localhost.localdomain (unknown [129.60.13.51]) by vc1.ecl.ntt.co.jp (Postfix) with ESMTP id B31F0EA7CEC; Thu, 25 Oct 2018 14:19:52 +0900 (JST) From: ogawa.yasufumi@lab.ntt.co.jp To: spp@dpdk.org, ferruh.yigit@intel.com, ogawa.yasufumi@lab.ntt.co.jp Date: Thu, 25 Oct 2018 14:19:39 +0900 Message-Id: <20181025051943.17129-2-ogawa.yasufumi@lab.ntt.co.jp> X-Mailer: git-send-email 2.13.1 In-Reply-To: <20181025051943.17129-1-ogawa.yasufumi@lab.ntt.co.jp> References: <20181025051943.17129-1-ogawa.yasufumi@lab.ntt.co.jp> X-TM-AS-MML: disable Subject: [spp] [PATCH 1/5] spp_nfv: chage to return msg of exit command X-BeenThere: spp@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Soft Patch Panel List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Oct 2018 05:19:55 -0000 From: Yasufumi Ogawa This patch is to fix error of receiving data of NfvProc in spp-ctl. Spp_nfv returns no message after exit command while spp-ctl expects to get any of message as a result. To fix, change to return empty message. Signed-off-by: Yasufumi Ogawa --- src/nfv/nfv.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/nfv/nfv.c b/src/nfv/nfv.c index 05290ed..84d3df4 100644 --- a/src/nfv/nfv.c +++ b/src/nfv/nfv.c @@ -926,6 +926,7 @@ main(int argc, char *argv[]) int connected = 0; char str[MSG_SIZE]; unsigned int i; + int flg_exit; // used as res of parse_command() to exit if -1 int ret; ret = rte_eal_init(argc, argv); @@ -1000,13 +1001,14 @@ main(int argc, char *argv[]) RTE_LOG(DEBUG, APP, "Received string: %s\n", str); - ret = parse_command(str); - if (ret < 0) /* terminate process if exit is called */ - break; + flg_exit = parse_command(str); /*Send the message back to client*/ ret = do_send(&connected, &sock, str); - if (ret < 0) + + if (flg_exit < 0) /* terminate process if exit is called */ + break; + else if (ret < 0) continue; } -- 2.7.4