summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYasufumi Ogawa <yasufum.o@gmail.com>2019-09-12 19:48:22 +0900
committerYasufumi Ogawa <yasufum.o@gmail.com>2019-10-04 22:06:14 +0900
commit0d0bd5360945dfb972c6514165f637c019a8cb6c (patch)
tree07edaccc44ce3ee1f5f204205836817c8b337124
parent703443961aaa85e4811f6d9fa1a9707fbb899dfa (diff)
downloadspp-0d0bd5360945dfb972c6514165f637c019a8cb6c.zip
spp-0d0bd5360945dfb972c6514165f637c019a8cb6c.tar.gz
spp-0d0bd5360945dfb972c6514165f637c019a8cb6c.tar.xz
spp_mirror: revise util func for status command
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>
-rw-r--r--src/mirror/mir_cmd_runner.c23
1 files 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;