Soft Patch Panel
 help / color / mirror / Atom feed
* [spp] [PATCH 0/4] Move vf/common to under shared directory
@ 2019-05-08  2:00 ogawa.yasufumi
  2019-05-08  2:00 ` [spp] [PATCH 1/4] spp_vf: move common of vf siblings to shared dir ogawa.yasufumi
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: ogawa.yasufumi @ 2019-05-08  2:00 UTC (permalink / raw)
  To: spp, ferruh.yigit, ogawa.yasufumi

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

Spp_vf and its siblings use common libs `srv/vf/common`. However, it is
not good design considering conventions, but should be placed
`src/shared` in the case of SPP. In addition, codes of spp_vf siblings
are not neat and tightly coupled and many of functions in `vf/common`
uses spp_vf siblings and vice versa.

This series of patches is to fix the issue by moving common libs to
under `src/shared` and remove dependency referring from common
functions to each of siblings. However, some of functions used specific
sibling, which are not common actually, are still remained as
`src/shared/secondary/spp_worker_th/vf_deps.h`
because of too much complexity of data structure and functions. This
`vf_deps.h` is released in next update, but will be removed from shared
dir in a future update for refactoring.

Yasufumi Ogawa (4):
  spp_vf: move common of vf siblings to shared dir
  spp_vf: update makefile for moved common files
  spp_vf: update include paths
  spp_vf: remove dependency from common functions

 .../secondary/spp_worker_th}/command_conn.c   |   0
 .../secondary/spp_worker_th}/command_conn.h   |   0
 .../secondary/spp_worker_th}/command_dec.c    |   0
 .../secondary/spp_worker_th}/command_dec.h    |   0
 .../secondary/spp_worker_th}/command_proc.c   |  37 +++++-
 .../secondary/spp_worker_th}/command_proc.h   |   0
 .../spp_worker_th}/ringlatencystats.c         |   0
 .../spp_worker_th}/ringlatencystats.h         |   0
 .../secondary/spp_worker_th}/spp_port.c       |   0
 .../secondary/spp_worker_th}/spp_port.h       |   0
 .../secondary/spp_worker_th}/spp_proc.c       |   5 +-
 .../secondary/spp_worker_th}/spp_proc.h       |   0
 .../secondary/spp_worker_th}/string_buffer.c  |   0
 .../secondary/spp_worker_th}/string_buffer.h  |   0
 src/vf/Makefile                               |  15 ++-
 src/vf/classifier_mac.c                       | 121 +-----------------
 src/vf/classifier_mac.h                       |  32 -----
 src/vf/spp_forward.c                          |   3 +-
 src/vf/spp_forward.h                          |  30 -----
 src/vf/spp_vf.c                               |   8 +-
 20 files changed, 54 insertions(+), 197 deletions(-)
 rename src/{vf/common => shared/secondary/spp_worker_th}/command_conn.c (100%)
 rename src/{vf/common => shared/secondary/spp_worker_th}/command_conn.h (100%)
 rename src/{vf/common => shared/secondary/spp_worker_th}/command_dec.c (100%)
 rename src/{vf/common => shared/secondary/spp_worker_th}/command_dec.h (100%)
 rename src/{vf/common => shared/secondary/spp_worker_th}/command_proc.c (98%)
 rename src/{vf/common => shared/secondary/spp_worker_th}/command_proc.h (100%)
 rename src/{vf/common => shared/secondary/spp_worker_th}/ringlatencystats.c (100%)
 rename src/{vf/common => shared/secondary/spp_worker_th}/ringlatencystats.h (100%)
 rename src/{vf/common => shared/secondary/spp_worker_th}/spp_port.c (100%)
 rename src/{vf/common => shared/secondary/spp_worker_th}/spp_port.h (100%)
 rename src/{vf/common => shared/secondary/spp_worker_th}/spp_proc.c (99%)
 rename src/{vf/common => shared/secondary/spp_worker_th}/spp_proc.h (100%)
 rename src/{vf/common => shared/secondary/spp_worker_th}/string_buffer.c (100%)
 rename src/{vf/common => shared/secondary/spp_worker_th}/string_buffer.h (100%)

-- 
2.17.1


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [spp] [PATCH 1/4] spp_vf: move common of vf siblings to shared dir
  2019-05-08  2:00 [spp] [PATCH 0/4] Move vf/common to under shared directory ogawa.yasufumi
@ 2019-05-08  2:00 ` ogawa.yasufumi
  2019-05-08  2:00 ` [spp] [PATCH 2/4] spp_vf: update makefile for moved common files ogawa.yasufumi
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: ogawa.yasufumi @ 2019-05-08  2:00 UTC (permalink / raw)
  To: spp, ferruh.yigit, ogawa.yasufumi

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

Common files of spp_vf and its siblings are located under
`src/vf/common/`, but it should be moved under `src/shared/` because
it is used by processes other than spp_vf. This update is to move
common files to `src/shared/secondary/spp_worker_th`. The directory name
means common files of worker threads of SPP secondary processes.

Signed-off-by: Yasufumi Ogawa <ogawa.yasufumi@lab.ntt.co.jp>
---
 src/{vf/common => shared/secondary/spp_worker_th}/command_conn.c  | 0
 src/{vf/common => shared/secondary/spp_worker_th}/command_conn.h  | 0
 src/{vf/common => shared/secondary/spp_worker_th}/command_dec.c   | 0
 src/{vf/common => shared/secondary/spp_worker_th}/command_dec.h   | 0
 src/{vf/common => shared/secondary/spp_worker_th}/command_proc.c  | 0
 src/{vf/common => shared/secondary/spp_worker_th}/command_proc.h  | 0
 .../common => shared/secondary/spp_worker_th}/ringlatencystats.c  | 0
 .../common => shared/secondary/spp_worker_th}/ringlatencystats.h  | 0
 src/{vf/common => shared/secondary/spp_worker_th}/spp_port.c      | 0
 src/{vf/common => shared/secondary/spp_worker_th}/spp_port.h      | 0
 src/{vf/common => shared/secondary/spp_worker_th}/spp_proc.c      | 0
 src/{vf/common => shared/secondary/spp_worker_th}/spp_proc.h      | 0
 src/{vf/common => shared/secondary/spp_worker_th}/string_buffer.c | 0
 src/{vf/common => shared/secondary/spp_worker_th}/string_buffer.h | 0
 14 files changed, 0 insertions(+), 0 deletions(-)
 rename src/{vf/common => shared/secondary/spp_worker_th}/command_conn.c (100%)
 rename src/{vf/common => shared/secondary/spp_worker_th}/command_conn.h (100%)
 rename src/{vf/common => shared/secondary/spp_worker_th}/command_dec.c (100%)
 rename src/{vf/common => shared/secondary/spp_worker_th}/command_dec.h (100%)
 rename src/{vf/common => shared/secondary/spp_worker_th}/command_proc.c (100%)
 rename src/{vf/common => shared/secondary/spp_worker_th}/command_proc.h (100%)
 rename src/{vf/common => shared/secondary/spp_worker_th}/ringlatencystats.c (100%)
 rename src/{vf/common => shared/secondary/spp_worker_th}/ringlatencystats.h (100%)
 rename src/{vf/common => shared/secondary/spp_worker_th}/spp_port.c (100%)
 rename src/{vf/common => shared/secondary/spp_worker_th}/spp_port.h (100%)
 rename src/{vf/common => shared/secondary/spp_worker_th}/spp_proc.c (100%)
 rename src/{vf/common => shared/secondary/spp_worker_th}/spp_proc.h (100%)
 rename src/{vf/common => shared/secondary/spp_worker_th}/string_buffer.c (100%)
 rename src/{vf/common => shared/secondary/spp_worker_th}/string_buffer.h (100%)

diff --git a/src/vf/common/command_conn.c b/src/shared/secondary/spp_worker_th/command_conn.c
similarity index 100%
rename from src/vf/common/command_conn.c
rename to src/shared/secondary/spp_worker_th/command_conn.c
diff --git a/src/vf/common/command_conn.h b/src/shared/secondary/spp_worker_th/command_conn.h
similarity index 100%
rename from src/vf/common/command_conn.h
rename to src/shared/secondary/spp_worker_th/command_conn.h
diff --git a/src/vf/common/command_dec.c b/src/shared/secondary/spp_worker_th/command_dec.c
similarity index 100%
rename from src/vf/common/command_dec.c
rename to src/shared/secondary/spp_worker_th/command_dec.c
diff --git a/src/vf/common/command_dec.h b/src/shared/secondary/spp_worker_th/command_dec.h
similarity index 100%
rename from src/vf/common/command_dec.h
rename to src/shared/secondary/spp_worker_th/command_dec.h
diff --git a/src/vf/common/command_proc.c b/src/shared/secondary/spp_worker_th/command_proc.c
similarity index 100%
rename from src/vf/common/command_proc.c
rename to src/shared/secondary/spp_worker_th/command_proc.c
diff --git a/src/vf/common/command_proc.h b/src/shared/secondary/spp_worker_th/command_proc.h
similarity index 100%
rename from src/vf/common/command_proc.h
rename to src/shared/secondary/spp_worker_th/command_proc.h
diff --git a/src/vf/common/ringlatencystats.c b/src/shared/secondary/spp_worker_th/ringlatencystats.c
similarity index 100%
rename from src/vf/common/ringlatencystats.c
rename to src/shared/secondary/spp_worker_th/ringlatencystats.c
diff --git a/src/vf/common/ringlatencystats.h b/src/shared/secondary/spp_worker_th/ringlatencystats.h
similarity index 100%
rename from src/vf/common/ringlatencystats.h
rename to src/shared/secondary/spp_worker_th/ringlatencystats.h
diff --git a/src/vf/common/spp_port.c b/src/shared/secondary/spp_worker_th/spp_port.c
similarity index 100%
rename from src/vf/common/spp_port.c
rename to src/shared/secondary/spp_worker_th/spp_port.c
diff --git a/src/vf/common/spp_port.h b/src/shared/secondary/spp_worker_th/spp_port.h
similarity index 100%
rename from src/vf/common/spp_port.h
rename to src/shared/secondary/spp_worker_th/spp_port.h
diff --git a/src/vf/common/spp_proc.c b/src/shared/secondary/spp_worker_th/spp_proc.c
similarity index 100%
rename from src/vf/common/spp_proc.c
rename to src/shared/secondary/spp_worker_th/spp_proc.c
diff --git a/src/vf/common/spp_proc.h b/src/shared/secondary/spp_worker_th/spp_proc.h
similarity index 100%
rename from src/vf/common/spp_proc.h
rename to src/shared/secondary/spp_worker_th/spp_proc.h
diff --git a/src/vf/common/string_buffer.c b/src/shared/secondary/spp_worker_th/string_buffer.c
similarity index 100%
rename from src/vf/common/string_buffer.c
rename to src/shared/secondary/spp_worker_th/string_buffer.c
diff --git a/src/vf/common/string_buffer.h b/src/shared/secondary/spp_worker_th/string_buffer.h
similarity index 100%
rename from src/vf/common/string_buffer.h
rename to src/shared/secondary/spp_worker_th/string_buffer.h
-- 
2.17.1


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [spp] [PATCH 2/4] spp_vf: update makefile for moved common files
  2019-05-08  2:00 [spp] [PATCH 0/4] Move vf/common to under shared directory ogawa.yasufumi
  2019-05-08  2:00 ` [spp] [PATCH 1/4] spp_vf: move common of vf siblings to shared dir ogawa.yasufumi
