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 functions start with uninit
Date: Fri,  2 Aug 2019 18:36:36 +0900	[thread overview]
Message-ID: <20190802093636.14223-1-yasufum.o@gmail.com> (raw)

Functions have prefix `uninit_` are defined to set a structs with 0 to
clear, and different meaning to uninitialization. This update is to
correct the meaning.

This update also is to remove uninit_component_info() from shared lib
because it was changed to be called only from `classifier.c`.

Signed-off-by: Yasufumi Ogawa <yasufum.o@gmail.com>
---
 src/shared/secondary/spp_worker_th/vf_deps.h |  2 --
 src/vf/classifier.c                          | 30 ++++++++++----------
 2 files changed, 15 insertions(+), 17 deletions(-)

diff --git a/src/shared/secondary/spp_worker_th/vf_deps.h b/src/shared/secondary/spp_worker_th/vf_deps.h
index 35fb356..a73329b 100644
--- a/src/shared/secondary/spp_worker_th/vf_deps.h
+++ b/src/shared/secondary/spp_worker_th/vf_deps.h
@@ -85,8 +85,6 @@ int update_forwarder(struct sppwk_comp_info *wk_comp_info);
 
 void init_classifier_info(int component_id);
 
-void uninit_component_info(struct cls_comp_info *cmp_info);
-
 /**
  * Activate temporarily stored component info while flushing.
  *
diff --git a/src/vf/classifier.c b/src/vf/classifier.c
index cadd03e..efaecb9 100644
--- a/src/vf/classifier.c
+++ b/src/vf/classifier.c
@@ -69,16 +69,26 @@ struct cls_mng_info {
 /* classifier information per lcore */
 struct cls_mng_info cls_mng_info_list[RTE_MAX_LCORE];
 
+/* uninitialize classifier information. */
+static void
+clean_component_info(struct cls_comp_info *comp_info)
+{
+	int i;
+	for (i = 0; i < NOF_VLAN; ++i)
+		free_mac_classifier(comp_info->mac_clfs[i]);
+	memset(comp_info, 0, sizeof(struct cls_comp_info));
+}
+
 /* uninitialize classifier. */
 static void
-uninit_classifier(struct cls_mng_info *mng_info)
+clean_classifier(struct cls_mng_info *mng_info)
 {
 	int i;
 
 	mng_info->is_used = 0;
 
 	for (i = 0; i < TWO_SIDES; ++i)
-		uninit_component_info(mng_info->cmp_infos + (long)i);
+		clean_component_info(mng_info->cmp_infos + (long)i);
 
 	memset(mng_info, 0, sizeof(struct cls_mng_info));
 }
@@ -90,7 +100,7 @@ init_classifier_info(int comp_id)
 	struct cls_mng_info *mng_info = NULL;
 
 	mng_info = cls_mng_info_list + comp_id;
-	uninit_classifier(mng_info);
+	clean_classifier(mng_info);
 }
 
 /**
@@ -429,16 +439,6 @@ init_component_info(struct cls_comp_info *cmp_info,
 	return SPPWK_RET_OK;
 }
 
-/* uninitialize classifier information. */
-void
-uninit_component_info(struct cls_comp_info *comp_info)
-{
-	int i;
-	for (i = 0; i < NOF_VLAN; ++i)
-		free_mac_classifier(comp_info->mac_clfs[i]);
-	memset(comp_info, 0, sizeof(struct cls_comp_info));
-}
-
 /* transmit packet to one destination. */
 static inline void
 transmit_packets(struct cls_port_info *clsd_data)
@@ -722,8 +722,8 @@ update_classifier(struct sppwk_comp_info *wk_comp_info)
 			mng_info->upd_index))
 		rte_delay_us_block(SPPWK_UPDATE_INTERVAL);
 
-	/* uninitialize old */
-	uninit_component_info(mng_info->cmp_infos + mng_info->upd_index);
+	/* Clean old one. */
+	clean_component_info(mng_info->cmp_infos + mng_info->upd_index);
 
 	RTE_LOG(INFO, SPP_CLASSIFIER_MAC,
 			"Done update classifier, id=%u.\n", wk_id);
-- 
2.17.1


                 reply	other threads:[~2019-08-02  9:36 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=20190802093636.14223-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).