From f7f4553772881fb4d49bd55d94c3fc3eaccc8403 Mon Sep 17 00:00:00 2001 From: Patrice Buriez Date: Wed, 12 Jun 2019 17:17:26 +0200 Subject: [PATCH] Simplify cores_task_are_valid() by means of calling core_task_is_valid() Change-Id: Ice64aabc84066633288ff43d4dc9af3f5b378e33 Signed-off-by: Xavier Simonart Signed-off-by: Patrice Buriez --- VNFs/DPPD-PROX/cmd_parser.c | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/VNFs/DPPD-PROX/cmd_parser.c b/VNFs/DPPD-PROX/cmd_parser.c index a1d101f8..927abc29 100644 --- a/VNFs/DPPD-PROX/cmd_parser.c +++ b/VNFs/DPPD-PROX/cmd_parser.c @@ -76,19 +76,8 @@ static int cores_task_are_valid(unsigned int *lcores, int task_id, unsigned int unsigned int lcore_id; for (unsigned int i = 0; i < nb_cores; i++) { lcore_id = lcores[i]; - if (lcore_id >= RTE_MAX_LCORE) { - plog_err("Invalid core id %u (lcore ID above %d)\n", lcore_id, RTE_MAX_LCORE); + if (core_task_is_valid(lcore_id, task_id) == 0) return 0; - } - else if (!prox_core_active(lcore_id, 0)) { - plog_err("Invalid core id %u (lcore is not active)\n", lcore_id); - return 0; - } - else if (task_id >= lcore_cfg[lcore_id].n_tasks_all) { - plog_err("Invalid task id (valid task IDs for core %u are below %u)\n", - lcore_id, lcore_cfg[lcore_id].n_tasks_all); - return 0; - } } return 1; } -- 2.16.6