Soft Patch Panel
 help / color / mirror / Atom feed
From: ogawa.yasufumi@lab.ntt.co.jp
To: spp@dpdk.org, ferruh.yigit@intel.com, ogawa.yasufumi@lab.ntt.co.jp
Subject: [spp] [PATCH 4/4] shared/sec: rename operator func for parsing cmds
Date: Tue, 21 May 2019 11:31:43 +0900	[thread overview]
Message-ID: <1558405903-8252-5-git-send-email-ogawa.yasufumi@lab.ntt.co.jp> (raw)
In-Reply-To: <1558405903-8252-1-git-send-email-ogawa.yasufumi@lab.ntt.co.jp>

From: Yasufumi Ogawa <ogawa.yasufumi@lab.ntt.co.jp>

Operator functions for parsing command is prefixed as
`decode_command_parameter_` are renamed to `parse_cmd_` because for
too long and not intuitive.

Signed-off-by: Yasufumi Ogawa <ogawa.yasufumi@lab.ntt.co.jp>
---
 .../secondary/spp_worker_th/cmd_parser.c      | 41 ++++++++-----------
 1 file changed, 16 insertions(+), 25 deletions(-)

diff --git a/src/shared/secondary/spp_worker_th/cmd_parser.c b/src/shared/secondary/spp_worker_th/cmd_parser.c
index b553ae0..ae845f4 100644
--- a/src/shared/secondary/spp_worker_th/cmd_parser.c
+++ b/src/shared/secondary/spp_worker_th/cmd_parser.c
@@ -860,10 +860,9 @@ cmd_ops_list[][SPPWK_MAX_PARAMS] = {
 
 /* Validate given command. */
 static int
-decode_command_parameter_component(struct sppwk_cmd_req *request,
-				int argc, char *argv[],
-				struct sppwk_parse_err_msg *wk_err_msg,
-				int maxargc __attribute__ ((unused)))
+parse_cmd_comp(struct sppwk_cmd_req *request, int argc, char *argv[],
+		struct sppwk_parse_err_msg *wk_err_msg,
+		int maxargc __attribute__ ((unused)))
 {
 	int ret = SPP_RET_OK;
 	int ci = request->commands[0].type;
@@ -888,23 +887,17 @@ decode_command_parameter_component(struct sppwk_cmd_req *request,
 
 /* Validate given command for clssfier_table. */
 static int
-decode_command_parameter_cls_table(struct sppwk_cmd_req *request,
-				int argc, char *argv[],
-				struct sppwk_parse_err_msg *wk_err_msg,
-				int maxargc)
+parse_cmd_cls_table(struct sppwk_cmd_req *request, int argc, char *argv[],
+		struct sppwk_parse_err_msg *wk_err_msg, int maxargc)
 {
-	return decode_command_parameter_component(request,
-						argc,
-						argv,
-						wk_err_msg,
-						maxargc);
+	return parse_cmd_comp(request, argc, argv, wk_err_msg, maxargc);
 }
+
 /* Validate given command for clssfier_table of vlan. */
 static int
-decode_command_parameter_cls_table_vlan(struct sppwk_cmd_req *request,
-				int argc, char *argv[],
-				struct sppwk_parse_err_msg *wk_err_msg,
-				int maxargc __attribute__ ((unused)))
+parse_cmd_cls_table_vlan(struct sppwk_cmd_req *request, int argc, char *argv[],
+		struct sppwk_parse_err_msg *wk_err_msg,
+		int maxargc __attribute__ ((unused)))
 {
 	int ret = SPP_RET_OK;
 	int ci = request->commands[0].type;
@@ -928,10 +921,8 @@ decode_command_parameter_cls_table_vlan(struct sppwk_cmd_req *request,
 
 /* Validate given command for port. */
 static int
-decode_command_parameter_port(struct sppwk_cmd_req *request,
-				int argc, char *argv[],
-				struct sppwk_parse_err_msg *wk_err_msg,
-				int maxargc)
+parse_cmd_port(struct sppwk_cmd_req *request, int argc, char *argv[],
+		struct sppwk_parse_err_msg *wk_err_msg, int maxargc)
 {
 	int ret = SPP_RET_OK;
 	int ci = request->commands[0].type;
@@ -977,13 +968,13 @@ struct cmd_parse_attrs {
  * and operator functions.
  */
 static struct cmd_parse_attrs cmd_attr_list[] = {
-	{ "classifier_table", 5, 5, decode_command_parameter_cls_table },
-	{ "classifier_table", 6, 6, decode_command_parameter_cls_table_vlan },
+	{ "classifier_table", 5, 5, parse_cmd_cls_table },
+	{ "classifier_table", 6, 6, parse_cmd_cls_table_vlan },
 	{ "_get_client_id", 1, 1, NULL },
 	{ "status", 1, 1, NULL },
 	{ "exit", 1, 1, NULL },
-	{ "component", 3, 5, decode_command_parameter_component },
-	{ "port", 5, 8, decode_command_parameter_port },
+	{ "component", 3, 5, parse_cmd_comp },
+	{ "port", 5, 8, parse_cmd_port },
 	{ "", 0, 0, NULL }  /* termination */
 };
 
-- 
2.17.1


      parent reply	other threads:[~2019-05-21  2:34 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-21  2:31 [spp] [PATCH 0/4] Revise name of funcs and data for parsing ogawa.yasufumi
2019-05-21  2:31 ` [spp] [PATCH 1/4] shared/sec: rename define for empty params ogawa.yasufumi
2019-05-21  2:31 ` [spp] [PATCH 2/4] shared/sec: rename struct of cmd operators ogawa.yasufumi
2019-05-21  2:31 ` [spp] [PATCH 3/4] shared/sec: rename func for parsing given command ogawa.yasufumi
2019-05-21  2:31 ` ogawa.yasufumi [this message]

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=1558405903-8252-5-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).