From: ogawa.yasufumi@lab.ntt.co.jp
To: spp@dpdk.org, ferruh.yigit@intel.com, ogawa.yasufumi@lab.ntt.co.jp
Subject: [spp] [PATCH 3/8] shared/sec: rename parsing comp for port cmd
Date: Tue, 21 May 2019 11:32:19 +0900 [thread overview]
Message-ID: <1558405944-8355-4-git-send-email-ogawa.yasufumi@lab.ntt.co.jp> (raw)
In-Reply-To: <1558405944-8355-1-git-send-email-ogawa.yasufumi@lab.ntt.co.jp>
From: Yasufumi Ogawa <ogawa.yasufumi@lab.ntt.co.jp>
This update is to rename `decode_port_name_value()` to
`parse_comp_name_portcmd()`. This parsing component name is almost same
as `parse_comp_name()` and ambiguous why it is required, so it should
be confirmed later it is required or not actually.
Signed-off-by: Yasufumi Ogawa <ogawa.yasufumi@lab.ntt.co.jp>
---
src/shared/secondary/spp_worker_th/cmd_parser.c | 14 ++++++++------
src/shared/secondary/spp_worker_th/spp_proc.c | 3 ++-
2 files changed, 10 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 0083770..0c65018 100644
--- a/src/shared/secondary/spp_worker_th/cmd_parser.c
+++ b/src/shared/secondary/spp_worker_th/cmd_parser.c
@@ -334,8 +334,8 @@ parse_comp_name(void *output, const char *arg_val,
/* Parsing the name is required only for action `start`. */
if (component->wk_action == SPPWK_ACT_START) {
- /* Get lcore ID as comp name, or NG code. */
- ret = spp_get_component_id(arg_val);
+ /* Check if lcore is already used. */
+ ret = spp_get_component_id(arg_val); /* Get lcore ID. */
if (unlikely(ret >= 0)) {
RTE_LOG(ERR, SPP_COMMAND_PROC,
"Comp name '%s' is already used.\n",
@@ -483,14 +483,16 @@ parse_port_rxtx(void *output, const char *arg_val, int allow_override)
return SPP_RET_OK;
}
-/* decoding procedure of component name for port command */
+/* Parse comp name for `port` command. */
+/* TODO(yasufum) confirm why parsing comp name "for port cmd" is required. */
static int
-decode_port_name_value(void *output, const char *arg_val,
+parse_comp_name_portcmd(void *output, const char *arg_val,
int allow_override __attribute__ ((unused)))
{
int ret = SPP_RET_OK;
- ret = spp_get_component_id(arg_val);
+ /* Check if lcore is already used. */
+ ret = spp_get_component_id(arg_val); /* Get lcore ID. */
if (unlikely(ret < SPP_RET_OK)) {
RTE_LOG(ERR, SPP_COMMAND_PROC,
"Unknown component name. val=%s\n", arg_val);
@@ -843,7 +845,7 @@ cmd_ops_list[][SPPWK_MAX_PARAMS] = {
{
.name = "component name",
.offset = offsetof(struct spp_command, spec.port.name),
- .func = decode_port_name_value
+ .func = parse_comp_name_portcmd
},
{
.name = "port vlan operation",
diff --git a/src/shared/secondary/spp_worker_th/spp_proc.c b/src/shared/secondary/spp_worker_th/spp_proc.c
index e552bf1..7333e62 100644
--- a/src/shared/secondary/spp_worker_th/spp_proc.c
+++ b/src/shared/secondary/spp_worker_th/spp_proc.c
@@ -725,7 +725,8 @@ get_free_component(void)
return SPP_RET_NG;
}
-/* Get component id for specified component name */
+/* Get lcore id for as component name. */
+/* TODO(yasufum) change the name because it's not comp ID. */
int
spp_get_component_id(const char *name)
{
--
2.17.1
next prev parent reply other threads:[~2019-05-21 2:34 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-05-21 2:32 [spp] [PATCH 0/8] Refactor funcs for parsing " ogawa.yasufumi
2019-05-21 2:32 ` [spp] [PATCH 1/8] shared/sec: rename parsing port for " ogawa.yasufumi
2019-05-21 2:32 ` [spp] [PATCH 2/8] shared/sec: rename parsing rx and tx ogawa.yasufumi
2019-05-21 2:32 ` ogawa.yasufumi [this message]
2019-05-21 2:32 ` [spp] [PATCH 4/8] shared/sec: rename parsing vlan operations ogawa.yasufumi
2019-05-21 2:32 ` [spp] [PATCH 5/8] shared/sec: rename func for parsing VLAN ID ogawa.yasufumi
2019-05-21 2:32 ` [spp] [PATCH 6/8] shared/sec: rename func for parsing PCP ogawa.yasufumi
2019-05-21 2:32 ` [spp] [PATCH 7/8] shared/sec: rename func for parsing MAC addr ogawa.yasufumi
2019-05-21 2:32 ` [spp] [PATCH 8/8] shared/sec: rename func to convert MAC addr type ogawa.yasufumi
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=1558405944-8355-4-git-send-email-ogawa.yasufumi@lab.ntt.co.jp \
--to=ogawa.yasufumi@lab.ntt.co.jp \
--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).