Soft Patch Panel
 help / color / mirror / Atom feed
From: ogawa.yasufumi@lab.ntt.co.jp
To: spp@dpdk.org, ferruh.yigit@intel.com, ogawa.yasufumi@lab.ntt.co.jp
Subject: [spp] [PATCH 01/11] shared/sec: rename functions of sppwk_cmd_runner
Date: Fri, 31 May 2019 12:35:55 +0900	[thread overview]
Message-ID: <1559273765-26130-2-git-send-email-ogawa.yasufumi@lab.ntt.co.jp> (raw)
In-Reply-To: <1559273765-26130-1-git-send-email-ogawa.yasufumi@lab.ntt.co.jp>

From: Yasufumi Ogawa <ogawa.yasufumi@lab.ntt.co.jp>

This update is to rename functions defined in header file
`sppwk_cmd_runner.h` to be more specific.

Signed-off-by: Yasufumi Ogawa <ogawa.yasufumi@lab.ntt.co.jp>
---
 src/mirror/spp_mirror.c                       |  4 +--
 .../secondary/spp_worker_th/cmd_runner.c      | 10 +++---
 .../secondary/spp_worker_th/cmd_runner.h      | 32 +++++++++----------
 src/vf/spp_vf.c                               |  4 +--
 4 files changed, 25 insertions(+), 25 deletions(-)

diff --git a/src/mirror/spp_mirror.c b/src/mirror/spp_mirror.c
index d46d3da..202475a 100644
--- a/src/mirror/spp_mirror.c
+++ b/src/mirror/spp_mirror.c
@@ -626,7 +626,7 @@ main(int argc, char *argv[])
 		spp_port_ability_init();
 
 		/* Setup connection for accepting commands from controller */