@ 2019-05-08  2:00 ` ogawa.yasufumi
  2019-05-08  2:00 ` [spp] [PATCH 3/4] spp_vf: update include paths ogawa.yasufumi
  2019-05-08  2:00 ` [spp] [PATCH 4/4] spp_vf: remove dependency from common functions ogawa.yasufumi
  3 siblings, 0 replies; 5+ messages in thread
From: ogawa.yasufumi @ 2019-05-08  2:00 UTC (permalink / raw)
  To: spp, ferruh.yigit, ogawa.yasufumi

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

As common files are moved from `src/vf/common`, update include and
source paths.

Signed-off-by: Yasufumi Ogawa <ogawa.yasufumi@lab.ntt.co.jp>
---
 src/vf/Makefile | 15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)

diff --git a/src/vf/Makefile b/src/vf/Makefile
index 03c668f..a8b60fb 100644
--- a/src/vf/Makefile
+++ b/src/vf/Makefile
@@ -11,19 +11,26 @@ include $(RTE_SDK)/mk/rte.vars.mk
 # binary name
 APP = spp_vf
 
+SPP_WKT_DIR = ../shared/secondary/spp_worker_th
+
 # all source are stored in SRCS-y
 SRCS-y := spp_vf.c classifier_mac.c spp_forward.c
-SRCS-y += common/string_buffer.c common/ringlatencystats.c common/spp_port.c
-SRCS-y += common/command_conn.c common/command_dec.c common/command_proc.c
-SRCS-y += common/spp_proc.c
+SRCS-y += $(SPP_WKT_DIR)/string_buffer.c
+SRCS-y += $(SPP_WKT_DIR)/ringlatencystats.c
+SRCS-y += $(SPP_WKT_DIR)/spp_port.c
+SRCS-y += $(SPP_WKT_DIR)/command_conn.c
+SRCS-y += $(SPP_WKT_DIR)/command_dec.c
+SRCS-y += $(SPP_WKT_DIR)/command_proc.c
+SRCS-y += $(SPP_WKT_DIR)/spp_proc.c
 SRCS-y += ../shared/common.c
 SRCS-y += ../shared/secondary/utils.c ../shared/secondary/add_port.c
 
 CFLAGS += -DALLOW_EXPERIMENTAL_API
 CFLAGS += $(WERROR_FLAGS) -O3 -MMD
 CFLAGS += -I$(SRCDIR)/../
-CFLAGS += -I$(SRCDIR)/common
 CFLAGS += -DSPP_VF_MODULE
+
+# Optional Settings
 #CFLAGS += -DSPP_DEMONIZE
 #CFLAGS += -DSPP_RINGLATENCYSTATS_ENABLE
 
-- 
2.17.1


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [spp] [PATCH 3/4] spp_vf: update include paths
  2019-05-08  2:00 [spp] [PATCH 0/4] Move vf/common to under shared directory ogawa.yasufumi
  2019-05-08  2:00 ` [spp] [PATCH 1/4] spp_vf: move common of vf siblings to shared dir ogawa.yasufumi
  2019-05-08  2:00 ` [spp] [PATCH 2/4] spp_vf: update makefile for moved common files ogawa.yasufumi
@ 2019-05-08  2:00 ` ogawa.yasufumi
  2019-05-08  2:00 ` [spp] [PATCH 4/4] spp_vf: remove dependency from common functions ogawa.yasufumi
  3 siblings, 0 replies; 5+ messages in thread
From: ogawa.yasufumi @ 2019-05-08  2:00 UTC (permalink / raw)
  To: spp, ferruh.yigit, ogawa.yasufumi

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

As common files are moved from `src/vf/common`, upadte include paths in
following files.

* src/vf/classifier_mac.c
* src/vf/spp_forward.c
* src/vf/spp_vf.c

Signed-off-by: Yasufumi Ogawa <ogawa.yasufumi@lab.ntt.co.jp>
---
 src/vf/classifier_mac.c | 2 +-
 src/vf/spp_forward.c    | 2 +-
 src/vf/spp_vf.c         | 8 ++++----
 3 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/src/vf/classifier_mac.c b/src/vf/classifier_mac.c
index f8f06fa..f599731 100644
--- a/src/vf/classifier_mac.c
+++ b/src/vf/classifier_mac.c
@@ -22,8 +22,8 @@
 #include <rte_launch.h>
 #include <rte_hash.h>
 
+#include "shared/secondary/spp_worker_th/spp_port.h"
 #include "spp_vf.h"
-#include "spp_port.h"
 #include "classifier_mac.h"
 
 #define RTE_LOGTYPE_SPP_CLASSIFIER_MAC RTE_LOGTYPE_USER1
diff --git a/src/vf/spp_forward.c b/src/vf/spp_forward.c
index 2dbb171..8aaee80 100644
--- a/src/vf/spp_forward.c
+++ b/src/vf/spp_forward.c
@@ -4,8 +4,8 @@
 
 #include <rte_cycles.h>
 
+#include "shared/secondary/spp_worker_th/spp_port.h"
 #include "spp_vf.h"
-#include "spp_port.h"
 #include "spp_forward.h"
 
 #define RTE_LOGTYPE_FORWARD RTE_LOGTYPE_USER1
diff --git a/src/vf/spp_vf.c b/src/vf/spp_vf.c
index aa60bec..b2acb58 100644
--- a/src/vf/spp_vf.c
+++ b/src/vf/spp_vf.c
@@ -6,13 +6,13 @@
 #include <arpa/inet.h>
 #include <getopt.h>
 
-#include "spp_proc.h"
+#include "shared/secondary/spp_worker_th/spp_proc.h"
 #include "spp_vf.h"
 #include "classifier_mac.h"
 #include "spp_forward.h"
-#include "command_proc.h"
-#include "command_dec.h"
-#include "spp_port.h"
+#include "shared/secondary/spp_worker_th/command_proc.h"
+#include "shared/secondary/spp_worker_th/command_dec.h"
+#include "shared/secondary/spp_worker_th/spp_port.h"
 
 /* Declare global variables */
 /* Logical core ID for main process */
-- 
2.17.1


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [spp] [PATCH 4/4] spp_vf: remove dependency from common functions
  2019-05-08  2:00 [spp] [PATCH 0/4] Move vf/common to under shared directory ogawa.yasufumi
                   ` (2 preceding siblings ...)
  2019-05-08  2:00 ` [spp] [PATCH 3/4] spp_vf: update include paths ogawa.yasufumi
@ 2019-05-08  2:00 ` ogawa.yasufumi
  3 siblings, 0 replies; 5+ messages in thread
