[spp] [PATCH 6/6] shared/sec: rename func for parsing lcore ID
ogawa.yasufumi at lab.ntt.co.jp
ogawa.yasufumi at lab.ntt.co.jp
Tue May 21 04:31:22 CEST 2019
From: Yasufumi Ogawa <ogawa.yasufumi at lab.ntt.co.jp>
This update is to rename `decode_core_value()` to `parse_lcore_id()`
which is not for decoding but parsing.
Signed-off-by: Yasufumi Ogawa <ogawa.yasufumi at lab.ntt.co.jp>
---
src/shared/secondary/spp_worker_th/cmd_parser.c | 13 ++++++-------
1 file changed, 6 insertions(+), 7 deletions(-)
diff --git a/src/shared/secondary/spp_worker_th/cmd_parser.c b/src/shared/secondary/spp_worker_th/cmd_parser.c
index e0da244..84e5b55 100644
--- a/src/shared/secondary/spp_worker_th/cmd_parser.c
+++ b/src/shared/secondary/spp_worker_th/cmd_parser.c
@@ -278,18 +278,17 @@ parse_port_uid(void *output, const char *arg_val)
return SPP_RET_OK;
}
-/* decoding procedure of core */
+/* Parse given lcore ID. */
static int
-decode_core_value(void *output, const char *arg_val)
+parse_lcore_id(void *output, const char *arg_val)
{
- int ret = SPP_RET_OK;
+ int ret;
ret = get_uint_in_range(output, arg_val, 0, RTE_MAX_LCORE-1);
if (unlikely(ret < 0)) {
- RTE_LOG(ERR, SPP_COMMAND_PROC, "Bad core id. val=%s\n",
- arg_val);
+ RTE_LOG(ERR, SPP_COMMAND_PROC,
+ "Invalid lcore id '%s'.\n", arg_val);
return SPP_RET_NG;
}
-
return SPP_RET_OK;
}
@@ -356,7 +355,7 @@ decode_component_core_value(void *output, const char *arg_val,
if (component->wk_action != SPPWK_ACT_START)
return SPP_RET_OK;
- return decode_core_value(&component->core, arg_val);
+ return parse_lcore_id(&component->core, arg_val);
}
/* decoding procedure of type for component command */
--
2.17.1
More information about the spp
mailing list