From patchwork Sat May 2 00:02:42 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Honnappa Nagarahalli X-Patchwork-Id: 186047 Delivered-To: patch@linaro.org Received: by 2002:a50:3a95:0:0:0:0:0 with SMTP id v21csp791705ecc; Fri, 1 May 2020 17:03:32 -0700 (PDT) X-Google-Smtp-Source: APiQypJVKMsXz5YBRnB0g60aOKbFgB/T/G7UaBcRzMkd/yFmMpBKc4Y1yetRy7NCfAcUvdyUoE4H X-Received: by 2002:a17:906:1751:: with SMTP id d17mr5509731eje.314.1588377812275; Fri, 01 May 2020 17:03:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588377812; cv=none; d=google.com; s=arc-20160816; b=haUs1W9FDp0i5TGUH2lsRwu+drpBOkUNowh3k2Nvzzh7k8rVzGjjggtOB0Bhs6WCQp 3KKWKRXbrEjTMctm3U7uclcvgUqaacXaF3ma7dWAwUTZtWQE/RzHgjkaZzUBMjS//dx0 SqLuCK+CyfVF/iPEYzmewnaWKV7achW3t4AGMWazcwZPfs1NYx4mrj9aDtyVqbgbgJNK JtUZyuzPfTVZtTTJ1xwICbqFcJ5bNOGYW1KKv5Qi7OcDdrdNw33Awlt9uz6lBXlPgNim U4+Zrnlh9iLoW2lc2XmpwxfNs8JVVuj/C7914TwZogfv3TrhutRwv4vI6kz8RK0Yf0k0 nUdg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:references:in-reply-to :message-id:date:cc:to:from; bh=8A/lGn4mnBxZRyPpp9IvgJ+7ETHUqOhplmTAujLy4PM=; b=RHkhhQhd0b21yk+f/zgfArAnJ/GQHzi4lF4U9YCJMd9Guk9cFn0B0DyZjUocpwMDmp D5KB0dDqDg58fw+v+zXtyQtc5xe9yIgvqusJrjF5oH/StGSVC9H1QT836v0caR4/GMM/ VUuYOHw8Wf7pbpYY3MNqXzovASKrMYvs4C+AFrm7DvpzvwmepBBBz4e1UZxwmcVgSZ2Y 7pcDOtJyy7e2Qz7lSBctTynjirh6ZIzbmYlbJPfJikaEVwFZUVXoEwvJ+Sklyei7E8mX 8hWSw3EfW7HzUr7Pvs9bYaJTiVQwJnNEu/KneQ9hT9yy+QcE3HubVKTWfJXw+0Wg/I7k naVA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org Return-Path: Received: from dpdk.org (dpdk.org. [92.243.14.124]) by mx.google.com with ESMTP id s8si2809603edr.485.2020.05.01.17.03.32; Fri, 01 May 2020 17:03:32 -0700 (PDT) Received-SPF: pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) client-ip=92.243.14.124; Authentication-Results: mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 646001D9E7; Sat, 2 May 2020 02:03:08 +0200 (CEST) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by dpdk.org (Postfix) with ESMTP id C04F51D99E for ; Sat, 2 May 2020 02:03:04 +0200 (CEST) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 52154113E; Fri, 1 May 2020 17:03:04 -0700 (PDT) Received: from qc2400f-1.austin.arm.com (qc2400f-1.austin.arm.com [10.118.14.48]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 3ECE13F305; Fri, 1 May 2020 17:03:04 -0700 (PDT) From: Honnappa Nagarahalli To: dev@dpdk.org, phil.yang@arm.com, harry.van.haaren@intel.com Cc: thomas@monjalon.net, david.marchand@redhat.com, konstantin.ananyev@intel.com, jerinj@marvell.com, hemant.agrawal@nxp.com, gage.eads@intel.com, bruce.richardson@intel.com, honnappa.nagarahalli@arm.com, nd@arm.com Date: Fri, 1 May 2020 19:02:42 -0500 Message-Id: <20200502000245.11071-4-honnappa.nagarahalli@arm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200502000245.11071-1-honnappa.nagarahalli@arm.com> References: <1587659482-27133-1-git-send-email-phil.yang@arm.com> <20200502000245.11071-1-honnappa.nagarahalli@arm.com> Subject: [dpdk-dev] [PATCH v3 3/6] service: remove rte prefix from static functions X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" From: Phil Yang clean up rte prefix from static functions. remove unused parameter for service_dump_one function. Signed-off-by: Phil Yang Reviewed-by: Honnappa Nagarahalli --- lib/librte_eal/common/rte_service.c | 34 ++++++++++------------------- 1 file changed, 11 insertions(+), 23 deletions(-) -- 2.17.1 Acked-by: Harry van Haaren diff --git a/lib/librte_eal/common/rte_service.c b/lib/librte_eal/common/rte_service.c index c89472b83..ed2070267 100644 --- a/lib/librte_eal/common/rte_service.c +++ b/lib/librte_eal/common/rte_service.c @@ -340,7 +340,7 @@ rte_service_runstate_get(uint32_t id) } static inline void -rte_service_runner_do_callback(struct rte_service_spec_impl *s, +service_runner_do_callback(struct rte_service_spec_impl *s, struct core_state *cs, uint32_t service_idx) { void *userdata = s->spec.callback_userdata; @@ -378,10 +378,10 @@ service_run(uint32_t i, struct core_state *cs, uint64_t service_mask, if (!rte_atomic32_cmpset((uint32_t *)&s->execute_lock, 0, 1)) return -EBUSY; - rte_service_runner_do_callback(s, cs, i); + service_runner_do_callback(s, cs, i); rte_atomic32_clear(&s->execute_lock); } else - rte_service_runner_do_callback(s, cs, i); + service_runner_do_callback(s, cs, i); return 0; } @@ -425,14 +425,14 @@ rte_service_run_iter_on_app_lcore(uint32_t id, uint32_t serialize_mt_unsafe) } static int32_t -rte_service_runner_func(void *arg) +service_runner_func(void *arg) { RTE_SET_USED(arg); uint32_t i; const int lcore = rte_lcore_id(); struct core_state *cs = &lcore_states[lcore]; - while (lcore_states[lcore].runstate == RUNSTATE_RUNNING) { + while (cs->runstate == RUNSTATE_RUNNING) { const uint64_t service_mask = cs->service_mask; for (i = 0; i < RTE_SERVICE_NUM_MAX; i++) { @@ -693,9 +693,9 @@ rte_service_lcore_start(uint32_t lcore) /* set core to run state first, and then launch otherwise it will * return immediately as runstate keeps it in the service poll loop */ - lcore_states[lcore].runstate = RUNSTATE_RUNNING; + cs->runstate = RUNSTATE_RUNNING; - int ret = rte_eal_remote_launch(rte_service_runner_func, 0, lcore); + int ret = rte_eal_remote_launch(service_runner_func, 0, lcore); /* returns -EBUSY if the core is already launched, 0 on success */ return ret; } @@ -774,13 +774,9 @@ rte_service_lcore_attr_get(uint32_t lcore, uint32_t attr_id, } static void -rte_service_dump_one(FILE *f, struct rte_service_spec_impl *s, - uint64_t all_cycles, uint32_t reset) +service_dump_one(FILE *f, struct rte_service_spec_impl *s, uint32_t reset) { /* avoid divide by zero */ - if (all_cycles == 0) - all_cycles = 1; - int calls = 1; if (s->calls != 0) calls = s->calls; @@ -807,7 +803,7 @@ rte_service_attr_reset_all(uint32_t id) SERVICE_VALID_GET_OR_ERR_RET(id, s, -EINVAL); int reset = 1; - rte_service_dump_one(NULL, s, 0, reset); + service_dump_one(NULL, s, reset); return 0; } @@ -851,21 +847,13 @@ rte_service_dump(FILE *f, uint32_t id) uint32_t i; int print_one = (id != UINT32_MAX); - uint64_t total_cycles = 0; - - for (i = 0; i < RTE_SERVICE_NUM_MAX; i++) { - if (!service_valid(i)) - continue; - total_cycles += rte_services[i].cycles_spent; - } - /* print only the specified service */ if (print_one) { struct rte_service_spec_impl *s; SERVICE_VALID_GET_OR_ERR_RET(id, s, -EINVAL); fprintf(f, "Service %s Summary\n", s->spec.name); uint32_t reset = 0; - rte_service_dump_one(f, s, total_cycles, reset); + service_dump_one(f, s, reset); return 0; } @@ -875,7 +863,7 @@ rte_service_dump(FILE *f, uint32_t id) if (!service_valid(i)) continue; uint32_t reset = 0; - rte_service_dump_one(f, &rte_services[i], total_cycles, reset); + service_dump_one(f, &rte_services[i], reset); } fprintf(f, "Service Cores Summary\n");