From: ogawa.yasufumi @ 2019-05-08  2:00 UTC (permalink / raw)
  To: spp, ferruh.yigit, ogawa.yasufumi

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

Some of functions in `src/shared` depend on spp_vf's functions under
`src/vf`, it means these common functions are not common actually. This
update is to resolve the issue by moving vars and functions referred
by common functions from under `src/vf` to
`src/shared/secondary/spp_worker_th/vf_deps.h` as utils functions.

By this update, common functions do not depend on spp_vf, but some of
static vars and functions are changed to not static. It might cause some
slightly performance degradation possibly, but should be required to
avoid to be spaghetti code.

Signed-off-by: Yasufumi Ogawa <ogawa.yasufumi@lab.ntt.co.jp>
---
 .../secondary/spp_worker_th/command_proc.c    |  37 +++++-
 src/shared/secondary/spp_worker_th/spp_proc.c |   5 +-
 src/vf/classifier_mac.c                       | 119 +-----------------
 src/vf/classifier_mac.h                       |  32 -----
 src/vf/spp_forward.c                          |   1 +
 src/vf/spp_forward.h                          |  30 -----
 6 files changed, 37 insertions(+), 187 deletions(-)

diff --git a/src/shared/secondary/spp_worker_th/command_proc.c b/src/shared/secondary/spp_worker_th/command_proc.c
index 813e95f..2fc1829 100644
--- a/src/shared/secondary/spp_worker_th/command_proc.c
+++ b/src/shared/secondary/spp_worker_th/command_proc.c
@@ -8,15 +8,14 @@
 #include <rte_log.h>
 #include <rte_branch_prediction.h>
 
