Soft Patch Panel
 help / color / mirror / Atom feed
From: yasufum.o@gmail.com
To: spp@dpdk.org, ferruh.yigit@intel.com, yasufum.o@gmail.com
Subject: [spp] [PATCH 06/13] shared/sec: revise including headers
Date: Mon, 24 Jun 2019 13:36:06 +0900	[thread overview]
Message-ID: <20190624043613.19271-7-yasufum.o@gmail.com> (raw)
In-Reply-To: <20190624043613.19271-1-yasufum.o@gmail.com>

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

Some of including headers in SPP secondary are roughly described in
header files, so dependency is not obvious in each of source code. This
update is to refactor this situation by revising where including header
files.

Signed-off-by: Yasufumi Ogawa <yasufum.o@gmail.com>
---
 src/mirror/Makefile                           |  4 +++
 src/mirror/spp_mirror.c                       |  3 ++-
 src/mirror/spp_mirror.h                       | 26 -------------------
 .../secondary/spp_worker_th/cmd_parser.c      |  1 +
 .../secondary/spp_worker_th/cmd_utils.c       |  4 ++-
 .../secondary/spp_worker_th/cmd_utils.h       |  4 +--
 .../secondary/spp_worker_th/conn_spp_ctl.c    |  1 +
 src/shared/secondary/spp_worker_th/spp_port.c |  1 +
 src/vf/classifier_mac.c                       |  6 +++--
 src/vf/spp_forward.c                          |  5 ++--
 src/vf/spp_vf.c                               |  3 ++-
 11 files changed, 23 insertions(+), 35 deletions(-)
 delete mode 100644 src/mirror/spp_mirror.h

diff --git a/src/mirror/Makefile b/src/mirror/Makefile
index b31e116..fc18d1e 100644
--- a/src/mirror/Makefile
+++ b/src/mirror/Makefile
@@ -32,6 +32,10 @@ CFLAGS += $(WERROR_FLAGS) -O3 -MMD
 CFLAGS += -I$(SRCDIR)/../
 CFLAGS += -DSPP_MIRROR_MODULE
 
+# There are two kinds of copy mode, deep copy and shallow copy. If this
+# `DSPP_MIRROR_SHALLOWCOPY` is commented out, spp_mirror runs as in
+# deep copy mode.
+# Default mode is shallow copy.
 CFLAGS += -DSPP_MIRROR_SHALLOWCOPY
 
 # Optional Settings
diff --git a/src/mirror/spp_mirror.c b/src/mirror/spp_mirror.c
index c2ec09d..c00cad6 100644
--- a/src/mirror/spp_mirror.c
+++ b/src/mirror/spp_mirror.c
@@ -9,9 +9,10 @@
 #include <rte_common.h>
 #include <rte_cycles.h>
 
-#include "shared/secondary/spp_worker_th/mirror_deps.h"
 #include "shared/common.h"
+#include "shared/secondary/return_codes.h"
 #include "shared/secondary/utils.h"
+#include "shared/secondary/spp_worker_th/mirror_deps.h"
 #include "shared/secondary/spp_worker_th/cmd_runner.h"
 #include "shared/secondary/spp_worker_th/cmd_parser.h"
 #include "shared/secondary/spp_worker_th/cmd_utils.h"
