summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYasufumi Ogawa <yasufum.o@gmail.com>2019-09-12 19:48:21 +0900
committerYasufumi Ogawa <yasufum.o@gmail.com>2019-10-04 22:06:14 +0900
commit703443961aaa85e4811f6d9fa1a9707fbb899dfa (patch)
tree6c669d8f6eff470df6ee1256a79631436e653a0e
parent499192ecfc9a355d57796e2b479f7d90b394fd09 (diff)
downloadspp-703443961aaa85e4811f6d9fa1a9707fbb899dfa.zip
spp-703443961aaa85e4811f6d9fa1a9707fbb899dfa.tar.gz
spp-703443961aaa85e4811f6d9fa1a9707fbb899dfa.tar.xz
spp_vf: revise util func for status command
Util function spp_iterate_core_info() is for gettng each of lcore info for composing response of status command. 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/vf/vf_cmd_runner.c23
1 files changed, 9 insertions, 14 deletions
diff --git a/src/vf/vf_cmd_runner.c b/src/vf/vf_cmd_runner.c
index c94288a..305c4a2 100644
--- a/src/vf/vf_cmd_runner.c
+++ b/src/vf/vf_cmd_runner.c
@@ -428,9 +428,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_vf 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;
@@ -444,16 +444,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, VF_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;
@@ -474,9 +470,8 @@ spp_iterate_core_info(struct sppwk_lcore_params *params)
if (unlikely(ret != 0)) {
RTE_LOG(ERR, VF_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;
}
@@ -502,7 +497,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;