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 7/9] spp_mirror: revise util func for status command
Date: Thu, 12 Sep 2019 19:48:22 +0900	[thread overview]
Message-ID: <20190912104824.21519-8-yasufum.o@gmail.com> (raw)
In-Reply-To: <20190912104824.21519-1-yasufum.o@gmail.com>

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

As previous patch for spp_vf, this update is to rename it to
iterate_lcore_info() and add comments as refactoring.

Signed-off-by: Yasufumi Ogawa <yasufum.o@gmail.com>
---
 src/mirror/mir_cmd_runner.c | 23 +++++++++--------------
 1 file changed, 9 insertions(+), 14 deletions(-)

diff --git a/src/mirror/mir_cmd_runner.c b/src/mirror/mir_cmd_runner.c
index 730d75f..fb1695f 100644
--- a/src/mirror/mir_cmd_runner.c
+++ b/src/mirror/mir_cmd_runner.c
@@ -294,9 +294,9 @@ exec_one_cmd(const struct sppwk_cmd_attrs *cmd)
 	return ret;
 }
 
-/* Iterate core information to create response to status command */
+/* Iterate core info to create response of spp_mirror status */
 static int
-spp_iterate_core_info(struct sppwk_lcore_params *params)
+iterate_lcore_info(struct sppwk_lcore_params *params)
 {
 	int ret;
 	int lcore_id, cnt;
@@ -310,16 +310,12 @@ spp_iterate_core_info(struct sppwk_lcore_params *params)
 
 		core = get_core_info(lcore_id);
 		if (core->num == 0) {
-			ret = (*params->lcore_proc)(
-				params, lcore_id,
-				"", SPPWK_TYPE_NONE_STR,
-				0, NULL, 0, NULL);
+			ret = (*params->lcore_proc)(params, lcore_id, "",
+					SPPWK_TYPE_NONE_STR, 0, NULL, 0, NULL);
 			if (unlikely(ret != 0)) {
 				RTE_LOG(ERR, MIR_CMD_RUNNER,
-						"Cannot iterate core "
-						"information. "
-						"(core = %d, type = %d)\n",
-						lcore_id, SPPWK_TYPE_NONE);
+						"Failed to proc on lcore %d\n",
+						lcore_id);
 				return SPPWK_RET_NG;
 			}
 			continue;
@@ -334,9 +330,8 @@ spp_iterate_core_info(struct sppwk_lcore_params *params)
 
 			if (unlikely(ret != 0)) {
 				RTE_LOG(ERR, MIR_CMD_RUNNER,
-						"Cannot iterate core "
-						"information. "
-						"(core = %d, type = %d)\n",
+						"Failed to get on lcore %d ,"
+						"type %d\n",
 						lcore_id, comp_info->wk_type);
 				return SPPWK_RET_NG;
 			}
@@ -365,7 +360,7 @@ add_core(const char *name, char **output,
 	lcore_params.output = tmp_buff;
 	lcore_params.lcore_proc = append_core_element_value;
 
-	ret = spp_iterate_core_info(&lcore_params);
+	ret = iterate_lcore_info(&lcore_params);
 	if (unlikely(ret != SPPWK_RET_OK)) {
 		spp_strbuf_free(lcore_params.output);
 		return SPPWK_RET_NG;
-- 
2.17.1


  parent reply	other threads:[~2019-09-12 10:48 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-12 10:48 [spp] [PATCH 0/9] Refactor ringlatencystats yasufum.o
2019-09-12 10:48 ` [spp] [PATCH 1/9] shared: rename file ringlatencystats to be short yasufum.o
2019-09-12 10:48 ` [spp] [PATCH 2/9] shared: rename func for calc latency of ring yasufum.o
2019-09-12 10:48 ` [spp] [PATCH 3/9] shared: rename struct for ring latency stats yasufum.o
2019-09-12 10:48 ` [spp] [PATCH 4/9] shared: rename func for init " yasufum.o
2019-09-12 10:48 ` [spp] [PATCH 5/9] shared: renaem util funcs of ring latency yasufum.o
2019-09-12 10:48 ` [spp] [PATCH 6/9] spp_vf: revise util func for status command yasufum.o
2019-09-12 10:48 ` yasufum.o [this message]
2019-09-12 10:48 ` [spp] [PATCH 8/9] spp_pcap: " yasufum.o
2019-09-12 10:48 ` [spp] [PATCH 9/9] shared: add TODO to fix bug in latency stats 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=20190912104824.21519-8-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).