Soft Patch Panel
 help / color / mirror / Atom feed
* [spp] [PATCH] shared/sec: add ifdef switch for deps headers
@ 2019-06-24  6:22 yasufum.o
  0 siblings, 0 replies; only message in thread
From: yasufum.o @ 2019-06-24  6:22 UTC (permalink / raw)
  To: spp, ferruh.yigit, yasufum.o

From: Yasufumi Ogawa <yasufum.o@gmail.com>

This update is to switch `vf_deps.h` and `mirror_deps.h` in shared dir
for compiling each of worker processes.

Signed-off-by: Yasufumi Ogawa <yasufum.o@gmail.com>
---
 src/shared/secondary/spp_worker_th/cmd_parser.c    |  8 +++++++-
 .../secondary/spp_worker_th/cmd_res_formatter.c    |  8 +++++++-
 src/shared/secondary/spp_worker_th/cmd_runner.c    | 14 ++++++++++----
 src/shared/secondary/spp_worker_th/cmd_utils.c     | 10 ++++++++--
 src/shared/secondary/spp_worker_th/vf_deps.h       |  1 +
 5 files changed, 33 insertions(+), 8 deletions(-)

diff --git a/src/shared/secondary/spp_worker_th/cmd_parser.c b/src/shared/secondary/spp_worker_th/cmd_parser.c
index fcec28b..5a2fb82 100644
--- a/src/shared/secondary/spp_worker_th/cmd_parser.c
+++ b/src/shared/secondary/spp_worker_th/cmd_parser.c
@@ -10,9 +10,15 @@
 #include <rte_branch_prediction.h>
 
 #include "cmd_parser.h"
+#include "shared/secondary/return_codes.h"
+
+#ifdef SPP_VF_MODULE
 #include "vf_deps.h"
+#endif
+
+#ifdef SPP_MIRROR_MODULE
 #include "mirror_deps.h"
-#include "shared/secondary/return_codes.h"
+#endif
 
 #define RTE_LOGTYPE_WK_CMD_PARSER RTE_LOGTYPE_USER1
 
diff --git a/src/shared/secondary/spp_worker_th/cmd_res_formatter.c b/src/shared/secondary/spp_worker_th/cmd_res_formatter.c
index bfe13e5..f389939 100644
--- a/src/shared/secondary/spp_worker_th/cmd_res_formatter.c
+++ b/src/shared/secondary/spp_worker_th/cmd_res_formatter.c
@@ -4,9 +4,15 @@
 
 #include "cmd_res_formatter.h"
 #include "cmd_utils.h"
+#include "shared/secondary/json_helper.h"
+
+#ifdef SPP_VF_MODULE
 #include "vf_deps.h"
+#endif
+
+#ifdef SPP_MIRROR_MODULE
 #include "mirror_deps.h"
-#include "shared/secondary/json_helper.h"
+#endif
 
 #define RTE_LOGTYPE_WK_CMD_RES_FMT RTE_LOGTYPE_USER1
 
diff --git a/src/shared/secondary/spp_worker_th/cmd_runner.c b/src/shared/secondary/spp_worker_th/cmd_runner.c
index 68436f3..3684a2c 100644
--- a/src/shared/secondary/spp_worker_th/cmd_runner.c
+++ b/src/shared/secondary/spp_worker_th/cmd_runner.c
@@ -9,14 +9,20 @@
 #include <rte_branch_prediction.h>
 
 #include "cmd_runner.h"
-#include "vf_deps.h"
-#include "mirror_deps.h"
 #include "spp_port.h"
-#include "shared/secondary/string_buffer.h"
-#include "shared/secondary/json_helper.h"
 #include "cmd_res_formatter.h"
 #include "conn_spp_ctl.h"
 #include "cmd_parser.h"
+#include "shared/secondary/string_buffer.h"
+#include "shared/secondary/json_helper.h"
+
+#ifdef SPP_VF_MODULE
+#include "vf_deps.h"
+#endif
+
+#ifdef SPP_MIRROR_MODULE
+#include "mirror_deps.h"
+#endif
 
 #define RTE_LOGTYPE_WK_CMD_RUNNER RTE_LOGTYPE_USER1
 
diff --git a/src/shared/secondary/spp_worker_th/cmd_utils.c b/src/shared/secondary/spp_worker_th/cmd_utils.c
index 5a089c6..e61f59c 100644
--- a/src/shared/secondary/spp_worker_th/cmd_utils.c
+++ b/src/shared/secondary/spp_worker_th/cmd_utils.c
@@ -11,12 +11,18 @@
 #include <rte_log.h>
 #include <rte_branch_prediction.h>
 
-#include "vf_deps.h"
-#include "mirror_deps.h"
 #include "shared/secondary/return_codes.h"
 #include "cmd_utils.h"
 #include "spp_port.h"
 
+#ifdef SPP_VF_MODULE
+#include "vf_deps.h"
+#endif
+
+#ifdef SPP_MIRROR_MODULE
+#include "mirror_deps.h"
+#endif
+
 #include "shared/secondary/add_port.h"
 #include "shared/secondary/utils.h"
 
diff --git a/src/shared/secondary/spp_worker_th/vf_deps.h b/src/shared/secondary/spp_worker_th/vf_deps.h
index 81fc18f..7d77e87 100644
--- a/src/shared/secondary/spp_worker_th/vf_deps.h
+++ b/src/shared/secondary/spp_worker_th/vf_deps.h
@@ -101,4 +101,5 @@ int add_classifier_table_val(
 int update_comp_info(struct sppwk_comp_info *p_comp_info, int *p_change_comp);
 
 enum sppwk_worker_type get_comp_type_from_str(const char *type_str);
+
 #endif  /* _SPPWK_TH_VF_DEPS_H_ */
-- 
2.17.1


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2019-06-24  6:22 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-24  6:22 [spp] [PATCH] shared/sec: add ifdef switch for deps headers yasufum.o

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