[spp] [PATCH v2 4/5] spp_vf: remove to check unused cores no needed
x-fn-spp at sl.ntt-tx.co.jp
x-fn-spp at sl.ntt-tx.co.jp
Tue Feb 12 10:16:13 CET 2019
From: Hideyuki Yamashita <yamashita.hideyuki at po.ntt-tx.co.jp>
Checking unused core is no needed anymore after core sharing feature
is introduced. This patch removes `type` from struct `core_info` which
is used for checking unused or not.
Signed-off-by: Hideyuki Yamashita <yamashita.hideyuki at po.ntt-tx.co.jp>
Signed-off-by: Naoki Takada <takada.naoki at lab.ntt.co.jp>
---
src/vf/common/command_dec.c | 13 +------------
src/vf/common/command_proc.c | 10 ----------
src/vf/common/spp_proc.c | 14 +++++---------
src/vf/common/spp_proc.h | 4 +---
4 files changed, 7 insertions(+), 34 deletions(-)
diff --git a/src/vf/common/command_dec.c b/src/vf/common/command_dec.c
index 61dd4f4..4c3e62a 100644
--- a/src/vf/common/command_dec.c
+++ b/src/vf/common/command_dec.c
@@ -1,5 +1,5 @@
/* SPDX-License-Identifier: BSD-3-Clause
- * Copyright(c) 2017-2018 Nippon Telegraph and Telephone Corporation
+ * Copyright(c) 2017-2019 Nippon Telegraph and Telephone Corporation
*/
#include <unistd.h>
@@ -94,17 +94,6 @@ const char *PORT_ABILITY_STRINGS[] = {
/* termination */ "",
};
-/* Get component type being updated on target core */
-static enum spp_component_type
-spp_get_component_type_update(unsigned int lcore_id)
-{
- struct core_mng_info *core_info;
-
- spp_get_mng_data_addr(NULL, NULL, NULL, &core_info, NULL, NULL, NULL);
- struct core_mng_info *info = (core_info + lcore_id);
- return info->core[info->upd_index].type;
-}
-
/* Check mac address used on the port for registering or removing */
static int
spp_check_classid_used_port(
diff --git a/src/vf/common/command_proc.c b/src/vf/common/command_proc.c
index 3f44174..06e50e6 100644
--- a/src/vf/common/command_proc.c
+++ b/src/vf/common/command_proc.c
@@ -270,12 +270,6 @@ spp_update_component(
}
core = &info->core[info->upd_index];
- if ((core->type != SPP_COMPONENT_UNUSE) &&
- (core->type != type)) {
- RTE_LOG(ERR, APP, "Component type '%s' is invalid.\n",
- name);
- return SPP_RET_NG;
- }
component = (component_info + component_id);
memset(component, 0x00, sizeof(struct spp_component_info));
@@ -284,7 +278,6 @@ spp_update_component(
component->lcore_id = lcore_id;
component->component_id = component_id;
- core->type = type;
core->id[core->num] = component_id;
core->num++;
ret = SPP_RET_OK;
@@ -316,9 +309,6 @@ spp_update_component(
/* If deleted, decrement number. */
core->num--;
- if (core->num == 0)
- core->type = SPP_COMPONENT_UNUSE;
-
ret = SPP_RET_OK;
*(change_component + component_id) = 0;
break;
diff --git a/src/vf/common/spp_proc.c b/src/vf/common/spp_proc.c
index 9a118bd..cf0d760 100644
--- a/src/vf/common/spp_proc.c
+++ b/src/vf/common/spp_proc.c
@@ -1,5 +1,5 @@
/* SPDX-License-Identifier: BSD-3-Clause
- * Copyright(c) 2018 Nippon Telegraph and Telephone Corporation
+ * Copyright(c) 2018-2019 Nippon Telegraph and Telephone Corporation
*/
#include <unistd.h>
@@ -290,15 +290,11 @@ dump_core_info(const struct core_mng_info *core_info)
lcore_id, info->status,
info->ref_index, info->upd_index);
- sprintf(str, "core[%d]-0 type=%d, num=%d", lcore_id,
- info->core[0].type, info->core[0].num);
- dump_buff(str, info->core[0].id,
- sizeof(int)*info->core[0].num);
+ memset(str, 0x00, SPP_NAME_STR_LEN);
+ dump_buff(str, info->core[0].id, sizeof(int)*info->core[0].num);
- sprintf(str, "core[%d]-1 type=%d, num=%d", lcore_id,
- info->core[1].type, info->core[1].num);
- dump_buff(str, info->core[1].id,
- sizeof(int)*info->core[1].num);
+ sprintf(str, "core[%d]-1 num=%d", lcore_id, info->core[1].num);
+ dump_buff(str, info->core[1].id, sizeof(int)*info->core[1].num);
}
}
diff --git a/src/vf/common/spp_proc.h b/src/vf/common/spp_proc.h
index 2fc8cc2..8112af3 100644
--- a/src/vf/common/spp_proc.h
+++ b/src/vf/common/spp_proc.h
@@ -1,5 +1,5 @@
/* SPDX-License-Identifier: BSD-3-Clause
- * Copyright(c) 2018 Nippon Telegraph and Telephone Corporation
+ * Copyright(c) 2018-2019 Nippon Telegraph and Telephone Corporation
*/
#ifndef _SPP_PROC_H_
@@ -244,8 +244,6 @@ struct iface_info {
/* Manage component running in core as global variable */
struct core_info {
- volatile enum spp_component_type type;
- /* Component type */
int num; /* The number of IDs below */
int id[RTE_MAX_LCORE]; /* ID list of components executed on cpu core */
};
--
2.17.1
More information about the spp
mailing list