From: ogawa.yasufumi@lab.ntt.co.jp
To: spp@dpdk.org, ferruh.yigit@intel.com, ogawa.yasufumi@lab.ntt.co.jp
Subject: [spp] [PATCH 16/17] shared/sec: rename struct for command request
Date: Wed, 8 May 2019 11:01:34 +0900 [thread overview]
Message-ID: <1557280895-7978-17-git-send-email-ogawa.yasufumi@lab.ntt.co.jp> (raw)
In-Reply-To: <1557280895-7978-1-git-send-email-ogawa.yasufumi@lab.ntt.co.jp>
From: Yasufumi Ogawa <ogawa.yasufumi@lab.ntt.co.jp>
This update is to rename struct `spp_command_request` to `sppwk_cmd_req`
to be more simple and specific.
Signed-off-by: Yasufumi Ogawa <ogawa.yasufumi@lab.ntt.co.jp>
---
src/shared/secondary/spp_worker_th/cmd_parser.h | 6 +++---
src/shared/secondary/spp_worker_th/command_dec.c | 14 +++++++-------
src/shared/secondary/spp_worker_th/command_proc.c | 10 +++++-----
3 files changed, 15 insertions(+), 15 deletions(-)
diff --git a/src/shared/secondary/spp_worker_th/cmd_parser.h b/src/shared/secondary/spp_worker_th/cmd_parser.h
index 3d31833..e42bc14 100644
--- a/src/shared/secondary/spp_worker_th/cmd_parser.h
+++ b/src/shared/secondary/spp_worker_th/cmd_parser.h
@@ -116,7 +116,7 @@ struct spp_command {
};
/* Request parameters. */
-struct spp_command_request {
+struct sppwk_cmd_req {
int num_command; /**< Number of accepted commands */
int num_valid_command; /**< Number of executed commands */
struct spp_command commands[SPPWK_MAX_CMDS]; /**< list of cmds */
@@ -137,7 +137,7 @@ struct sppwk_parse_err_msg {
* Parse request of non null terminated string.
*
* @param request
- * The pointer to struct spp_command_request.@n
+ * The pointer to struct sppwk_cmd_req.@n
* The result value of decoding the command message.
* @param request_str
* The pointer to requested command message.
@@ -150,7 +150,7 @@ struct sppwk_parse_err_msg {
* @retval SPP_RET_OK succeeded.
* @retval !0 failed.
*/
-int spp_command_decode_request(struct spp_command_request *request,
+int spp_command_decode_request(struct sppwk_cmd_req *request,
const char *request_str, size_t request_str_len,
struct sppwk_parse_err_msg *wk_err_msg);
diff --git a/src/shared/secondary/spp_worker_th/command_dec.c b/src/shared/secondary/spp_worker_th/command_dec.c
index 918c2a2..80fd6d2 100644
--- a/src/shared/secondary/spp_worker_th/command_dec.c
+++ b/src/shared/secondary/spp_worker_th/command_dec.c
@@ -893,7 +893,7 @@ parameter_list[][SPPWK_MAX_PARAMS] = {
/* Validate given command. */
static int
-decode_command_parameter_component(struct spp_command_request *request,
+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)))
@@ -921,7 +921,7 @@ decode_command_parameter_component(struct spp_command_request *request,
/* Validate given command for clssfier_table. */
static int
-decode_command_parameter_cls_table(struct spp_command_request *request,
+decode_command_parameter_cls_table(struct sppwk_cmd_req *request,
int argc, char *argv[],
struct sppwk_parse_err_msg *wk_err_msg,
int maxargc)
@@ -934,7 +934,7 @@ decode_command_parameter_cls_table(struct spp_command_request *request,
}
/* Validate given command for clssfier_table of vlan. */
static int
-decode_command_parameter_cls_table_vlan(struct spp_command_request *request,
+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)))
@@ -961,7 +961,7 @@ decode_command_parameter_cls_table_vlan(struct spp_command_request *request,
/* Validate given command for port. */
static int
-decode_command_parameter_port(struct spp_command_request *request,
+decode_command_parameter_port(struct sppwk_cmd_req *request,
int argc, char *argv[],
struct sppwk_parse_err_msg *wk_err_msg,
int maxargc)
@@ -997,7 +997,7 @@ struct decode_command_list {
const char *name; /* Command name */
int param_min; /* Min number of parameters */
int param_max; /* Max number of parameters */
- int (*func)(struct spp_command_request *request, int argc,
+ int (*func)(struct sppwk_cmd_req *request, int argc,
char *argv[], struct sppwk_parse_err_msg *wk_err_msg,
int maxargc);
/* Pointer to command handling function */
@@ -1023,7 +1023,7 @@ static struct decode_command_list command_list[] = {
/* Parse command line parameters. */
static int
-decode_command_in_list(struct spp_command_request *request,
+decode_command_in_list(struct sppwk_cmd_req *request,
const char *request_str,
struct sppwk_parse_err_msg *wk_err_msg)
{
@@ -1083,7 +1083,7 @@ decode_command_in_list(struct spp_command_request *request,
/* decode request from no-null-terminated string */
int
spp_command_decode_request(
- struct spp_command_request *request,
+ struct sppwk_cmd_req *request,
const char *request_str, size_t request_str_len,
struct sppwk_parse_err_msg *wk_err_msg)
{
diff --git a/src/shared/secondary/spp_worker_th/command_proc.c b/src/shared/secondary/spp_worker_th/command_proc.c
index 6ce407e..1cb43e7 100644
--- a/src/shared/secondary/spp_worker_th/command_proc.c
+++ b/src/shared/secondary/spp_worker_th/command_proc.c
@@ -866,7 +866,7 @@ set_command_results(struct command_result *result,
/* set decode error to command result */
static void
set_decode_error_to_results(struct command_result *results,
- const struct spp_command_request *request,
+ const struct sppwk_cmd_req *request,
const struct sppwk_parse_err_msg *err_msg)
{
int i;
@@ -1501,7 +1501,7 @@ append_info_value(const char *name, char **output)
/* send response for decode error */
static void
send_decode_error_response(int *sock,
- const struct spp_command_request *request,
+ const struct sppwk_cmd_req *request,
struct command_result *command_results)
{
int ret = SPP_RET_NG;
@@ -1560,7 +1560,7 @@ send_decode_error_response(int *sock,
/* send response for command execution result */
static void
send_command_result_response(int *sock,
- const struct spp_command_request *request,
+ const struct sppwk_cmd_req *request,
struct command_result *command_results)
{
int ret = SPP_RET_NG;
@@ -1647,11 +1647,11 @@ process_request(int *sock, const char *request_str, size_t request_str_len)
int ret = SPP_RET_NG;
int i;
- struct spp_command_request request;
+ struct sppwk_cmd_req request;
struct sppwk_parse_err_msg wk_err_msg;
struct command_result command_results[SPPWK_MAX_CMDS];
- memset(&request, 0, sizeof(struct spp_command_request));
+ memset(&request, 0, sizeof(struct sppwk_cmd_req));
memset(&wk_err_msg, 0, sizeof(struct sppwk_parse_err_msg));
memset(command_results, 0, sizeof(command_results));
--
2.17.1
next prev parent reply other threads:[~2019-05-08 2:03 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-05-08 2:01 [spp] [PATCH 00/17] Refactor command parser of SPP worker ogawa.yasufumi
2019-05-08 2:01 ` [spp] [PATCH 01/17] shared/sec: change prefix of common functions ogawa.yasufumi
2019-05-08 2:01 ` [spp] [PATCH 02/17] shared/sec: refactor parse error code ogawa.yasufumi
2019-05-08 2:01 ` [spp] [PATCH 03/17] shared/sec: revice cmd parser of SPP worker ogawa.yasufumi
2019-05-08 2:01 ` [spp] [PATCH 04/17] shared/sec: refactor branching for cmd action ogawa.yasufumi
2019-05-08 2:01 ` [spp] [PATCH 05/17] shared/sec: rename define starts from SPP_CMD_MAX ogawa.yasufumi
2019-05-08 2:01 ` [spp] [PATCH 06/17] shared/sec: rename define of buffer size for cmds ogawa.yasufumi
2019-05-08 2:01 ` [spp] [PATCH 07/17] shared/sec: remove unused define of cmd parser ogawa.yasufumi
2019-05-08 2:01 ` [spp] [PATCH 08/17] shared/sec: refactor commad type of SPP worker ogawa.yasufumi
2019-05-08 2:01 ` [spp] [PATCH 09/17] shared/sec: change struct of classier table attrs ogawa.yasufumi
2019-05-08 2:01 ` [spp] [PATCH 10/17] shared/sec: refactor function parsing cls port ogawa.yasufumi
2019-05-08 2:01 ` [spp] [PATCH 11/17] shared/sec: rename func of flush command ogawa.yasufumi
2019-05-08 2:01 ` [spp] [PATCH 12/17] shared/sec: change struct of comp command ogawa.yasufumi
2019-05-08 2:01 ` [spp] [PATCH 13/17] shared/sec: revise port info of SPP worker ogawa.yasufumi
2019-05-08 2:01 ` [spp] [PATCH 14/17] shared/sec: rename func for getting port ID ogawa.yasufumi
2019-05-08 2:01 ` [spp] [PATCH 15/17] shared/sec: rename dpdk_port attr ogawa.yasufumi
2019-05-08 2:01 ` ogawa.yasufumi [this message]
2019-05-08 2:01 ` [spp] [PATCH 17/17] shared/sec: rename func for parsing request 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=1557280895-7978-17-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).