+#include "vf_deps.h"
 #include "spp_port.h"
 #include "string_buffer.h"
-#ifdef SPP_VF_MODULE
-#include "../classifier_mac.h"
-#include "../spp_forward.h"
-#endif /* SPP_VF_MODULE */
+
 #ifdef SPP_MIRROR_MODULE
 #include "../../mirror/spp_mirror.h"
 #endif /* SPP_MIRROR_MODULE */
+
 #include "command_conn.h"
 #include "command_dec.h"
 #include "command_proc.h"
@@ -103,6 +102,30 @@ const char *CLASSIFILER_TYPE_STATUS_STRINGS[] = {
 	/* termination */ "",
 };
 
+/* uninitialize classifier. */
+static void
+uninit_classifier(struct management_info *mng_info)
+{
+	int i;
+
+	mng_info->is_used = 0;
+
+	for (i = 0; i < NUM_CLASSIFIER_MAC_INFO; ++i)
+		uninit_component_info(mng_info->cmp_infos + (long)i);
+
+	memset(mng_info, 0, sizeof(struct management_info));
+}
+
+/* initialize classifier information. */
+void
+init_classifier_info(int component_id)
+{
+	struct management_info *mng_info = NULL;
+
+	mng_info = g_mng_infos + component_id;
+	uninit_classifier(mng_info);
+}
+
 /* get client id */
 static int
 spp_get_client_id(void)
