Soft Patch Panel
 help / color / mirror / Atom feed
From: yasufum.o@gmail.com
To: spp@dpdk.org, ferruh.yigit@intel.com, yasufum.o@gmail.com
Subject: [spp] [PATCH 3/4] spp_pcap: unify return codes
Date: Mon, 22 Jul 2019 10:38:45 +0900	[thread overview]
Message-ID: <20190722013846.18618-4-yasufum.o@gmail.com> (raw)
In-Reply-To: <20190722013846.18618-1-yasufum.o@gmail.com>

From: Yasufumi Ogawa <yasufum.o@gmail.com>

Change return codes of SPP_RET_OK and SPP_RET_NG to SPPWK_RET_OK and
SPPWK_RET_NG to unify the return codes.

Signed-off-by: Yasufumi Ogawa <yasufum.o@gmail.com>
---
 src/pcap/cmd_runner.c | 7 ++++---
 src/pcap/cmd_runner.h | 2 +-
 src/pcap/cmd_utils.h  | 8 ++++----
 src/pcap/spp_pcap.c   | 2 +-
 4 files changed, 10 insertions(+), 9 deletions(-)

diff --git a/src/pcap/cmd_runner.c b/src/pcap/cmd_runner.c
index 5754841..21de3f9 100644
--- a/src/pcap/cmd_runner.c
+++ b/src/pcap/cmd_runner.c
@@ -919,10 +919,10 @@ spp_command_proc_init(const char *ctl_ipaddr, int ctl_port)
 
 /* process command from controller. */
 int
-spp_command_proc_do(void)
+sppwk_run_cmd(void)
 {
-	int ret = SPPWK_RET_NG;
-	int msg_ret = -1;
+	int ret;
+	int msg_ret;
 
 	static int sock = -1;
 	static char *msgbuf;
@@ -938,6 +938,7 @@ spp_command_proc_do(void)
 	}
 
 	ret = conn_spp_ctl(&sock);
+
 	if (unlikely(ret != SPPWK_RET_OK))
 		return SPPWK_RET_OK;
 
diff --git a/src/pcap/cmd_runner.h b/src/pcap/cmd_runner.h
index 0e53081..6e2d404 100644
--- a/src/pcap/cmd_runner.h
+++ b/src/pcap/cmd_runner.h
@@ -37,6 +37,6 @@ spp_command_proc_init(const char *controller_ip, int controller_port);
  *            (occurred connection failure, or received exit command)
  */
 int
-spp_command_proc_do(void);
+sppwk_run_cmd(void);
 
 #endif /* _SPP_PCAP_CMD_RUNNER_H_ */
diff --git a/src/pcap/cmd_utils.h b/src/pcap/cmd_utils.h
index fb8c300..31e4aeb 100644
--- a/src/pcap/cmd_utils.h
+++ b/src/pcap/cmd_utils.h
@@ -286,8 +286,8 @@ struct core_info *get_core_info(unsigned int lcore_id);
  * @param port String of port type to be converted.
  * @param iface_type Interface type.
  * @param iface_no Interface number.
- * @retval SPP_RET_OK If succeeded.
- * @retval SPP_RET_NG If failed.
+ * @retval SPPWK_RET_OK If succeeded.
+ * @retval SPPWK_RET_NG If failed.
  */
 /* TODO(yasufum) consider to merge to shared. */
 int
@@ -316,8 +316,8 @@ spp_format_port_string(char *port, enum port_type iface_type, int iface_no);
  * @param core_mng_p Pointer to g_core_info address.
  * @param capture_status_p Pointer to status of pcap.
  * @param capture_request_p Pointer to req of pcap.
- * @retval SPP_RET_OK If succeeded.
- * @retval SPP_RET_NG If failed.
+ * @retval SPPWK_RET_OK If succeeded.
+ * @retval SPPWK_RET_NG If failed.
  */
 int spp_set_mng_data_addr(struct iface_info *iface_p,
 			  struct core_mng_info *core_mng_p,
diff --git a/src/pcap/spp_pcap.c b/src/pcap/spp_pcap.c
index 39667d8..7459ba9 100644
--- a/src/pcap/spp_pcap.c
+++ b/src/pcap/spp_pcap.c
@@ -1056,7 +1056,7 @@ main(int argc, char *argv[])
 		while (likely(g_core_info[master_lcore].status !=
 				SPPWK_LCORE_REQ_STOP)) {
 			/* Receive command */
-			ret_do = spp_command_proc_do();
+			ret_do = sppwk_run_cmd();
 			if (unlikely(ret_do != SPPWK_RET_OK))
 				break;
 
-- 
2.17.1


  parent reply	other threads:[~2019-07-22  1:39 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-22  1:38 [spp] [PATCH 0/4] Update to " yasufum.o
2019-07-22  1:38 ` [spp] [PATCH 1/4] spp_vf: " yasufum.o
2019-07-22  1:38 ` [spp] [PATCH 2/4] spp_mirror: " yasufum.o
2019-07-22  1:38 ` yasufum.o [this message]
2019-07-22  1:38 ` [spp] [PATCH 4/4] docs: " yasufum.o

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=20190722013846.18618-4-yasufum.o@gmail.com \
    --to=yasufum.o@gmail.com \
    --cc=ferruh.yigit@intel.com \
    --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).