-		int ret_command_init = spp_command_proc_init(
+		int ret_command_init = sppwk_cmd_runner_conn(
 				g_startup_param.server_ip,
 				g_startup_param.server_port);
 		if (unlikely(ret_command_init != SPP_RET_OK))
@@ -675,7 +675,7 @@ main(int argc, char *argv[])
 		{
 #endif
 			/* Receive command */
-			ret_do = spp_command_proc_do();
+			ret_do = sppwk_cmd_run();
 			if (unlikely(ret_do != SPP_RET_OK))
 				break;
 			/*
diff --git a/src/shared/secondary/spp_worker_th/cmd_runner.c b/src/shared/secondary/spp_worker_th/cmd_runner.c
index 153ea01..74b41dd 100644
--- a/src/shared/secondary/spp_worker_th/cmd_runner.c
+++ b/src/shared/secondary/spp_worker_th/cmd_runner.c
@@ -1710,16 +1710,16 @@ process_request(int *sock, const char *request_str, size_t request_str_len)
 	return SPP_RET_OK;
 }
 
-/* initialize command processor. */
+/* Setup connection for accepting commands from spp-ctl. */
 int
-spp_command_proc_init(const char *controller_ip, int controller_port)
+sppwk_cmd_runner_conn(const char *ctl_ipaddr, int ctl_port)
 {
-	return spp_command_conn_init(controller_ip, controller_port);
+	return spp_command_conn_init(ctl_ipaddr, ctl_port);
 }
 
-/* process command from controller. */
+/* Run command from spp-ctl. */
 int
-spp_command_proc_do(void)
+sppwk_cmd_run(void)
 {
 	int ret = SPP_RET_NG;
 	int msg_ret = -1;
diff --git a/src/shared/secondary/spp_worker_th/cmd_runner.h b/src/shared/secondary/spp_worker_th/cmd_runner.h
index bccc0c5..4b768b7 100644
--- a/src/shared/secondary/spp_worker_th/cmd_runner.h
+++ b/src/shared/secondary/spp_worker_th/cmd_runner.h
@@ -7,36 +7,36 @@
 
 /**
  * @file
- * SPP Command processing
+ * Run command for SPP worker thread.
  *
- * Receive and process the command message, then send back the
- * result JSON formatted data.
+ * Receive command message from SPP controller and run. The result is returned
+ * to SPP controller as a JSON formatted message.
  */
 
 #include "spp_proc.h"
 
 /**
- * initialize command processor.
+ * Setup connection for accepting commands from spp-ctl.
  *
- * @param controller_ip
- *  The controller's ip address.
- * @param controller_port
- *  The controller's port number.
+ * @param ctl_ipaddr
+ * IP address of spp-ctl.
+ * @param ctl_port
+ * Port number of spp-ctl.
  *
- * @retval SPP_RET_OK succeeded.
- * @retval SPP_RET_NG failed.
+ * @retval SPP_RET_OK if succeeded.
+ * @retval SPP_RET_NG if failed.
  */
 int
-spp_command_proc_init(const char *controller_ip, int controller_port);
+sppwk_cmd_runner_conn(const char *ctl_ipaddr, int ctl_port);
 
 /**
- * process command from controller.
+ * Run command from spp-ctl.
  *
- * @retval SPP_RET_OK succeeded.
- * @retval SPP_RET_NG process termination is required.
- *            (occurred connection failure, or received exit command)
+ * @retval SPP_RET_OK if succeeded.
+ * TODO(yasufum) change exclude case of exit cmd because it is not NG.
+ * @retval SPP_RET_NG if connection failure or received exit command.
  */
 int
-spp_command_proc_do(void);
+sppwk_cmd_run(void);
 
 #endif  /* _SPPWK_CMD_RUNNER_H_ */
diff --git a/src/vf/spp_vf.c b/src/vf/spp_vf.c
index cbaa0c1..4134647 100644
--- a/src/vf/spp_vf.c
+++ b/src/vf/spp_vf.c
@@ -299,7 +299,7 @@ main(int argc, char *argv[])
 		spp_port_ability_init();
 
 		/* Setup connection for accepting commands from controller */
-		int ret_command_init = spp_command_proc_init(
+		int ret_command_init = sppwk_cmd_runner_conn(
 				g_startup_param.server_ip,
 				g_startup_param.server_port);
 		if (unlikely(ret_command_init != SPP_RET_OK))
@@ -342,7 +342,7 @@ main(int argc, char *argv[])
 		{
 #endif
 			/* Receive command */
-			ret_do = spp_command_proc_do();
+			ret_do = sppwk_cmd_run();
 			if (unlikely(ret_do != SPP_RET_OK))
 				break;
 
-- 
2.17.1


  reply	other threads:[~2019-05-31  3:38 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-31  3:35 [spp] [PATCH 00/11] Refactor functions for handling commands ogawa.yasufumi
2019-05-31  3:35 ` ogawa.yasufumi [this message]
2019-05-31  3:35 ` [spp] [PATCH 02/11] shared/sec: revise enum for cmd response ogawa.yasufumi
2019-05-31  3:35 ` [spp] [PATCH 03/11] shared/sec: refactor passing err in cmd_runner ogawa.yasufumi
2019-05-31  3:35 ` [spp] [PATCH 04/11] shared/sec: rename struct for command response ogawa.yasufumi
2019-05-31  3:35 ` [spp] [PATCH 05/11] shared/sec: refactor funcs for managing port info ogawa.yasufumi
2019-05-31  3:36 ` [spp] [PATCH 06/11] shared/sec: rename util functions in cmd_runner ogawa.yasufumi
2019-05-31  3:36 ` [spp] [PATCH 07/11] shared/sec: rename func for getting component ID ogawa.yasufumi
2019-05-31  3:36 ` [spp] [PATCH 08/11] shared/sec: refactor func for updating cls table ogawa.yasufumi
2019-05-31  3:36 ` [spp] [PATCH 09/11] shared/sec: rename func for executing command ogawa.yasufumi
2019-05-31  3:36 ` [spp] [PATCH 10/11] shared/sec: add helpers for logging cmd parser ogawa.yasufumi
2019-05-31  3:36 ` [spp] [PATCH 11/11] shared/sec: rename func for updating port ogawa.yasufumi

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=1559273765-26130-2-git-send-email-ogawa.yasufumi@lab.ntt.co.jp \
    --to=ogawa.yasufumi@lab.ntt.co.jp \
    --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).