@@ -1403,7 +1426,11 @@ struct command_response_list response_result_list[] = {
 	COMMAND_RESP_TAG_LIST_EMPTY
 };
 
-/* TODO(yasufum) add desc why it is needed and how to be used */
+/**
+ * TODO(yasufum) Add desc why it is needed and how to be used. At least, func
+ * name is not appropriate because not for reponse, but name of funcs returns
+ * response.
+ */
 /* command response status information string list */
 struct command_response_list response_info_list[] = {
 	{ "client-id",        append_client_id_value },
diff --git a/src/shared/secondary/spp_worker_th/spp_proc.c b/src/shared/secondary/spp_worker_th/spp_proc.c
index b7c3ec5..8009527 100644
--- a/src/shared/secondary/spp_worker_th/spp_proc.c
+++ b/src/shared/secondary/spp_worker_th/spp_proc.c
@@ -11,16 +11,13 @@
 #include <rte_log.h>
 #include <rte_branch_prediction.h>
 
+#include "vf_deps.h"
 #include "spp_proc.h"
 #include "spp_port.h"
 
 #include "shared/secondary/add_port.h"
 #include "shared/secondary/utils.h"
 
-#ifdef SPP_VF_MODULE
-#include "../spp_forward.h"
-#include "../classifier_mac.h"
-#endif /* SPP_VF_MODULE */
 #ifdef SPP_MIRROR_MODULE
 #include "../../mirror/spp_mirror.h"
 #endif /* SPP_MIRROR_MODULE */
diff --git a/src/vf/classifier_mac.c b/src/vf/classifier_mac.c
index f599731..a7ccd78 100644
--- a/src/vf/classifier_mac.c
+++ b/src/vf/classifier_mac.c
@@ -13,15 +13,14 @@
 #include <rte_mbuf.h>
 #include <rte_log.h>
 #include <rte_cycles.h>
-#include <rte_malloc.h>
 #include <rte_memcpy.h>
 #include <rte_random.h>
 #include <rte_byteorder.h>
 #include <rte_per_lcore.h>
 #include <rte_eal.h>
 #include <rte_launch.h>
-#include <rte_hash.h>
 
+#include "shared/secondary/spp_worker_th/vf_deps.h"
 #include "shared/secondary/spp_worker_th/spp_port.h"
 #include "spp_vf.h"
 #include "classifier_mac.h"
@@ -39,9 +38,6 @@
 /* number of classifier mac table entry */
 #define NUM_CLASSIFIER_MAC_TABLE_ENTRY 128
 
-/* number of classifier information (reference/update) */
-#define NUM_CLASSIFIER_MAC_INFO 2
-
 /* interval that wait until change update index (micro second) */
 #define CHANGE_UPDATE_INDEX_WAIT_INTERVAL SPP_CHANGE_UPDATE_INTERVAL
 
@@ -71,80 +67,8 @@ static const size_t HASH_TABLE_NAME_BUF_SZ =
 static const size_t ETHER_ADDR_STR_BUF_SZ =
 		ETHER_ADDR_LEN * 2 + (ETHER_ADDR_LEN - 1) + 1;
 
-/* classified data (destination port, target packets, etc) */
-struct classified_data {
-	/* interface type (see "enum port_type") */
-	enum port_type  iface_type;
-
-	/* index of ports handled by classifier */
-	int             iface_no;
-
-	/* id for interface generated by spp_vf */
-	int             iface_no_global;
-
-	/* port id generated by DPDK */
-	uint16_t        port;
-
-	/* the number of packets in pkts[] */
-	uint16_t        num_pkt;
-
-	/* packet array to be classified */
-	struct rte_mbuf *pkts[MAX_PKT_BURST];
-};
-
-/* mac address classification */
-struct mac_classification {
-	/* hash table keeps classification */
-	struct rte_hash *classification_tab;
-
-	/* number of valid classification */
-	int num_active_classified;
-
-	/* index of valid classification */
-	int active_classifieds[RTE_MAX_ETHPORTS];
-
-	/* index of default classification */
-	int default_classified;
-};
-
-/* classifier component information */
-struct component_info {
-	/* component name */
-	char name[SPP_NAME_STR_LEN];
-
-	/* mac address entry flag */
-	int mac_addr_entry;
-
-	/* mac address classification per vlan-id */
-	struct mac_classification *mac_classifications[SPP_NUM_VLAN_VID];
-
-	/* number of transmission ports */
-	int n_classified_data_tx;
-
-	/* receive port handled by classifier */
-	struct classified_data classified_data_rx;
-
-	/* transmission ports handled by classifier */
-	struct classified_data classified_data_tx[RTE_MAX_ETHPORTS];
-};
-
-/* classifier management information */
-struct management_info {
-	/* classifier information */
-	struct component_info cmp_infos[NUM_CLASSIFIER_MAC_INFO];
-
-	/* Reference index number for classifier information */
-	volatile int ref_index;
-
-	/* Update index number for classifier information */
-	volatile int upd_index;
-
-	/* used flag */
-	volatile int is_used;
-};
-
 /* classifier information per lcore */
-static struct management_info g_mng_infos[RTE_MAX_LCORE];
+struct management_info g_mng_infos[RTE_MAX_LCORE];
 
 /**
  * Hash table count used for making a name of hash table
@@ -469,21 +393,8 @@ init_component_info(struct component_info *cmp_info,
 	return SPP_RET_OK;
 }
 
-/* free mac classification instance. */
-static inline void
-free_mac_classification(struct mac_classification *mac_cls)
-{
-	if (mac_cls == NULL)
-		return;
-
-	if (mac_cls->classification_tab != NULL)
-		rte_hash_free(mac_cls->classification_tab);
-
-	rte_free(mac_cls);
-}
-
 /* uninitialize classifier information. */
-static void
+void
 uninit_component_info(struct component_info *cmp_info)
 {
 	int i;
@@ -494,20 +405,6 @@ uninit_component_info(struct component_info *cmp_info)
 	memset(cmp_info, 0, sizeof(struct component_info));
 }
 
-/* uninitialize classifier. */
-static void
-uninit_classifier(struct management_info *mng_info)
-{
-	int i;
-
-	mng_info->is_used = 0;
-
-	for (i = 0; i < NUM_CLASSIFIER_MAC_INFO; ++i)
-		uninit_component_info(mng_info->cmp_infos + (long)i);
-
-	memset(mng_info, 0, sizeof(struct management_info));
-}
-
 /* transmit packet to one destination. */
 static inline void
 transmit_packet(struct classified_data *clsd_data)
@@ -761,16 +658,6 @@ spp_classifier_mac_init(void)
 	return 0;
 }
 
