Soft Patch Panel
 help / color / mirror / Atom feed
From: Yasufumi Ogawa <yasufum.o@gmail.com>
To: spp@dpdk.org, ferruh.yigit@intel.com, yasufum.o@gmail.com
Subject: [spp] [PATCH] spp_vf: revise terms in names of vars and funcs
Date: Fri,  2 Aug 2019 18:35:22 +0900	[thread overview]
Message-ID: <20190802093522.13877-1-yasufum.o@gmail.com> (raw)

* Rename long struct name `spp_iterate_classifier_table_params` to
  `classifier_table_params`.

* Rename `element_proc`, a member in `classifier_table_params` for
  adding each of params to a status message, to `tbl_proc`.

Signed-off-by: Yasufumi Ogawa <yasufum.o@gmail.com>
---
 src/vf/classifier.c    | 28 ++++++++++++++--------------
 src/vf/classifier.h    | 16 ++++++++--------
 src/vf/vf_cmd_runner.c |  2 +-
 3 files changed, 23 insertions(+), 23 deletions(-)

diff --git a/src/vf/classifier.c b/src/vf/classifier.c
index b85dd79..e7991c6 100644
--- a/src/vf/classifier.c
+++ b/src/vf/classifier.c
@@ -804,7 +804,7 @@ classify_packets(int comp_id)
 /* classifier iterate component information */
 int
 get_classifier_status(unsigned int lcore_id, int id,
-		struct spp_iterate_core_params *params)
+		struct spp_iterate_core_params *lcore_params)
 {
 	int ret = SPPWK_RET_NG;
 	int i;
@@ -843,8 +843,8 @@ get_classifier_status(unsigned int lcore_id, int id,
 
 	/* Set the information with the function specified by the command. */
 	/* TODO(yasufum) rename `element_proc` */
-	ret = (*params->element_proc)(
-		params, lcore_id, cmp_info->name, SPPWK_TYPE_CLS_STR,
+	ret = (*lcore_params->element_proc)(
+		lcore_params, lcore_id, cmp_info->name, SPPWK_TYPE_CLS_STR,
 		nof_rx, rx_ports, nof_tx, tx_ports);
 	if (unlikely(ret != SPPWK_RET_OK))
 		return SPPWK_RET_NG;
@@ -858,7 +858,7 @@ get_classifier_status(unsigned int lcore_id, int id,
  */
 static void
 iterate_adding_mac_entry(
-		struct spp_iterate_classifier_table_params *params,
+		struct classifier_table_params *params,
 		uint16_t vid,
 		struct mac_classifier *mac_cls,
 		__rte_unused struct cls_comp_info *cmp_info,
@@ -886,10 +886,10 @@ iterate_adding_mac_entry(
 		LOG_ENT((long)mac_cls->default_cls_idx, vid,
 				SPPWK_TERM_DEFAULT, cmp_info, port_info);
 		/**
-		 * Append "default" entry. `element_proc` is a funciton
-		 * pointer to append_classifier_element_value().
+		 * Append "default" entry. `tbl_proc` is funciton pointer to
+		 * append_classifier_element_value().
 		 */
-		(*params->element_proc)(params, cls_type, vid,
+		(*params->tbl_proc)(params, cls_type, vid,
 				SPPWK_TERM_DEFAULT, &port);
 	}
 
@@ -909,10 +909,10 @@ iterate_adding_mac_entry(
 		LOG_ENT((long)data, vid, mac_addr_str, cmp_info, port_info);
 
 		/**
-		 * Append each entry of MAC address. `element_proc` is a
-		 * funciton pointer to append_classifier_element_value().
+		 * Append each entry of MAC address. `tbl_proc` is function
+		 * pointer to append_classifier_element_value().
 		 */
-		(*params->element_proc)(params, cls_type, vid,
+		(*params->tbl_proc)(params, cls_type, vid,
 				mac_addr_str, &port);
 	}
 }
@@ -923,7 +923,7 @@ iterate_adding_mac_entry(
  */
 int
 add_classifier_table_val(
-		struct spp_iterate_classifier_table_params *params)
+		struct classifier_table_params *params)
 {
 	int i, vlan_id;
 	struct cls_mng_info *mng_info;
@@ -957,7 +957,7 @@ add_classifier_table_val(
 /* Iterate classifier_table to create response to status command */
 static int
 _add_classifier_table(
-		struct spp_iterate_classifier_table_params *params)
+		struct classifier_table_params *params)
 {
 	int ret;
 
@@ -984,7 +984,7 @@ add_classifier_table(const char *name, char **output,
 		void *tmp __attribute__ ((unused)))
 {
 	int ret = SPPWK_RET_NG;
-	struct spp_iterate_classifier_table_params itr_params;
+	struct classifier_table_params itr_params;
 	char *tmp_buff = spp_strbuf_allocate(CMD_RES_BUF_INIT_SIZE);
 	if (unlikely(tmp_buff == NULL)) {
 		RTE_LOG(ERR, SPP_CLASSIFIER_MAC,
@@ -995,7 +995,7 @@ add_classifier_table(const char *name, char **output,
 	}
 
 	itr_params.output = tmp_buff;
-	itr_params.element_proc = append_classifier_element_value;
+	itr_params.tbl_proc = append_classifier_element_value;
 
 	ret = _add_classifier_table(&itr_params);
 	if (unlikely(ret != SPPWK_RET_OK)) {
diff --git a/src/vf/classifier.h b/src/vf/classifier.h
index 7b937ff..4f7786f 100644
--- a/src/vf/classifier.h
+++ b/src/vf/classifier.h
@@ -17,13 +17,13 @@
  * and determines which port to be transferred to incoming packets.
  */
 
-struct spp_iterate_classifier_table_params;
+struct classifier_table_params;
 /**
  * Define func to iterate classifier for showing status or so, as a member
- * member of struct `spp_iterate_classifier_table_params`.
+ * member of struct `classifier_table_params`.
  */
-typedef int (*spp_iterate_classifier_element_proc)(
-		struct spp_iterate_classifier_table_params *params,
+typedef int (*classifier_table_proc)(
+		struct classifier_table_params *params,
 		enum sppwk_cls_type cls_type,
 		int vid, const char *mac,
 		const struct sppwk_port_idx *port);
@@ -32,14 +32,14 @@ typedef int (*spp_iterate_classifier_element_proc)(
  * iterate classifier table parameters which is used when listing classifier
  * table content for status command or so.
  */
-struct spp_iterate_classifier_table_params {
+struct classifier_table_params {
 	void *output;  /* Buffer used for output */
 	/* The function for creating classifier table information */
-	spp_iterate_classifier_element_proc element_proc;
+	classifier_table_proc tbl_proc;
 };
 
 int append_classifier_element_value(
-		struct spp_iterate_classifier_table_params *params,
+		struct classifier_table_params *params,
 		enum sppwk_cls_type cls_type,
 		int vid, const char *mac,
 		const struct sppwk_port_idx *port);
@@ -51,7 +51,7 @@ int append_classifier_element_value(
  * @params[in] params Object which has pointer of operator func and attrs.
  */
 int add_classifier_table_val(
-		struct spp_iterate_classifier_table_params *params);
+		struct classifier_table_params *params);
 
 int add_classifier_table(const char *name, char **output,
 		void *tmp __attribute__ ((unused)));
diff --git a/src/vf/vf_cmd_runner.c b/src/vf/vf_cmd_runner.c
index 8aaed67..0151f6e 100644
--- a/src/vf/vf_cmd_runner.c
+++ b/src/vf/vf_cmd_runner.c
@@ -556,7 +556,7 @@ update_comp_info(struct sppwk_comp_info *p_comp_info, int *p_change_comp)
  */
 int
 append_classifier_element_value(
-		struct spp_iterate_classifier_table_params *params,
+		struct classifier_table_params *params,
 		enum sppwk_cls_type cls_type,
 		int vid, const char *mac,
 		const struct sppwk_port_idx *port)
-- 
2.17.1


                 reply	other threads:[~2019-08-02  9:35 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20190802093522.13877-1-yasufum.o@gmail.com \
    --to=yasufum.o@gmail.com \
    --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).