diff --git a/src/mirror/spp_mirror.h b/src/mirror/spp_mirror.h
deleted file mode 100644
index 17fa522..0000000
--- a/src/mirror/spp_mirror.h
+++ /dev/null
@@ -1,26 +0,0 @@
-/* SPDX-License-Identifier: BSD-3-Clause
- * Copyright(c) 2018 Nippon Telegraph and Telephone Corporation
- */
-
-#ifndef __SPP_MIRROR_H__
-#define __SPP_MIRROR_H__
-
-#include "shared/secondary/spp_worker_th/spp_proc.h"
-
-/**
- * @file
- * SPP_MIRROR main
- *
- * Main function of spp_mirror.
- * This provides the function for initializing and starting the threads.
- *
- * There is two kinds of reproduction classification. I choose it by a
- * compilation switch.
- *  -DeepCopy
- *  -ShallowCopy
- *
- * Attention
- *  I do not do the deletion of the VLAN tag, the addition.
- */
-
-#endif /* __SPP_MIRROR_H__ */
diff --git a/src/shared/secondary/spp_worker_th/cmd_parser.c b/src/shared/secondary/spp_worker_th/cmd_parser.c
index 13e7013..200e41b 100644
--- a/src/shared/secondary/spp_worker_th/cmd_parser.c
+++ b/src/shared/secondary/spp_worker_th/cmd_parser.c
@@ -10,6 +10,7 @@
 #include <rte_branch_prediction.h>
 
 #include "cmd_parser.h"
+#include "shared/secondary/return_codes.h"
 
 #define RTE_LOGTYPE_WK_CMD_PARSER 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 79dd2e7..098c8c1 100644
--- a/src/shared/secondary/spp_worker_th/cmd_utils.c
+++ b/src/shared/secondary/spp_worker_th/cmd_utils.c
@@ -2,8 +2,8 @@
  * Copyright(c) 2018-2019 Nippon Telegraph and Telephone Corporation
  */
 
-#include <unistd.h>
 #include <string.h>
+#include <unistd.h>
 
 #include <rte_eth_ring.h>
 #include <rte_eth_vhost.h>
@@ -13,12 +13,14 @@
 
 #include "vf_deps.h"
 #include "mirror_deps.h"
+#include "shared/secondary/return_codes.h"
 #include "cmd_utils.h"
 #include "spp_port.h"
 
 #include "shared/secondary/add_port.h"
 #include "shared/secondary/utils.h"
 
+
 /* TODO(yasufum) change log label after filename is revised. */
 #define RTE_LOGTYPE_APP RTE_LOGTYPE_USER1
 
diff --git a/src/shared/secondary/spp_worker_th/cmd_utils.h b/src/shared/secondary/spp_worker_th/cmd_utils.h
index 3ee3142..f9d7015 100644
--- a/src/shared/secondary/spp_worker_th/cmd_utils.h
+++ b/src/shared/secondary/spp_worker_th/cmd_utils.h
@@ -5,14 +5,14 @@
 #ifndef _SPPWK_CMD_UTILS_H_
 #define _SPPWK_CMD_UTILS_H_
 
+#include <netinet/in.h>
+
 /**
  * @file cmd_utils.h
  *
  * Command utility functions for SPP worker thread.
  */
 
-#include <netinet/in.h>
-#include "shared/secondary/return_codes.h"
 #include "shared/common.h"
 
 /**
diff --git a/src/shared/secondary/spp_worker_th/conn_spp_ctl.c b/src/shared/secondary/spp_worker_th/conn_spp_ctl.c
index 70e06f9..a67cd10 100644
--- a/src/shared/secondary/spp_worker_th/conn_spp_ctl.c
+++ b/src/shared/secondary/spp_worker_th/conn_spp_ctl.c
@@ -15,6 +15,7 @@
 #include "shared/common.h"
 #include "shared/secondary/string_buffer.h"
 #include "conn_spp_ctl.h"
+#include "shared/secondary/return_codes.h"
 
 #define RTE_LOGTYPE_SPP_COMMAND_PROC RTE_LOGTYPE_USER1
 
diff --git a/src/shared/secondary/spp_worker_th/spp_port.c b/src/shared/secondary/spp_worker_th/spp_port.c
index 7a8a088..3163274 100644
--- a/src/shared/secondary/spp_worker_th/spp_port.c
+++ b/src/shared/secondary/spp_worker_th/spp_port.c
@@ -9,6 +9,7 @@
 #include <rte_net_crc.h>
 
 #include "spp_port.h"
+#include "shared/secondary/return_codes.h"
 #include "ringlatencystats.h"
 
 /* Port ability management information */