-/* initialize classifier information. */
-void
-init_classifier_info(int component_id)
-{
-	struct management_info *mng_info = NULL;
-
-	mng_info = g_mng_infos + component_id;
-	uninit_classifier(mng_info);
-}
-
 /* classifier(mac address) update component info. */
 int
 spp_classifier_mac_update(struct spp_component_info *component_info)
diff --git a/src/vf/classifier_mac.h b/src/vf/classifier_mac.h
index 1671ff0..d3c5ab6 100644
--- a/src/vf/classifier_mac.h
+++ b/src/vf/classifier_mac.h
@@ -15,8 +15,6 @@
  * and determines which port to be transferred to incoming packets.
  */
 
-/* forward declaration */
-struct spp_component_info;
 struct spp_iterate_classifier_table_params;
 
 /**
@@ -36,17 +34,6 @@ int spp_classifier_mac_init(void);
  */
 void init_classifier_info(int component_id);
 
-/**
- * classifier(mac address) update component info.
- *
- * @param component_info
- *  The pointer to struct spp_component_info.@n
- *  The data for updating the internal data of classifier.
- *
- * @retval SPP_RET_OK succeeded.
- * @retval SPP_RET_NG failed.
- */
-int spp_classifier_mac_update(struct spp_component_info *component_info);
 
 /**
  * classifier(mac address) thread function.
@@ -59,25 +46,6 @@ int spp_classifier_mac_update(struct spp_component_info *component_info);
  */
 int spp_classifier_mac_do(int id);
 
