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 09/17] shared/sec: change struct of classier table attrs
Date: Wed,  8 May 2019 11:01:27 +0900	[thread overview]
Message-ID: <1557280895-7978-10-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>

For refactoring, change `spp_command_classifier_table` to
`sppwk_cls_cmd_attr`.

Signed-off-by: Yasufumi Ogawa <ogawa.yasufumi@lab.ntt.co.jp>
---
 .../secondary/spp_worker_th/cmd_parser.h      |  4 ++--
 .../secondary/spp_worker_th/command_dec.c     | 20 +++++++++----------
 .../secondary/spp_worker_th/command_proc.c    | 10 +++++-----
 3 files changed, 17 insertions(+), 17 deletions(-)

diff --git a/src/shared/secondary/spp_worker_th/cmd_parser.h b/src/shared/secondary/spp_worker_th/cmd_parser.h
index 5922654..db60499 100644
--- a/src/shared/secondary/spp_worker_th/cmd_parser.h
+++ b/src/shared/secondary/spp_worker_th/cmd_parser.h
@@ -73,7 +73,7 @@ enum sppwk_cmd_type {
 };
 
 /* `classifier_table` command specific parameters. */
-struct spp_command_classifier_table {
+struct sppwk_cls_cmd_attr {
 	enum sppwk_action wk_action;  /**< add or del */
 	enum spp_classifier_type type;  /**< currently only for mac */
 	int vid;  /**< VLAN ID  */
@@ -107,7 +107,7 @@ struct spp_command {
 	enum sppwk_cmd_type type; /**< command type */
 
 	union {  /**< command descriptors */
-		struct spp_command_classifier_table classifier_table;
+		struct sppwk_cls_cmd_attr cls_table;
 		struct spp_command_flush flush;
 		struct spp_command_component component;
 		struct spp_command_port port;
diff --git a/src/shared/secondary/spp_worker_th/command_dec.c b/src/shared/secondary/spp_worker_th/command_dec.c
index 7a65269..4316b10 100644
--- a/src/shared/secondary/spp_worker_th/command_dec.c
+++ b/src/shared/secondary/spp_worker_th/command_dec.c
@@ -705,7 +705,7 @@ decode_classifier_port_value(void *output, const char *arg_val,
 				int allow_override __attribute__ ((unused)))
 {
 	int ret = SPP_RET_OK;
-	struct spp_command_classifier_table *classifier_table = output;
+	struct sppwk_cls_cmd_attr *classifier_table = output;
 	struct spp_port_index tmp_port;
 	int64_t mac_addr = 0;
 
@@ -768,25 +768,25 @@ parameter_list[][SPPWK_MAX_PARAMS] = {
 		{
 			.name = "action",
 			.offset = offsetof(struct spp_command,
-					spec.classifier_table.wk_action),
+					spec.cls_table.wk_action),
 			.func = decode_classifier_action_value
 		},
 		{
 			.name = "type",
 			.offset = offsetof(struct spp_command,
-					spec.classifier_table.type),
+					spec.cls_table.type),
 			.func = decode_classifier_type_value
 		},
 		{
 			.name = "mac address",
 			.offset = offsetof(struct spp_command,
-					spec.classifier_table.mac),
+					spec.cls_table.mac),
 			.func = decode_mac_addr_str_value
 		},
 		{
 			.name = "port",
 			.offset = offsetof(struct spp_command,
-					spec.classifier_table),
+					spec.cls_table),
 			.func = decode_classifier_port_value
 		},
 		DECODE_PARAMETER_LIST_EMPTY,
@@ -795,31 +795,31 @@ parameter_list[][SPPWK_MAX_PARAMS] = {
 		{
 			.name = "action",
 			.offset = offsetof(struct spp_command,
-					spec.classifier_table.wk_action),
+					spec.cls_table.wk_action),
 			.func = decode_classifier_action_value
 		},
 		{
 			.name = "type",
 			.offset = offsetof(struct spp_command,
-					spec.classifier_table.type),
+					spec.cls_table.type),
 			.func = decode_classifier_type_value
 		},
 		{
 			.name = "vlan id",
 			.offset = offsetof(struct spp_command,
-					spec.classifier_table.vid),
+					spec.cls_table.vid),
 			.func = decode_classifier_vid_value
 		},
 		{
 			.name = "mac address",
 			.offset = offsetof(struct spp_command,
-					spec.classifier_table.mac),
+					spec.cls_table.mac),
 			.func = decode_mac_addr_str_value
 		},
 		{
 			.name = "port",
 			.offset = offsetof(struct spp_command,
-					spec.classifier_table),
+					spec.cls_table),
 			.func = decode_classifier_port_value
 		},
 		DECODE_PARAMETER_LIST_EMPTY,
diff --git a/src/shared/secondary/spp_worker_th/command_proc.c b/src/shared/secondary/spp_worker_th/command_proc.c
index 5ae34d0..c5b1273 100644
--- a/src/shared/secondary/spp_worker_th/command_proc.c
+++ b/src/shared/secondary/spp_worker_th/command_proc.c
@@ -744,11 +744,11 @@ execute_command(const struct spp_command *command)
 		RTE_LOG(INFO, SPP_COMMAND_PROC,
 				"Execute classifier_table command.\n");
 		ret = spp_update_classifier_table(
-				command->spec.classifier_table.wk_action,
-				command->spec.classifier_table.type,
-				command->spec.classifier_table.vid,
-				command->spec.classifier_table.mac,
-				&command->spec.classifier_table.port);
+				command->spec.cls_table.wk_action,
+				command->spec.cls_table.type,
+				command->spec.cls_table.vid,
+				command->spec.cls_table.mac,
+				&command->spec.cls_table.port);
 		if (ret == 0) {
 			RTE_LOG(INFO, SPP_COMMAND_PROC,
 					"Execute flush.\n");
-- 
2.17.1


  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 ` ogawa.yasufumi [this message]
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 ` [spp] [PATCH 16/17] shared/sec: rename struct for command request ogawa.yasufumi
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-10-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).