summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYasufumi Ogawa <yasufum.o@gmail.com>2019-09-12 19:48:23 +0900
committerYasufumi Ogawa <yasufum.o@gmail.com>2019-10-04 22:06:14 +0900
commitdf0f2fa9a728cbebbeeadd1694e57de4ed4d29ce (patch)
tree14fc4919bc9cc0e6bcd3b9c757413170ff64a2e0
parent0d0bd5360945dfb972c6514165f637c019a8cb6c (diff)
downloadspp-df0f2fa9a728cbebbeeadd1694e57de4ed4d29ce.zip
spp-df0f2fa9a728cbebbeeadd1694e57de4ed4d29ce.tar.gz
spp-df0f2fa9a728cbebbeeadd1694e57de4ed4d29ce.tar.xz
spp_pcap: 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/pcap/cmd_runner.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/src/pcap/cmd_runner.c b/src/pcap/cmd_runner.c
index 63658a5..ac5181d 100644
--- a/src/pcap/cmd_runner.c
+++ b/src/pcap/cmd_runner.c
@@ -61,12 +61,9 @@ const char *CAPTURE_STATUS_STRINGS[] = {
"", /* termination */
};
-/**
- * Iterate core information for number of available cores to
- * append response for status command.
- */
+/* Iterate core info to create response of spp_pcap 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;
@@ -78,8 +75,7 @@ spp_iterate_core_info(struct sppwk_lcore_params *params)
ret = spp_pcap_get_core_status(lcore_id, params);
if (unlikely(ret != 0)) {
RTE_LOG(ERR, PCAP_RUNNER,
- "Cannot iterate core information. "
- "(core = %d)\n", lcore_id);
+ "Failed to get lcore %d\n", lcore_id);
return SPPWK_RET_NG;
}
}
@@ -524,7 +520,7 @@ append_core_value(const char *name, char **output,
lcore_params.output = tmp_buff;
lcore_params.lcore_proc = append_pcap_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;