diff --git a/src/vf/classifier_mac.c b/src/vf/classifier_mac.c
index 8d677a9..6d8e664 100644
--- a/src/vf/classifier_mac.c
+++ b/src/vf/classifier_mac.c
@@ -19,11 +19,13 @@
 #include <rte_per_lcore.h>
 #include <rte_eal.h>
 #include <rte_launch.h>
+#include <netinet/in.h>
 
+#include "classifier_mac.h"
+#include "spp_vf.h"
+#include "shared/secondary/return_codes.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"
 
 #define RTE_LOGTYPE_SPP_CLASSIFIER_MAC RTE_LOGTYPE_USER1
 
diff --git a/src/vf/spp_forward.c b/src/vf/spp_forward.c
index 3d40951..d381c92 100644
--- a/src/vf/spp_forward.c
+++ b/src/vf/spp_forward.c
@@ -4,10 +4,11 @@
 
 #include <rte_cycles.h>
 
+#include "spp_forward.h"
+#include "spp_vf.h"
+#include "shared/secondary/return_codes.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"
 
 #define RTE_LOGTYPE_FORWARD RTE_LOGTYPE_USER1
 
diff --git a/src/vf/spp_vf.c b/src/vf/spp_vf.c
index 94da67a..e55e3f0 100644
--- a/src/vf/spp_vf.c
+++ b/src/vf/spp_vf.c
@@ -6,10 +6,11 @@
 #include <arpa/inet.h>
 #include <getopt.h>
 
-#include "shared/secondary/spp_worker_th/cmd_utils.h"
 #include "spp_vf.h"
+#include "shared/secondary/spp_worker_th/cmd_utils.h"
 #include "classifier_mac.h"
 #include "spp_forward.h"
+#include "shared/secondary/return_codes.h"
 #include "shared/secondary/spp_worker_th/cmd_runner.h"
 #include "shared/secondary/spp_worker_th/cmd_parser.h"
 #include "shared/secondary/spp_worker_th/spp_port.h"
-- 
2.17.1


  parent reply	other threads:[~2019-06-24  4:36 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-24  4:36 [spp] [PATCH 00/13] Move JSON utils from libs for running cmds yasufum.o
2019-06-24  4:36 ` [spp] [PATCH 01/13] shared/sec: rename ops for setup cmd response yasufum.o
2019-06-24  4:36 ` [spp] [PATCH 02/13] shared/sec: rename functions for spp_mirror yasufum.o
2019-06-24  4:36 ` [spp] [PATCH 03/13] shared/sec: move principle JSON formatter funcs yasufum.o
2019-06-24  4:36 ` [spp] [PATCH 04/13] shared/sec: change order of args of JSON fmtters yasufum.o
2019-06-24  4:36 ` [spp] [PATCH 05/13] shared/sec: move JSON formatter to shard/secondary yasufum.o
2019-06-24  4:36 ` yasufum.o [this message]
2019-06-24  4:36 ` [spp] [PATCH 07/13] shared/sec: move JSON formatters from cmd_runner yasufum.o
2019-06-24  4:36 ` [spp] [PATCH 08/13] shared/sec: move rest of JSON formatters yasufum.o
2019-06-24  4:36 ` [spp] [PATCH 09/13] shared/sec: move lcore funcs in response_info_list yasufum.o
2019-06-24  4:36 ` [spp] [PATCH 10/13] shared/sec: move ope cli-id " yasufum.o
2019-06-24  4:36 ` [spp] [PATCH 11/13] shared/sec: move rest of ops " yasufum.o
2019-06-24  4:36 ` [spp] [PATCH 12/13] shared/sec: remove local funcs from header yasufum.o
2019-06-24  4:36 ` [spp] [PATCH 13/13] shared/sec: refactor comments for JSON formatter yasufum.o

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