From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail04.ics.ntt-tx.co.jp (mail05.ics.ntt-tx.co.jp [210.232.35.69]) by dpdk.org (Postfix) with ESMTP id 68C605F51 for ; Wed, 21 Nov 2018 02:41:12 +0100 (CET) Received: from gwchk03.silk.ntt-tx.co.jp (gwchk03.silk.ntt-tx.co.jp [10.107.0.111]) by mail04.ics.ntt-tx.co.jp (unknown) with ESMTP id wAL1fAx3002771; Wed, 21 Nov 2018 10:41:10 +0900 Received: (from root@localhost) by gwchk03.silk.ntt-tx.co.jp (unknown) id wAL1f858004660; Wed, 21 Nov 2018 10:41:08 +0900 Received: from gwchk.silk.ntt-tx.co.jp [10.107.0.110] by gwchk03.silk.ntt-tx.co.jp with ESMTP id LAA01906; Wed, 21 Nov 2018 10:36:02 +0900 Received: from imss03.silk.ntt-tx.co.jp (localhost [127.0.0.1]) by imss03.silk.ntt-tx.co.jp (unknown) with ESMTP id wAL1a2vW009725; Wed, 21 Nov 2018 10:36:02 +0900 Received: from mgate02.silk.ntt-tx.co.jp (smtp02.silk.ntt-tx.co.jp [10.107.0.37]) by imss03.silk.ntt-tx.co.jp (unknown) with ESMTP id wAL1a26B009720; Wed, 21 Nov 2018 10:36:02 +0900 Message-Id: <201811210136.wAL1a26B009720@imss03.silk.ntt-tx.co.jp> Received: from localhost by mgate02.silk.ntt-tx.co.jp (unknown) id wAL1ZwWp008346 ; Wed, 21 Nov 2018 10:36:01 +0900 From: x-fn-spp@sl.ntt-tx.co.jp To: ferruh.yigit@intel.com, ogawa.yasufumi@lab.ntt.co.jp Cc: spp@dpdk.org Date: Wed, 21 Nov 2018 10:35:58 +0900 X-Mailer: git-send-email 2.18.0 In-Reply-To: <20181121013558.8869-1-x-fn-spp@sl.ntt-tx.co.jp> References: <20181121013558.8869-1-x-fn-spp@sl.ntt-tx.co.jp> X-TM-AS-MML: No Subject: [spp] [PATCH 23/23] spp_vf: add SPP_VF_MODULE preprocessor directive 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: , X-List-Received-Date: Wed, 21 Nov 2018 01:41:13 -0000 From: Hideyuki Yamashita Add `SPP_VF_MODULE` preprocessor directive to compile just spp_vf in selective. Signed-off-by: Hideyuki Yamashita Signed-off-by: Naoki Takada --- src/vf/common/command_dec.c | 2 ++ src/vf/common/command_proc.c | 13 ++++++++++++- src/vf/common/spp_proc.c | 4 ++++ 3 files changed, 18 insertions(+), 1 deletion(-) diff --git a/src/vf/common/command_dec.c b/src/vf/common/command_dec.c index 82cd619..84268de 100644 --- a/src/vf/common/command_dec.c +++ b/src/vf/common/command_dec.c @@ -186,6 +186,7 @@ spp_convert_port_to_iface(const char *port, static enum spp_component_type spp_convert_component_type(const char *type_str) { +#ifdef SPP_VF_MODULE if (strncmp(type_str, CORE_TYPE_CLASSIFIER_MAC_STR, strlen(CORE_TYPE_CLASSIFIER_MAC_STR)+1) == 0) { /* Classifier */ @@ -199,6 +200,7 @@ spp_convert_component_type(const char *type_str) /* Forwarder */ return SPP_COMPONENT_FORWARD; } +#endif /* SPP_VF_MODULE */ return SPP_COMPONENT_UNUSE; } diff --git a/src/vf/common/command_proc.c b/src/vf/common/command_proc.c index 0c62968..f274707 100644 --- a/src/vf/common/command_proc.c +++ b/src/vf/common/command_proc.c @@ -10,8 +10,10 @@ #include "spp_port.h" #include "string_buffer.h" +#ifdef SPP_VF_MODULE #include "../classifier_mac.h" #include "../spp_forward.h" +#endif /* SPP_VF_MODULE */ #include "command_conn.h" #include "command_dec.h" #include "command_proc.h" @@ -467,6 +469,7 @@ spp_iterate_core_info(struct spp_iterate_core_params *params) } for (cnt = 0; cnt < core->num; cnt++) { +#ifdef SPP_VF_MODULE if (core->type == SPP_COMPONENT_CLASSIFIER_MAC) { ret = spp_classifier_get_component_status( lcore_id, @@ -478,6 +481,7 @@ spp_iterate_core_info(struct spp_iterate_core_params *params) core->id[cnt], params); } +#endif /* SPP_VF_MODULE */ if (unlikely(ret != 0)) { RTE_LOG(ERR, APP, "Cannot iterate core " "information. " @@ -492,6 +496,7 @@ spp_iterate_core_info(struct spp_iterate_core_params *params) } /* Iterate classifier_table to create response to status command */ +#ifdef SPP_VF_MODULE static int spp_iterate_classifier_table( struct spp_iterate_classifier_table_params *params) @@ -506,6 +511,7 @@ spp_iterate_classifier_table( return SPP_RET_OK; } +#endif /* SPP_VF_MODULE */ /* Get port number assigned by DPDK lib */ static int @@ -1119,6 +1125,7 @@ append_core_value(const char *name, char **output, } /* append one element of classifier table for JSON format */ +#ifdef SPP_VF_MODULE static int append_classifier_element_value( struct spp_iterate_classifier_table_params *params, @@ -1171,8 +1178,10 @@ append_classifier_element_value( params->output = buff; return ret; } +#endif /* SPP_VF_MODULE */ /* append a list of classifier table for JSON format */ +#ifdef SPP_VF_MODULE static int append_classifier_table_value(const char *name, char **output, void *tmp __attribute__ ((unused))) @@ -1200,7 +1209,7 @@ append_classifier_table_value(const char *name, char **output, spp_strbuf_free(itr_params.output); return ret; } - +#endif /* SPP_VF_MODULE */ /* append string of command response list for JSON format */ static int append_response_list_value(char **output, @@ -1276,7 +1285,9 @@ struct command_response_list response_info_list[] = { { "vhost", append_interface_value }, { "ring", append_interface_value }, { "core", append_core_value }, +#ifdef SPP_VF_MODULE { "classifier_table", append_classifier_table_value }, +#endif /* SPP_VF_MODULE */ COMMAND_RESP_TAG_LIST_EMPTY }; diff --git a/src/vf/common/spp_proc.c b/src/vf/common/spp_proc.c index 87fb9d3..5119612 100644 --- a/src/vf/common/spp_proc.c +++ b/src/vf/common/spp_proc.c @@ -14,8 +14,10 @@ #include "spp_proc.h" #include "spp_port.h" +#ifdef SPP_VF_MODULE #include "../spp_forward.h" #include "../classifier_mac.h" +#endif /* SPP_VF_MODULE */ /* Manage data to addoress */ struct manage_data_addr_info { @@ -880,10 +882,12 @@ flush_component(void) component_info = (p_component_info + cnt); spp_port_ability_update(component_info); +#ifdef SPP_VF_MODULE if (component_info->type == SPP_COMPONENT_CLASSIFIER_MAC) ret = spp_classifier_mac_update(component_info); else ret = spp_forward_update(component_info); +#endif /* SPP_VF_MODULE */ if (unlikely(ret < 0)) { RTE_LOG(ERR, APP, "Flush error. " "( component = %s, type = %d)\n", -- 2.18.0