-/**
- * classifier get component status.
- *
- *
- * @param lcore_id
- *  The logical core ID for classifier.
- * @param id
- *  The unique component ID.
- * @param params
- *  The pointer to struct spp_iterate_core_params.@n
- *  Detailed data of classifier status.
- *
- * @retval SPP_RET_OK succeeded.
- * @retval SPP_RET_NG failed.
- */
-int
-spp_classifier_get_component_status(unsigned int lcore_id, int id,
-		struct spp_iterate_core_params *params);
-
 /**
  * classifier(mac address) iterate classifier table.
  *
diff --git a/src/vf/spp_forward.c b/src/vf/spp_forward.c
index 8aaee80..053d7c9 100644
--- a/src/vf/spp_forward.c
+++ b/src/vf/spp_forward.c
@@ -4,6 +4,7 @@
 
 #include <rte_cycles.h>
 
+#include "shared/secondary/spp_worker_th/vf_deps.h"
 #include "shared/secondary/spp_worker_th/spp_port.h"
 #include "spp_vf.h"
 #include "spp_forward.h"
diff --git a/src/vf/spp_forward.h b/src/vf/spp_forward.h
index 14adb0c..4da083c 100644
--- a/src/vf/spp_forward.h
+++ b/src/vf/spp_forward.h
@@ -24,18 +24,6 @@
 /** Clear info */
 void spp_forward_init(void);
 
