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 4FA44A045E for ; Fri, 31 May 2019 05:39:34 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 42ACC2C60; Fri, 31 May 2019 05:39:34 +0200 (CEST) Received: from tama50.ecl.ntt.co.jp (tama50.ecl.ntt.co.jp [129.60.39.147]) by dpdk.org (Postfix) with ESMTP id 6CF122C60 for ; Fri, 31 May 2019 05:39:32 +0200 (CEST) Received: from vc2.ecl.ntt.co.jp (vc2.ecl.ntt.co.jp [129.60.86.154]) by tama50.ecl.ntt.co.jp (8.13.8/8.13.8) with ESMTP id x4V3dVvH023685; Fri, 31 May 2019 12:39:31 +0900 Received: from vc2.ecl.ntt.co.jp (localhost [127.0.0.1]) by vc2.ecl.ntt.co.jp (Postfix) with ESMTP id 58A486395D7; Fri, 31 May 2019 12:39:31 +0900 (JST) Received: from localhost.localdomain (lobster.nslab.ecl.ntt.co.jp [129.60.13.95]) by vc2.ecl.ntt.co.jp (Postfix) with ESMTP id 4A10E6395DE; Fri, 31 May 2019 12:39:31 +0900 (JST) From: ogawa.yasufumi@lab.ntt.co.jp To: spp@dpdk.org, ferruh.yigit@intel.com, ogawa.yasufumi@lab.ntt.co.jp Date: Fri, 31 May 2019 12:36:56 +0900 Message-Id: <1559273819-26243-4-git-send-email-ogawa.yasufumi@lab.ntt.co.jp> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1559273819-26243-1-git-send-email-ogawa.yasufumi@lab.ntt.co.jp> References: <1559273819-26243-1-git-send-email-ogawa.yasufumi@lab.ntt.co.jp> X-TM-AS-MML: disable Subject: [spp] [PATCH 3/6] shared/sec: rename funcs of flush cmd 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 This update is to rename functions of flushing temporarily stored command. Signed-off-by: Yasufumi Ogawa --- .../secondary/spp_worker_th/cmd_runner.c | 23 +++++------ src/shared/secondary/spp_worker_th/spp_proc.c | 40 ++++++++++--------- src/shared/secondary/spp_worker_th/spp_proc.h | 22 +++++----- 3 files changed, 42 insertions(+), 43 deletions(-) diff --git a/src/shared/secondary/spp_worker_th/cmd_runner.c b/src/shared/secondary/spp_worker_th/cmd_runner.c index 5df7b92..f8ce5ac 100644 --- a/src/shared/secondary/spp_worker_th/cmd_runner.c +++ b/src/shared/secondary/spp_worker_th/cmd_runner.c @@ -475,26 +475,25 @@ update_port(enum sppwk_action wk_action, return ret; } -/* Flush command to execute it */ +/* Activate temporarily stored command. */ static int -spp_flush(void) +flush_cmd(void) { - int ret = SPP_RET_NG; + int ret; struct cancel_backup_info *backup_info = NULL; sppwk_get_mng_data(NULL, NULL, NULL, NULL, NULL, NULL, &backup_info); - /* Initial setting of each interface. */ - ret = flush_port(); + ret = update_port_info(); if (ret < SPP_RET_OK) return ret; - /* Flush of core index. */ - flush_core(); + /* TODO(yasufum) confirm why no returned value. */ + update_lcore_info(); - /* Flush of component */ - ret = flush_component(); + /* TODO(yasufum) confirm why no checking for returned value. */ + ret = update_comp_info(); backup_mng_info(backup_info); return ret; @@ -744,7 +743,7 @@ exec_cmd(const struct spp_command *cmd) &cmd->spec.cls_table.port); if (ret == 0) { RTE_LOG(INFO, WK_CMD_RUNNER, "Exec flush.\n"); - ret = spp_flush(); + ret = flush_cmd(); } break; @@ -756,7 +755,7 @@ exec_cmd(const struct spp_command *cmd) cmd->spec.comp.wk_type); if (ret == 0) { RTE_LOG(INFO, WK_CMD_RUNNER, "Exec flush.\n"); - ret = spp_flush(); + ret = flush_cmd(); } break; @@ -768,7 +767,7 @@ exec_cmd(const struct spp_command *cmd) cmd->spec.port.name, &cmd->spec.port.ability); if (ret == 0) { RTE_LOG(INFO, WK_CMD_RUNNER, "Exec flush.\n"); - ret = spp_flush(); + ret = flush_cmd(); } break; diff --git a/src/shared/secondary/spp_worker_th/spp_proc.c b/src/shared/secondary/spp_worker_th/spp_proc.c index b51486f..3cdc108 100644 --- a/src/shared/secondary/spp_worker_th/spp_proc.c +++ b/src/shared/secondary/spp_worker_th/spp_proc.c @@ -19,6 +19,7 @@ #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 /* A set of pointers of management data */ @@ -812,9 +813,9 @@ delete_port_info(struct sppwk_port_info *p_info, int nof_ports, return SPP_RET_OK; } -/* Flush initial setting of each interface. */ +/* Activate temporarily stored port info while flushing. */ int -flush_port(void) +update_port_info(void) { int ret = 0; int cnt = 0; @@ -846,9 +847,9 @@ flush_port(void) return SPP_RET_OK; } -/* Flush changed core. */ +/* Activate temporarily stored lcore info while flushing. */ void -flush_core(void) +update_lcore_info(void) { int cnt = 0; struct core_mng_info *info = NULL; @@ -877,38 +878,39 @@ flush_core(void) } } -/* Flush change for forwarder or classifier_mac */ +/* Activate temporarily stored component info while flushing. */ int -flush_component(void) +update_comp_info(void) { int ret = 0; int cnt = 0; - struct spp_component_info *component_info = NULL; - int *p_change_component = g_mng_data.p_change_component; - struct spp_component_info *p_component_info = - g_mng_data.p_component_info; + struct spp_component_info *comp_info = NULL; + int *p_change_comp = g_mng_data.p_change_component; + struct spp_component_info *p_comp_info = g_mng_data.p_component_info; for (cnt = 0; cnt < RTE_MAX_LCORE; cnt++) { - if (*(p_change_component + cnt) == 0) + if (*(p_change_comp + cnt) == 0) continue; - component_info = (p_component_info + cnt); - spp_port_ability_update(component_info); + comp_info = (p_comp_info + cnt); + spp_port_ability_update(comp_info); #ifdef SPP_VF_MODULE - if (component_info->wk_type == SPPWK_TYPE_CLS) - ret = spp_classifier_mac_update(component_info); + if (comp_info->wk_type == SPPWK_TYPE_CLS) + ret = spp_classifier_mac_update(comp_info); else - ret = spp_forward_update(component_info); + ret = spp_forward_update(comp_info); #endif /* SPP_VF_MODULE */ + #ifdef SPP_MIRROR_MODULE - ret = spp_mirror_update(component_info); + ret = spp_mirror_update(comp_info); #endif /* SPP_MIRROR_MODULE */ + if (unlikely(ret < 0)) { RTE_LOG(ERR, APP, "Flush error. " "( component = %s, type = %d)\n", - component_info->name, - component_info->wk_type); + comp_info->name, + comp_info->wk_type); return SPP_RET_NG; } } diff --git a/src/shared/secondary/spp_worker_th/spp_proc.h b/src/shared/secondary/spp_worker_th/spp_proc.h index 491274a..c066f0c 100644 --- a/src/shared/secondary/spp_worker_th/spp_proc.h +++ b/src/shared/secondary/spp_worker_th/spp_proc.h @@ -595,25 +595,23 @@ int delete_port_info(struct sppwk_port_info *p_info, int nof_ports, struct sppwk_port_info *p_info_ary[]); /** - * Flush initial setting of each interface. + * Activate temporarily stored port info while flushing. * - * @retval SPP_RET_OK succeeded. - * @retval SPP_RET_NG failed. + * @retval SPP_RET_OK if succeeded. + * @retval SPP_RET_NG if failed. */ -int flush_port(void); +int update_port_info(void); -/** - * Flush changed core. - */ -void flush_core(void); +/* Activate temporarily stored lcore info while flushing. */ +void update_lcore_info(void); /** - * Flush change for forwarder or classifier_mac. + * Activate temporarily stored component info while flushing. * - * @retval SPP_RET_OK succeeded. - * @retval SPP_RET_NG failed. + * @retval SPP_RET_OK if succeeded. + * @retval SPP_RET_NG if failed. */ -int flush_component(void); +int update_comp_info(void); /** * Port type to string -- 2.17.1