From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id 6672BA046B for ; Mon, 24 Jun 2019 06:36:46 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 5E79D1BF40; Mon, 24 Jun 2019 06:36:46 +0200 (CEST) Received: from mail-pg1-f195.google.com (mail-pg1-f195.google.com [209.85.215.195]) by dpdk.org (Postfix) with ESMTP id 436851BF59 for ; Mon, 24 Jun 2019 06:36:45 +0200 (CEST) Received: by mail-pg1-f195.google.com with SMTP id y72so6394826pgd.8 for ; Sun, 23 Jun 2019 21:36:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:in-reply-to:references; bh=T9S987eIloycK5Dwz7pDRq+QloELeGBY+zuJZlIQbZk=; b=D+iNVM1aMEYfAnO11afjNuQsYgEOMdEINsv4KC33bcHBX+9Seq8mmlwQgUHeqRSHB8 +YyktW/ynaRB3f/aVBWtiJUrue8ZHteBwnlWLncqnMihIByAKmTisI13SUiJ6RQ4r1Fa cRfywT8Z7JgtDxkGvDOa9DfNz8BItnI8Np2SQY34AXy8fdRbp2g8MLJkgWxbY9KbGrXJ U6DZU1iuYAAp0XqvpDAnEXudknwAphoUAWG2sRVOsrDe6zN+X21h9iNBhKgG9kLMJ4WT vgSIrCP2yFktpbKVUkCt1CBgE322KtIcwk0RM+cM9Bi56YDflLeY/yFAay+dFNco3Ee5 4mcA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=T9S987eIloycK5Dwz7pDRq+QloELeGBY+zuJZlIQbZk=; b=Dvz1xdeb2QMydkVYpfkwOge+YbYHHaJ1DRcIEGKNTdRYnZTPDHjwyGSNSQEOSSnL20 7qhdB4pM5VRRT8qOm7jCfrXLfjCWtWba4XI1A8gzm2aA9PACZv2zGeKvrT7iJClajypV UzH3j14cxaH2maSMKy82E4nDFtKzB9vWU8Rrc2QlDSo/xeGMATcv2LA7KB33uL1wQOg+ PY2rk+7D4d1pccLjkXeuGbFBYZsoOxbrisnzyuldlDXTbSeHFrdXwFBaAwm1aKwDHgaL 4hmxaus3A5s26TiIaeXhbWP94Ihst/aIv3jlUou+Lipe1URvOwvN2xYfnfpocEK5jBZp I5Qw== X-Gm-Message-State: APjAAAWGugpeZ2r5Aiq206plkmK258f0ROwu9vVluTO1BGJp3+dhb3bu b2pyUl/7o0vayk2D6quenJ8Qu+t5 X-Google-Smtp-Source: APXvYqwDWtq39PRyolsJin70pZraMUoO1uERzdx7viAUADKI1leL95hgLDqm2A5V0DEFkK837Cahyg== X-Received: by 2002:a63:8f09:: with SMTP id n9mr30562459pgd.249.1561351004223; Sun, 23 Jun 2019 21:36:44 -0700 (PDT) Received: from localhost.localdomain ([192.47.164.146]) by smtp.gmail.com with ESMTPSA id c10sm9005178pjq.14.2019.06.23.21.36.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 23 Jun 2019 21:36:43 -0700 (PDT) From: yasufum.o@gmail.com To: spp@dpdk.org, ferruh.yigit@intel.com, yasufum.o@gmail.com Date: Mon, 24 Jun 2019 13:36:06 +0900 Message-Id: <20190624043613.19271-7-yasufum.o@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190624043613.19271-1-yasufum.o@gmail.com> References: <20190624043613.19271-1-yasufum.o@gmail.com> Subject: [spp] [PATCH 06/13] shared/sec: revise including headers X-BeenThere: spp@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Soft Patch Panel List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: spp-bounces@dpdk.org Sender: "spp" From: Yasufumi Ogawa 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 --- 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 #include -#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 #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 #include +#include #include #include @@ -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 + /** * @file cmd_utils.h * * Command utility functions for SPP worker thread. */ -#include -#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 #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 #include #include +#include +#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 +#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 #include -#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