-/**
- * Update forward info
- *
- * @param component
- *  The pointer to struct spp_component_info.@n
- *  The data for updating the internal data of forwarder and merger.
- *
- * @retval SPP_RET_OK succeeded.
- * @retval SPP_RET_NG failed.
- */
-int spp_forward_update(struct spp_component_info *component);
-
 /**
  * Merge/Forward
  *
@@ -47,22 +35,4 @@ int spp_forward_update(struct spp_component_info *component);
  */
 int spp_forward(int id);
 
-/**
- * Merge/Forward get component status
- *
- * @param lcore_id
- *  The logical core ID for forwarder and merger.
- * @param id
- *  The unique component ID.
- * @param params
- *  The pointer to struct spp_iterate_core_params.@n
- *  Detailed data of forwarder/merger status.
- *
- * @retval SPP_RET_OK succeeded.
- * @retval SPP_RET_NG failed.
- */
-int spp_forward_get_component_status(
-		unsigned int lcore_id, int id,
-		struct spp_iterate_core_params *params);
-
 #endif /* __SPP_FORWARD_H__ */
-- 
2.17.1


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2019-05-08  2:02 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-08  2:00 [spp] [PATCH 0/4] Move vf/common to under shared directory ogawa.yasufumi
2019-05-08  2:00 ` [spp] [PATCH 1/4] spp_vf: move common of vf siblings to shared dir ogawa.yasufumi
2019-05-08  2:00 ` [spp] [PATCH 2/4] spp_vf: update makefile for moved common files ogawa.yasufumi
2019-05-08  2:00 ` [spp] [PATCH 3/4] spp_vf: update include paths ogawa.yasufumi
2019-05-08  2:00 ` [spp] [PATCH 4/4] spp_vf: remove dependency from common functions ogawa.yasufumi

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).