From: ogawa.yasufumi@lab.ntt.co.jp
To: spp@dpdk.org, ferruh.yigit@intel.com, ogawa.yasufumi@lab.ntt.co.jp
Subject: [spp] [PATCH 3/6] shared/sec: rename funcs of flush cmd
Date: Fri, 31 May 2019 12:36:56 +0900 [thread overview]
Message-ID: <1559273819-26243-4-git-send-email-ogawa.yasufumi@lab.ntt.co.jp> (raw)
In-Reply-To: <1559273819-26243-1-git-send-email-ogawa.yasufumi@lab.ntt.co.jp>
From: Yasufumi Ogawa <ogawa.yasufumi@lab.ntt.co.jp>
This update is to rename functions of flushing temporarily stored
command.
Signed-off-by: Yasufumi Ogawa <ogawa.yasufumi@lab.ntt.co.jp>
---
.../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
next prev parent reply other threads:[~2019-05-31 3:39 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-05-31 3:36 [spp] [PATCH 0/6] Refactor functions for manipulating thread info ogawa.yasufumi
2019-05-31 3:36 ` [spp] [PATCH 1/6] shared/sec: refactor func for deleting comp info ogawa.yasufumi
2019-05-31 3:36 ` [spp] [PATCH 2/6] shared/sec: revise types of spp worker ogawa.yasufumi
2019-05-31 3:36 ` ogawa.yasufumi [this message]
2019-05-31 3:36 ` [spp] [PATCH 4/6] shared/sec: rename file spp_proc to cmd_utils ogawa.yasufumi
2019-05-31 3:36 ` [spp] [PATCH 5/6] shared/sec: refactor name of funcs for exec cmd ogawa.yasufumi
2019-05-31 3:36 ` [spp] [PATCH 6/6] shared/sec: rename struct spp_command ogawa.yasufumi
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=1559273819-26243-4-git-send-email-ogawa.yasufumi@lab.ntt.co.jp \
--to=ogawa.yasufumi@lab.ntt.co.jp \
--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).